Hello community,
here is the log from the commit of package python-patsy for openSUSE:Factory checked in at 2018-11-01 14:44:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-patsy (Old)
and /work/SRC/openSUSE:Factory/.python-patsy.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-patsy"
Thu Nov 1 14:44:29 2018 rev:4 rq:645867 version:0.5.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-patsy/python-patsy.changes 2018-01-13 21:48:34.091499387 +0100
+++ /work/SRC/openSUSE:Factory/.python-patsy.new/python-patsy.changes 2018-11-01 14:44:32.570876581 +0100
@@ -1,0 +2,12 @@
+Thu Nov 1 06:38:50 UTC 2018 - Arun Persaud
+
+- specfile:
+ * removed devel from noarch
+
+- update to version 0.5.1:
+ * The Python 3.6.7 and 3.7.1 point releases changed the standard
+ tokenizer module in a way that broke patsy. Updated patsy to work
+ with these point releases. (See `#131
+ https://github.com/pydata/patsy/pull/131`__ for details.)
+
+-------------------------------------------------------------------
Old:
----
patsy-0.5.0.tar.gz
New:
----
patsy-0.5.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-patsy.spec ++++++
--- /var/tmp/diff_new_pack.uZUYuA/_old 2018-11-01 14:44:32.930876545 +0100
+++ /var/tmp/diff_new_pack.uZUYuA/_new 2018-11-01 14:44:32.930876545 +0100
@@ -12,38 +12,35 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Tests have dependency loop with pandas
%bcond_with tests
-
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-patsy
-Version: 0.5.0
+Version: 0.5.1
Release: 0
Summary: A Python package for statistical models and design matrices
License: BSD-2-Clause
Group: Development/Languages/Python
-Url: https://github.com/pydata/patsy
+URL: https://github.com/pydata/patsy
Source: https://files.pythonhosted.org/packages/source/p/patsy/patsy-%{version}.tar.gz
-BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module scipy}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-%if %{with tests}
-BuildRequires: %{python_module nose}
-BuildRequires: %{python_module pandas}
-%endif
Requires: python-numpy
Requires: python-six
Recommends: python-scipy
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
+%if %{with tests}
+BuildRequires: %{python_module nose}
+BuildRequires: %{python_module pandas}
+%endif
%python_subpackages
%description
@@ -69,8 +66,8 @@
%endif
%files %{python_files}
-%defattr(-,root,root,-)
-%doc README.rst LICENSE.txt
+%license LICENSE.txt
+%doc README.rst
%{python_sitelib}/patsy/
%{python_sitelib}/patsy-%{version}-py*.egg-info
++++++ patsy-0.5.0.tar.gz -> patsy-0.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/PKG-INFO new/patsy-0.5.1/PKG-INFO
--- old/patsy-0.5.0/PKG-INFO 2018-01-10 06:26:06.000000000 +0100
+++ new/patsy-0.5.1/PKG-INFO 2018-10-28 04:58:19.000000000 +0100
@@ -1,12 +1,11 @@
Metadata-Version: 1.1
Name: patsy
-Version: 0.5.0
+Version: 0.5.1
Summary: A Python package for describing statistical models and for building design matrices.
Home-page: https://github.com/pydata/patsy
Author: Nathaniel J. Smith
Author-email: njs@pobox.com
License: 2-clause BSD
-Description-Content-Type: UNKNOWN
Description: Patsy is a Python library for describing statistical models
(especially linear models, or models that have a linear component) and
building design matrices. Patsy brings the convenience of `R
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/doc/changes.rst new/patsy-0.5.1/doc/changes.rst
--- old/patsy-0.5.0/doc/changes.rst 2018-01-10 03:37:36.000000000 +0100
+++ new/patsy-0.5.1/doc/changes.rst 2018-10-28 03:38:04.000000000 +0100
@@ -3,8 +3,20 @@
.. currentmodule:: patsy
-v0.5.0 (not yet released)
--------------------------
+v0.5.1
+------
+
+* The Python 3.6.7 and 3.7.1 point releases changed the standard
+ tokenizer module in a way that broke patsy. Updated patsy to work
+ with these point releases. (See `#131
+ https://github.com/pydata/patsy/pull/131`__ for details.)
+
+
+v0.5.0
+------
+
+.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1211053.svg
+ :target: https://doi.org/10.5281/zenodo.1211053
* Dropped support for Python 2.6 and 3.3.
* Update to keep up with ``pandas`` API changes
@@ -17,7 +29,7 @@
------
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.33471.svg
- :target: http://dx.doi.org/10.5281/zenodo.33471
+ :target: https://doi.org/10.5281/zenodo.33471
New features:
@@ -41,7 +53,7 @@
------
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.20981.svg
- :target: http://dx.doi.org/10.5281/zenodo.20981
+ :target: https://doi.org/10.5281/zenodo.20981
Incompatible changes:
@@ -100,7 +112,7 @@
------
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.11444.svg
- :target: http://dx.doi.org/10.5281/zenodo.11444
+ :target: https://doi.org/10.5281/zenodo.11444
* New stateful transforms for computing natural and cylic cubic
splines with constraints, and tensor spline bases with
@@ -139,7 +151,7 @@
------
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.11447.png
- :target: http://dx.doi.org/10.5281/zenodo.11447
+ :target: https://doi.org/10.5281/zenodo.11447
* Fixed a nasty bug in missing value handling where, if missing values
were present, ``dmatrix(..., result_type="dataframe")`` would always
@@ -157,7 +169,7 @@
------
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.11448.png
- :target: http://dx.doi.org/10.5281/zenodo.11448
+ :target: https://doi.org/10.5281/zenodo.11448
Warnings:
@@ -193,6 +205,6 @@
------
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.11449.png
- :target: http://dx.doi.org/10.5281/zenodo.11449
+ :target: https://doi.org/10.5281/zenodo.11449
First public release.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/doc/formulas.rst new/patsy-0.5.1/doc/formulas.rst
--- old/patsy-0.5.0/doc/formulas.rst 2015-06-13 06:29:37.000000000 +0200
+++ new/patsy-0.5.1/doc/formulas.rst 2018-10-28 03:34:36.000000000 +0100
@@ -11,7 +11,7 @@
import numpy as np
from patsy import *
-Now we'll describe the fully nitty-gritty of how formulas are parsed
+Now we'll describe the full nitty-gritty of how formulas are parsed
and interpreted. Here's the picture you'll want to keep in mind:
.. figure:: figures/formula-structure.png
@@ -58,12 +58,13 @@
the same objects that Patsy will construct if given the above
formula::
- from patsy import ModelDesc
+ from patsy import ModelDesc, Term, EvalFactor
ModelDesc([Term([EvalFactor("y")])],
[Term([]),
Term([EvalFactor("a")]),
Term([EvalFactor("a"), EvalFactor("b")]),
- Term([EvalFactor("np.log(x)")])])
+ Term([EvalFactor("np.log(x)")])
+ ])
Compare to what you get from parsing the above formula::
@@ -218,7 +219,7 @@
which
* is not a Patsy operator listed in that table up above, and
-* is not a parentheses
+* is not a parenthesis
And then the factor ends whenever we see a token which
@@ -230,7 +231,7 @@
f(x1 + x2) + x3
-First, we see ``f``, which is not an operator or a parentheses, so we
+First, we see ``f``, which is not an operator or a parenthesis, so we
know this string begins with a Python-defined factor. Then we keep
reading from there. The next Patsy operator we see is the ``+`` in
``x1 + x2``... but since at this point we have seen the opening ``(``
@@ -453,7 +454,7 @@
produce a design matrix that isn't full rank. Avoiding that is your
problem.
-Okay, now for the more the more detailed explanation. Each term
+Okay, now for the more detailed explanation. Each term
represents a certain space of linear combinations of column vectors:
* A numerical factor represents the vector space spanned by its
@@ -530,7 +531,7 @@
np.linalg.matrix_rank(mat2)
np.linalg.matrix_rank(np.column_stack((mat1, mat2)))
-But, of course, their actual contents is different:
+But, of course, their actual contents are different:
.. ipython:: python
@@ -747,7 +748,7 @@
ANYTHING : FACTOR-` is identical to the space spanned by `ANYTHING :
FACTOR`.
- *Exercise:* Either show that the greedy algorithm here is produces
+ *Exercise:* Either show that the greedy algorithm here produces
optimal encodings in some sense (e.g., smallest number of pieces
used), or else find a better algorithm. (Extra credit: implement
your algorithm and submit a pull request [#still-shameless]_.)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/doc/library-developers.rst new/patsy-0.5.1/doc/library-developers.rst
--- old/patsy-0.5.0/doc/library-developers.rst 2015-11-09 06:05:25.000000000 +0100
+++ new/patsy-0.5.1/doc/library-developers.rst 2018-10-28 04:06:00.000000000 +0100
@@ -120,6 +120,7 @@
exec(f.read())
.. ipython:: python
+ :okwarning:
from patsy import demo_data
data = demo_data("x", "y", "a")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/doc/quickstart.rst new/patsy-0.5.1/doc/quickstart.rst
--- old/patsy-0.5.0/doc/quickstart.rst 2014-04-29 02:16:03.000000000 +0200
+++ new/patsy-0.5.1/doc/quickstart.rst 2018-10-28 04:01:43.000000000 +0100
@@ -43,6 +43,7 @@
like :func:`np.linalg.lstsq`:
.. ipython:: python
+ :okwarning:
outcome, predictors = dmatrices("y ~ x1 + x2", data)
betas = np.linalg.lstsq(predictors, outcome)[0].ravel()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/doc/stateful-transforms.rst new/patsy-0.5.1/doc/stateful-transforms.rst
--- old/patsy-0.5.0/doc/stateful-transforms.rst 2015-11-09 06:00:29.000000000 +0100
+++ new/patsy-0.5.1/doc/stateful-transforms.rst 2018-10-28 04:04:50.000000000 +0100
@@ -151,7 +151,7 @@
.. warning::
If you are unwise enough to ignore this section, write a function
- like `naive_center` above, and use it in a formula, then Patsy will
+ like ``naive_center`` above, and use it in a formula, then Patsy will
not notice. If you use that formula with :func:`incr_dbuilders` or
for predictions, then you will just silently get the wrong
results. We have a plan to detect such cases, but it isn't
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/patsy/constraint.py new/patsy-0.5.1/patsy/constraint.py
--- old/patsy-0.5.0/patsy/constraint.py 2016-10-26 07:36:13.000000000 +0200
+++ new/patsy-0.5.1/patsy/constraint.py 2018-10-28 03:34:36.000000000 +0100
@@ -17,9 +17,10 @@
from patsy.origin import Origin
from patsy.util import (atleast_2d_column_default,
repr_pretty_delegate, repr_pretty_impl,
- SortAnythingKey,
no_pickling, assert_no_pickling)
-from patsy.infix_parser import Token, Operator, ParseNode, infix_parse
+from patsy.infix_parser import Token, Operator, infix_parse
+from patsy.parse_formula import _parsing_error_test
+
class LinearConstraint(object):
"""A linear constraint in matrix form.
@@ -87,7 +88,10 @@
return cls(variable_names, coefs, constants)
def test_LinearConstraint():
- from numpy.testing.utils import assert_equal
+ try:
+ from numpy.testing import assert_equal
+ except ImportError:
+ from numpy.testing.utils import assert_equal
lc = LinearConstraint(["foo", "bar"], [1, 1])
assert lc.variable_names == ["foo", "bar"]
assert_equal(lc.coefs, [[1, 1]])
@@ -96,7 +100,7 @@
lc = LinearConstraint(["foo", "bar"], [[1, 1], [2, 3]], [10, 20])
assert_equal(lc.coefs, [[1, 1], [2, 3]])
assert_equal(lc.constants, [[10], [20]])
-
+
assert lc.coefs.dtype == np.dtype(float)
assert lc.constants.dtype == np.dtype(float)
@@ -124,7 +128,10 @@
comb = LinearConstraint.combine([LinearConstraint(["a", "b"], [1, 0]),
LinearConstraint(["a", "b"], [0, 1], [1])])
assert comb.variable_names == ["a", "b"]
- from numpy.testing.utils import assert_equal
+ try:
+ from numpy.testing import assert_equal
+ except ImportError:
+ from numpy.testing.utils import assert_equal
assert_equal(comb.coefs, [[1, 0], [0, 1]])
assert_equal(comb.constants, [[0], [1]])
@@ -132,13 +139,13 @@
assert_raises(ValueError, LinearConstraint.combine, [])
assert_raises(ValueError, LinearConstraint.combine,
[LinearConstraint(["a"], [1]), LinearConstraint(["b"], [1])])
-
+
_ops = [
Operator(",", 2, -100),
Operator("=", 2, 0),
-
+
Operator("+", 1, 100),
Operator("-", 1, 100),
Operator("+", 2, 100),
@@ -408,8 +415,12 @@
coefs = np.asarray(constraint_like, dtype=float)
return LinearConstraint(variable_names, coefs)
+
def _check_lincon(input, varnames, coefs, constants):
- from numpy.testing.utils import assert_equal
+ try:
+ from numpy.testing import assert_equal
+ except ImportError:
+ from numpy.testing.utils import assert_equal
got = linear_constraint(input, varnames)
print("got", got)
expected = LinearConstraint(varnames, coefs, constants)
@@ -420,6 +431,7 @@
assert_equal(got.coefs.dtype, np.dtype(float))
assert_equal(got.constants.dtype, np.dtype(float))
+
def test_linear_constraint():
from nose.tools import assert_raises
from patsy.compat import OrderedDict
@@ -495,6 +507,7 @@
# unknown object type
assert_raises(ValueError, linear_constraint, None, ["a", "b"])
+
_parse_eval_error_tests = [
# Bad token
"a + <f>oo",
@@ -512,7 +525,7 @@
"a = 1, <(a, b)> + 2, c",
]
-from patsy.parse_formula import _parsing_error_test
+
def test_eval_errors():
def doit(bad_code):
return linear_constraint(bad_code, ["a", "b", "c"])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/patsy/tokens.py new/patsy-0.5.1/patsy/tokens.py
--- old/patsy-0.5.0/patsy/tokens.py 2014-07-16 22:27:10.000000000 +0200
+++ new/patsy-0.5.1/patsy/tokens.py 2018-10-28 03:34:36.000000000 +0100
@@ -32,7 +32,10 @@
if pytype == tokenize.ENDMARKER:
break
origin = Origin(code, start, end)
- assert pytype not in (tokenize.NL, tokenize.NEWLINE)
+ assert pytype != tokenize.NL
+ if pytype == tokenize.NEWLINE:
+ assert string == ""
+ continue
if pytype == tokenize.ERRORTOKEN:
raise PatsyError("error tokenizing input "
"(maybe an unclosed string?)",
@@ -98,7 +101,9 @@
brackets = []
for token_type, token in typed_tokens:
assert token_type not in (tokenize.INDENT, tokenize.DEDENT,
- tokenize.NEWLINE, tokenize.NL)
+ tokenize.NL)
+ if token_type == tokenize.NEWLINE:
+ continue
if token_type == tokenize.ENDMARKER:
continue
if token_type in (tokenize.NAME, tokenize.NUMBER, tokenize.STRING):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/patsy/util.py new/patsy-0.5.1/patsy/util.py
--- old/patsy-0.5.0/patsy/util.py 2018-01-10 03:48:37.000000000 +0100
+++ new/patsy-0.5.1/patsy/util.py 2018-10-28 03:34:36.000000000 +0100
@@ -55,6 +55,7 @@
have_pandas_categorical_dtype = (_pandas_is_categorical_dtype
is not None)
+
# Passes through Series and DataFrames, call np.asarray() on everything else
def asarray_or_pandas(a, copy=False, dtype=None, subok=False):
if have_pandas:
@@ -68,10 +69,17 @@
return a.__class__(a, copy=copy, dtype=dtype, **extra_args)
return np.array(a, copy=copy, dtype=dtype, subok=subok)
+
def test_asarray_or_pandas():
+ import warnings
assert type(asarray_or_pandas([1, 2, 3])) is np.ndarray
- assert type(asarray_or_pandas(np.matrix([[1, 2, 3]]))) is np.ndarray
- assert type(asarray_or_pandas(np.matrix([[1, 2, 3]]), subok=True)) is np.matrix
+ with warnings.catch_warnings() as w:
+ warnings.filterwarnings('ignore', 'the matrix subclass',
+ PendingDeprecationWarning)
+ assert type(asarray_or_pandas(np.matrix([[1, 2, 3]]))) is np.ndarray
+ assert type(asarray_or_pandas(
+ np.matrix([[1, 2, 3]]), subok=True)) is np.matrix
+ assert w is None
a = np.array([1, 2, 3])
assert asarray_or_pandas(a) is a
a_copy = asarray_or_pandas(a, copy=True)
@@ -147,7 +155,7 @@
# instead of rows. It also converts ndarray subclasses into basic ndarrays,
# which makes it easier to guarantee correctness. However, there are many
# places in the code where we want to preserve pandas indexing information if
-# present, so there is also an option
+# present, so there is also an option
def atleast_2d_column_default(a, preserve_pandas=False):
if preserve_pandas and have_pandas:
if isinstance(a, pandas.Series):
@@ -162,7 +170,9 @@
assert a.ndim >= 2
return a
+
def test_atleast_2d_column_default():
+ import warnings
assert np.all(atleast_2d_column_default([1, 2, 3]) == [[1], [2], [3]])
assert atleast_2d_column_default(1).shape == (1, 1)
@@ -173,7 +183,11 @@
assert atleast_2d_column_default([1, 2, 3]).shape == (3, 1)
assert atleast_2d_column_default([[1], [2], [3]]).shape == (3, 1)
- assert type(atleast_2d_column_default(np.matrix(1))) == np.ndarray
+ with warnings.catch_warnings() as w:
+ warnings.filterwarnings('ignore', 'the matrix subclass',
+ PendingDeprecationWarning)
+ assert type(atleast_2d_column_default(np.matrix(1))) == np.ndarray
+ assert w is None
global have_pandas
if have_pandas:
@@ -187,18 +201,21 @@
assert (type(atleast_2d_column_default(pandas.DataFrame([[1], [2]]),
preserve_pandas=True))
== pandas.DataFrame)
- s = pandas.Series([10, 11,12], name="hi", index=["a", "b", "c"])
+ s = pandas.Series([10, 11, 12], name="hi", index=["a", "b", "c"])
df = atleast_2d_column_default(s, preserve_pandas=True)
assert isinstance(df, pandas.DataFrame)
assert np.all(df.columns == ["hi"])
assert np.all(df.index == ["a", "b", "c"])
- assert (type(atleast_2d_column_default(np.matrix(1),
- preserve_pandas=True))
- == np.ndarray)
- assert (type(atleast_2d_column_default([1, 2, 3],
- preserve_pandas=True))
+ with warnings.catch_warnings() as w:
+ warnings.filterwarnings('ignore', 'the matrix subclass',
+ PendingDeprecationWarning)
+ assert (type(atleast_2d_column_default(np.matrix(1),
+ preserve_pandas=True))
+ == np.ndarray)
+ assert w is None
+ assert (type(atleast_2d_column_default([1, 2, 3], preserve_pandas=True))
== np.ndarray)
-
+
if have_pandas:
had_pandas = have_pandas
try:
@@ -367,7 +384,7 @@
# The IPython pretty-printer gives very nice output that is difficult to get
# otherwise, e.g., look how much more readable this is than if it were all
# smooshed onto one line:
-#
+#
# ModelDesc(input_code='y ~ x*asdf',
# lhs_terms=[Term([EvalFactor('y')])],
# rhs_terms=[Term([]),
@@ -375,7 +392,7 @@
# Term([EvalFactor('asdf')]),
# Term([EvalFactor('x'), EvalFactor('asdf')])],
# )
-#
+#
# But, we don't want to assume it always exists; nor do we want to be
# re-writing every repr function twice, once for regular repr and once for
# the pretty printer. So, here's an ugly fallback implementation that can be
@@ -562,7 +579,7 @@
assert not safe_isnan(None)
# raw isnan raises a *different* error for strings than for objects:
assert not safe_isnan("asdf")
-
+
def iterable(obj):
try:
iter(obj)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/patsy/version.py new/patsy-0.5.1/patsy/version.py
--- old/patsy-0.5.0/patsy/version.py 2018-01-10 03:40:12.000000000 +0100
+++ new/patsy-0.5.1/patsy/version.py 2018-10-28 03:38:37.000000000 +0100
@@ -17,4 +17,4 @@
# want. (Contrast with the special suffix 1.0.0.dev, which sorts *before*
# 1.0.0.)
-__version__ = "0.5.0"
+__version__ = "0.5.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patsy-0.5.0/patsy.egg-info/PKG-INFO new/patsy-0.5.1/patsy.egg-info/PKG-INFO
--- old/patsy-0.5.0/patsy.egg-info/PKG-INFO 2018-01-10 06:26:06.000000000 +0100
+++ new/patsy-0.5.1/patsy.egg-info/PKG-INFO 2018-10-28 04:58:19.000000000 +0100
@@ -1,12 +1,11 @@
Metadata-Version: 1.1
Name: patsy
-Version: 0.5.0
+Version: 0.5.1
Summary: A Python package for describing statistical models and for building design matrices.
Home-page: https://github.com/pydata/patsy
Author: Nathaniel J. Smith
Author-email: njs@pobox.com
License: 2-clause BSD
-Description-Content-Type: UNKNOWN
Description: Patsy is a Python library for describing statistical models
(especially linear models, or models that have a linear component) and
building design matrices. Patsy brings the convenience of `R