Hello community, here is the log from the commit of package python-rpy2 for openSUSE:Factory checked in at 2018-08-10 09:50:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-rpy2 (Old) and /work/SRC/openSUSE:Factory/.python-rpy2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-rpy2" Fri Aug 10 09:50:03 2018 rev:3 rq:628247 version:2.9.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-rpy2/python-rpy2.changes 2018-05-19 15:43:41.955920963 +0200 +++ /work/SRC/openSUSE:Factory/.python-rpy2.new/python-rpy2.changes 2018-08-10 09:50:05.814300784 +0200 @@ -1,0 +2,20 @@ +Wed Aug 8 17:33:45 UTC 2018 - [email protected] + +- Update to 2.9.4 + * Fallback for failure to import numpy or pandas is now dissociated from + failure to import :mod:`numpy2ri` or :mod:`pandas2ri` (issue #463). + * :func:`repr` for R POSIX date/time vectors is now showing a string + representation of the date/time rather than the timestamp as a float + (issue #467). + * The HTML representation of R data frame (the default representation in the + Jupyter notebook) was displaying an inconsistent number of rows + (found while workin on issue #466). + * Handle time zones in timezones in Pandas when converting to R data frames + (issue #454). + * When exiting the Python process, the R cleanup is now explicitly request + to happen before Python's exit. This is preventing possible segfaults + the process is terminating (issue #471). + * dplyr method `ungroup()` was missing from + :class:`rpy2.robjects.lib.dplyr.DataFrame` (issue #473). + +------------------------------------------------------------------- Old: ---- rpy2-2.9.3.tar.gz New: ---- rpy2-2.9.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-rpy2.spec ++++++ --- /var/tmp/diff_new_pack.HI9tAi/_old 2018-08-10 09:50:06.770302326 +0200 +++ /var/tmp/diff_new_pack.HI9tAi/_new 2018-08-10 09:50:06.774302332 +0200 @@ -20,7 +20,7 @@ %define skip_python2 1 %bcond_with test Name: python-rpy2 -Version: 2.9.3 +Version: 2.9.4 Release: 0 Summary: A Python interface to the R Programming Language License: GPL-2.0-or-later ++++++ rpy2-2.9.3.tar.gz -> rpy2-2.9.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/NEWS new/rpy2-2.9.4/NEWS --- old/rpy2-2.9.3/NEWS 2018-04-14 16:22:00.000000000 +0200 +++ new/rpy2-2.9.4/NEWS 2018-06-26 00:19:53.000000000 +0200 @@ -1,3 +1,31 @@ +Release 2.9.4 +============= + +Bugs fixed +---------- + +- Fallback for failure to import numpy or pandas is now dissociated from + failure to import :mod:`numpy2ri` or :mod:`pandas2ri` (issue #463). + +- :func:`repr` for R POSIX date/time vectors is now showing a string + representation of the date/time rather than the timestamp as a float + (issue #467). + +- The HTML representation of R data frame (the default representation in the + Jupyter notebook) was displaying an inconsistent number of rows + (found while workin on issue #466). + +- Handle time zones in timezones in Pandas when converting to R data frames + (issue #454). + +- When exiting the Python process, the R cleanup is now explicitly request + to happen before Python's exit. This is preventing possible segfaults + the process is terminating (issue #471). + +- dplyr method `ungroup()` was missing from + :class:`rpy2.robjects.lib.dplyr.DataFrame` (issue #473). + + Release 2.9.3 ============= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/PKG-INFO new/rpy2-2.9.4/PKG-INFO --- old/rpy2-2.9.3/PKG-INFO 2018-04-14 16:22:35.000000000 +0200 +++ new/rpy2-2.9.4/PKG-INFO 2018-06-26 00:20:43.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: rpy2 -Version: 2.9.3 +Version: 2.9.4 Summary: Python interface to the R language (embedded R) Home-page: https://rpy2.bitbucket.io Author: Laurent Gautier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/doc/generated_rst/README new/rpy2-2.9.4/doc/generated_rst/README --- old/rpy2-2.9.3/doc/generated_rst/README 1970-01-01 01:00:00.000000000 +0100 +++ new/rpy2-2.9.4/doc/generated_rst/README 2015-09-28 02:33:20.000000000 +0200 @@ -0,0 +1 @@ +This directory contains rst files dynamically generated. \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/__init__.py new/rpy2-2.9.4/rpy/__init__.py --- old/rpy2-2.9.3/rpy/__init__.py 2018-04-14 16:22:00.000000000 +0200 +++ new/rpy2-2.9.4/rpy/__init__.py 2018-06-26 00:19:53.000000000 +0200 @@ -1,5 +1,5 @@ -__version_vector__ = ((2,9,3), '') +__version_vector__ = ((2,9,4), '') __version__ = '.'.join([str(x) for x in __version_vector__[0]]) + \ '' + __version_vector__[1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/ipython/rmagic.py new/rpy2-2.9.4/rpy/ipython/rmagic.py --- old/rpy2-2.9.3/rpy/ipython/rmagic.py 2018-04-14 16:22:00.000000000 +0200 +++ new/rpy2-2.9.4/rpy/ipython/rmagic.py 2018-06-26 00:19:53.000000000 +0200 @@ -61,25 +61,30 @@ # Try loading pandas and numpy, emitting a warning if either cannot be # loaded. try: - from rpy2.robjects import numpy2ri - template_converter += numpy2ri.converter + import numpy try: - from rpy2.robjects import pandas2ri - template_converter += pandas2ri.converter + import pandas except ImportError: + pandas = None warnings.warn(' '.join(("The Python package 'pandas' is strongly" "recommended when using `rpy2.ipython`.", "Unfortunately it could not be loaded,", "but at least we found 'numpy'."))) except ImportError: # Give up on numerics + numpy = None warnings.warn(' '.join(("The Python package 'pandas' is strongly", "recommended when using `rpy2.ipython`.", "Unfortunately it could not be loaded,", "as we did not manage to load 'numpy'", "first."))) - - +if numpy: + from rpy2.robjects import numpy2ri + template_converter += numpy2ri.converter + if pandas: + from rpy2.robjects import pandas2ri + template_converter += pandas2ri.converter + # IPython imports diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/ipython/tests/test_rmagic.py new/rpy2-2.9.4/rpy/ipython/tests/test_rmagic.py --- old/rpy2-2.9.3/rpy/ipython/tests/test_rmagic.py 2018-04-14 16:22:00.000000000 +0200 +++ new/rpy2-2.9.4/rpy/ipython/tests/test_rmagic.py 2018-06-16 21:17:15.000000000 +0200 @@ -30,6 +30,7 @@ import rpy2.robjects.packages as rpacks class TestRmagic(unittest.TestCase): + @classmethod def setUpClass(cls): '''Set up an IPython session just once. @@ -44,6 +45,7 @@ def setUp(self): if hasattr(rmagic.template_converter, 'activate'): rmagic.template_converter.activate() + def tearDown(self): # This seems like the safest thing to return to a safe state self.ip.run_line_magic('Rdevice', 'png') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/rinterface/__init__.py new/rpy2-2.9.4/rpy/rinterface/__init__.py --- old/rpy2-2.9.3/rpy/rinterface/__init__.py 2017-11-04 17:54:54.000000000 +0100 +++ new/rpy2-2.9.4/rpy/rinterface/__init__.py 2018-06-26 00:19:53.000000000 +0200 @@ -1,3 +1,4 @@ +import atexit import os import sys import warnings @@ -200,6 +201,12 @@ template[0][2][1][2] = rpy_fun return baseenv['eval'](template) +_initr = initr +def initr(r_preservehash=False): + """"Wrapper around rpy2.rinterface._rinterface.initr().""" + atexit.register(endr, 0) + _initr(r_preservehash=r_preservehash) + # def cleanUp(saveact, status, runlast): # return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/rinterface/tests/test_Sexp.py new/rpy2-2.9.4/rpy/rinterface/tests/test_Sexp.py --- old/rpy2-2.9.3/rpy/rinterface/tests/test_Sexp.py 2015-09-05 01:15:16.000000000 +0200 +++ new/rpy2-2.9.4/rpy/rinterface/tests/test_Sexp.py 2018-06-17 03:25:12.000000000 +0200 @@ -183,7 +183,7 @@ sexp = rinterface.IntSexpVector([1,2,3]) self.assertEqual(0, sexp.named) rinterface.baseenv.get("identity")(sexp) - self.assertEqual(2, sexp.named) + self.assertGreaterEqual(sexp.named, 2) sexp2 = sexp.__deepcopy__() self.assertEqual(sexp.typeof, sexp2.typeof) self.assertEqual(list(sexp), list(sexp2)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/robjects/lib/dbplyr.py new/rpy2-2.9.4/rpy/robjects/lib/dbplyr.py --- old/rpy2-2.9.3/rpy/robjects/lib/dbplyr.py 1970-01-01 01:00:00.000000000 +0100 +++ new/rpy2-2.9.4/rpy/robjects/lib/dbplyr.py 2018-06-24 21:29:54.000000000 +0200 @@ -0,0 +1,30 @@ +from collections import namedtuple +from six import with_metaclass +from rpy2.robjects.packages import (importr, data, + Package, default_symbol_r2python, + default_symbol_check_after, + WeakPackage) +import warnings + +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + dbplyr = importr('dbplyr', on_conflict="warn") + lazyeval = importr('lazyeval', on_conflict="warn") + dbplyr = WeakPackage(dbplyr._env, + dbplyr.__rname__, + translation=dbplyr._translation, + exported_names=dbplyr._exported_names, + on_conflict="warn", + version=dbplyr.__version__, + symbol_r2python=dbplyr._symbol_r2python, + symbol_check_after=dbplyr._symbol_check_after) +TARGET_VERSION = '1.2.1' +if dbplyr.__version__ != TARGET_VERSION: + warnings.warn('This was designed againt dbplyr version %s but you have %s' % (TARGET_VERSION, dbplyr.__version__)) + + +from rpy2 import robjects +from rpy2.robjects.lib import dplyr + + +sql = dbplyr.sql diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/robjects/lib/dplyr.py new/rpy2-2.9.4/rpy/robjects/lib/dplyr.py --- old/rpy2-2.9.3/rpy/robjects/lib/dplyr.py 2017-11-04 17:54:54.000000000 +0100 +++ new/rpy2-2.9.4/rpy/robjects/lib/dplyr.py 2018-06-24 21:38:46.000000000 +0200 @@ -19,7 +19,7 @@ version=dplyr.__version__, symbol_r2python=dplyr._symbol_r2python, symbol_check_after=dplyr._symbol_check_after) -TARGET_VERSION = '0.7.4' +TARGET_VERSION = '0.7.5' if dplyr.__version__ != TARGET_VERSION: warnings.warn('This was designed againt dplyr version %s but you have %s' % (TARGET_VERSION, dplyr.__version__)) @@ -139,6 +139,7 @@ DataFrame.filter = _wrap(dplyr.filter_, None) DataFrame.select = _wrap(dplyr.select_, None) DataFrame.group_by = _wrap(dplyr.group_by_, GroupedDataFrame) +DataFrame.ungroup = _wrap(dplyr.ungroup, None) DataFrame.distinct = _wrap(dplyr.distinct_, None) DataFrame.inner_join = _wrap2(dplyr.inner_join, None) DataFrame.left_join = _wrap2(dplyr.left_join, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/robjects/pandas2ri.py new/rpy2-2.9.4/rpy/robjects/pandas2ri.py --- old/rpy2-2.9.3/rpy/robjects/pandas2ri.py 2018-04-14 16:22:00.000000000 +0200 +++ new/rpy2-2.9.4/rpy/robjects/pandas2ri.py 2018-06-11 03:39:44.000000000 +0200 @@ -15,6 +15,7 @@ from pandas.core.frame import DataFrame as PandasDataFrame from pandas.core.series import Series as PandasSeries from pandas.core.index import Index as PandasIndex +from pandas.core.dtypes.api import is_datetime64_any_dtype import pandas from numpy import recarray import numpy @@ -49,7 +50,6 @@ ri2ro = converter.ri2ro # numpy types for Pandas columns that require (even more) special handling -dt_datetime64ns_type = numpy.dtype('datetime64[ns]') dt_O_type = numpy.dtype('O') default_timezone = None @@ -102,15 +102,16 @@ elif obj.dtype.name == 'category': res = py2ri_categoryseries(obj) res = FactorVector(res) - elif obj.dtype == dt_datetime64ns_type: + elif is_datetime64_any_dtype(obj.dtype): # time series + tzname = obj.dt.tz.zone if obj.dt.tz else '' d = [IntVector([x.year for x in obj]), IntVector([x.month for x in obj]), IntVector([x.day for x in obj]), IntVector([x.hour for x in obj]), IntVector([x.minute for x in obj]), IntVector([x.second for x in obj])] - res = ISOdatetime(*d) + res = ISOdatetime(*d, tz=StrSexpVector([tzname])) #FIXME: can the POSIXct be created from the POSIXct constructor ? # (is '<M8[ns]' mapping to Python datetime.datetime ?) res = POSIXct(res) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy/robjects/vectors.py new/rpy2-2.9.4/rpy/robjects/vectors.py --- old/rpy2-2.9.3/rpy/robjects/vectors.py 2017-11-04 17:54:54.000000000 +0100 +++ new/rpy2-2.9.4/rpy/robjects/vectors.py 2018-06-10 23:40:27.000000000 +0200 @@ -1,6 +1,5 @@ from rpy2.robjects.robject import RObjectMixin, RObject import rpy2.rinterface as rinterface -#import rpy2.robjects.conversion as conversion from . import conversion import rpy2.rlike.container as rlc @@ -29,7 +28,9 @@ globalenv_ri = rinterface.globalenv baseenv_ri = rinterface.baseenv -utils_ri = rinterface.baseenv['as.environment'](rinterface.StrSexpVector(("package:utils", ))) +r_concat = baseenv_ri['c'] +as_character = baseenv_ri['as.character'] +utils_ri = baseenv_ri['as.environment'](rinterface.StrSexpVector(("package:utils", ))) class ExtractDelegator(object): """ Delegate the R 'extraction' ("[") and 'replacement' ("[<-") @@ -723,7 +724,38 @@ class POSIXt(object): """ POSIX time vector. This is an abstract class. """ - pass + + def repr_format_elt(self, elt, max_width = 12): + max_width = int(max_width) + str_elt = str(elt) + if len(str_elt) < max_width: + res = elt + else: + res = "%s..." % str_elt[ : (max_width - 3)] + return res + + + def _iter_formatted(self, max_items=9): + format_elt = self.repr_format_elt + l = len(self) + half_items = max_items // 2 + max_width = math.floor(52 / l) + if l == 0: + return + elif l < max_items: + str_vec = StrVector(as_character(self)) + else: + str_vec = r_concat( + as_character( + self.rx(IntSexpVector(tuple(range(1, (half_items-1))))) + ), + StrSexpVector(['...']), + as_character( + self.rx(IntSexpVector(tuple(range((l-half_items), l)))) + )) + for str_elt in str_vec: + yield self.repr_format_elt(str_elt) + class POSIXlt(POSIXt, Vector): """ Representation of dates with a 9-component structure @@ -757,6 +789,7 @@ # (and yes, this is confusing) tmp = self.rx2(i-1) return struct_time(*tuple(tmp)) + class POSIXct(POSIXt, FloatVector): """ Representation of dates as seconds since Epoch. @@ -1112,9 +1145,9 @@ elements.append(tuple(e._iter_formatted())) else: elements.append(['...',] * len(elements[-1])) - + d = {'column_names': names, - 'rows': tuple(range(len(elements))), + 'rows': range(len(elements[0]) if len(elements) else 0), 'columns': tuple(range(len(names))), 'nrows': self.nrow, 'ncolumns': self.ncol, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy2.egg-info/PKG-INFO new/rpy2-2.9.4/rpy2.egg-info/PKG-INFO --- old/rpy2-2.9.3/rpy2.egg-info/PKG-INFO 2018-04-14 16:22:35.000000000 +0200 +++ new/rpy2-2.9.4/rpy2.egg-info/PKG-INFO 2018-06-26 00:20:43.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: rpy2 -Version: 2.9.3 +Version: 2.9.4 Summary: Python interface to the R language (embedded R) Home-page: https://rpy2.bitbucket.io Author: Laurent Gautier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/rpy2.egg-info/SOURCES.txt new/rpy2-2.9.4/rpy2.egg-info/SOURCES.txt --- old/rpy2-2.9.3/rpy2.egg-info/SOURCES.txt 2018-04-14 16:22:35.000000000 +0200 +++ new/rpy2-2.9.4/rpy2.egg-info/SOURCES.txt 2018-06-26 00:20:43.000000000 +0200 @@ -3,6 +3,7 @@ NEWS README.rst gpl-2.0.txt +setup.cfg setup.py ./rpy/__init__.py ./rpy/rpy_classic.py @@ -56,6 +57,7 @@ ./rpy/robjects/robject.py ./rpy/robjects/vectors.py ./rpy/robjects/lib/__init__.py +./rpy/robjects/lib/dbplyr.py ./rpy/robjects/lib/dplyr.py ./rpy/robjects/lib/ggplot2.py ./rpy/robjects/lib/grdevices.py @@ -82,6 +84,7 @@ ./rpy/robjects/tests/testRobjects.py ./rpy/robjects/tests/testVector.py doc/Makefile +doc/generated_rst/README rpy/__init__.py rpy/rpy_classic.py rpy/situation.py @@ -153,6 +156,7 @@ rpy/robjects/robject.py rpy/robjects/vectors.py rpy/robjects/lib/__init__.py +rpy/robjects/lib/dbplyr.py rpy/robjects/lib/dplyr.py rpy/robjects/lib/ggplot2.py rpy/robjects/lib/grdevices.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpy2-2.9.3/setup.cfg new/rpy2-2.9.4/setup.cfg --- old/rpy2-2.9.3/setup.cfg 2018-04-14 16:22:35.000000000 +0200 +++ new/rpy2-2.9.4/setup.cfg 2018-06-26 00:20:43.000000000 +0200 @@ -1,3 +1,5 @@ +[easy_install] + [egg_info] tag_build = tag_date = 0
