pydata / patsy

Describing statistical models in Python using symbolic formulas
Other
954 stars 104 forks source link

MAINT: Travis fixes #133

Closed thequackdaddy closed 6 years ago

thequackdaddy commented 6 years ago

Here's a way to fix travis.

There's a conda dependency problem that can be easily solved by building the conda environment with only one conda install.

numpy.testing.util is deprecated as well, so I did a try/except to use the newer one, if available.

One concern is that numpy is deprecating np.matrix.

======================================================================
ERROR: patsy.util.test_atleast_2d_column_default
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/miniconda/envs/testenv/lib/python3.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/miniconda/envs/testenv/lib/python3.6/site-packages/patsy/util.py", line 176, in test_atleast_2d_column_default
    assert type(atleast_2d_column_default(np.matrix(1))) == np.ndarray
  File "/home/travis/miniconda/envs/testenv/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py", line 118, in __new__
    PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.

It might be time to deprecate it here too.

codecov-io commented 6 years ago

Codecov Report

Merging #133 into master will increase coverage by 0.7%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #133     +/-   ##
=========================================
+ Coverage   98.18%   98.88%   +0.7%     
=========================================
  Files          30       30             
  Lines        5562     5569      +7     
  Branches      775      775             
=========================================
+ Hits         5461     5507     +46     
+ Misses         41       37      -4     
+ Partials       60       25     -35
Impacted Files Coverage Δ
patsy/util.py 98.41% <100%> (+3.59%) :arrow_up:
patsy/constraint.py 97.99% <57.14%> (-2.01%) :arrow_down:
patsy/design_info.py 99.62% <0%> (+0.18%) :arrow_up:
patsy/mgcv_cubic_splines.py 99.1% <0%> (+0.44%) :arrow_up:
patsy/build.py 99.62% <0%> (+0.56%) :arrow_up:
patsy/highlevel.py 98.05% <0%> (+0.97%) :arrow_up:
patsy/splines.py 100% <0%> (+1.09%) :arrow_up:
patsy/test_build.py 98% <0%> (+1.5%) :arrow_up:
patsy/categorical.py 99.58% <0%> (+2.05%) :arrow_up:
patsy/test_state.py 100% <0%> (+2.1%) :arrow_up:
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f64e780...072408d. Read the comment docs.

njsmith commented 6 years ago

This is awesome, thanks!

The only way we use matrix is to test that we don't blow up if a user is unwisely using matrix and passes it into patsy, so I think keep tests for that is reasonable, and anyone doing this is already getting deprecations from numpy.

It would definitely make sense to drop support for ancient pandas versions, and would also simplify the testing... we could probably even drop support for the numpy versions that don't have numpy.testing.assert_equals.

Right now I just want to merge this to get our CI working again so I can make a release to get #131 out... let's see if I remember how to do a release!