You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Very many tests (86 errors, 5 failures) do not pass #4850
I now see that you may have moved to py.test, but I still see nose cropping up a lot in the source code and listed under the dependencies. Is there any other way I should be running the tests?
Warnings are not counted as errors or failures. Some of you failures are from using packages released after 0.9.0, e.g., TypeError: __new__() got an unexpected keyword argument 'format'
The main error message now seems to be ImportError: cannot import name _representation.
ome of you failures are from using packages released after 0.9.0
You mean dependency versions which are “too new” for =statsmodels-0.9.0? Like which ones?
This can also happen you are running the test suite from the statsmodels directory and have called python setup.py install. This happens since there are inti.py files in the directory below, and it will prefer local over site packages.
It happens because some tests use the global numpy randomstate singleton, and so can fail from run-to-run depending on how the tests are ordered and the initial seed to the generator. These have mostly been fixed in master, but can't be helped in 0.9.
@josef-pkt@bashtage O, now that I've xfailed all the tests that were failing on 2.7 a (mostly non-overlapping) new set of tests seems to fail on 3.6.
There's the full log, and here again the acute snippet. Also, please see how in the full log a number of tests xpass. These are the ones I had marked as failing for 2.7. Interesting how this is complementary...
=============================================== FAILURES ================================================
______________________________ test_single_factor_repeated_measures_anova _______________________________
def test_single_factor_repeated_measures_anova():
"""
Testing single factor repeated measures anova
Results reproduces R `ezANOVA` function from library ez
"""
df = AnovaRM(data.iloc[:16, :], 'DV', 'id', within=['B']).fit()
a = [[1, 7, 22.4, 0.002125452]]
assert_array_almost_equal(df.anova_table.iloc[:, [1, 2, 0, 3]].values,
> a, decimal=5)
E AssertionError:
E Arrays are not almost equal to 5 decimals
E
E (mismatch 75.0%)
E x: array([[7.00000e+00, 2.24000e+01, 1.00000e+00, 2.12545e-03]])
E y: array([[1.00000e+00, 7.00000e+00, 2.24000e+01, 2.12545e-03]])
lib/statsmodels/stats/tests/test_anova_rm.py:88: AssertionError
_______________________________ test_two_factors_repeated_measures_anova ________________________________
def test_two_factors_repeated_measures_anova():
"""
Testing two factors repeated measures anova
Results reproduces R `ezANOVA` function from library ez
"""
df = AnovaRM(data.iloc[:48, :], 'DV', 'id', within=['A', 'B']).fit()
a = [[1, 7, 40.14159, 3.905263e-04],
[2, 14, 29.21739, 1.007549e-05],
[2, 14, 17.10545, 1.741322e-04]]
assert_array_almost_equal(df.anova_table.iloc[:,[1, 2, 0, 3]].values,
> a, decimal=5)
E AssertionError:
E Arrays are not almost equal to 5 decimals
E
E (mismatch 75.0%)
E x: array([[7.00000e+00, 4.01416e+01, 1.00000e+00, 3.90526e-04],
E [1.40000e+01, 2.92174e+01, 2.00000e+00, 1.00755e-05],
E [1.40000e+01, 1.71055e+01, 2.00000e+00, 1.74132e-04]])
E y: array([[1.00000e+00, 7.00000e+00, 4.01416e+01, 3.90526e-04],
E [2.00000e+00, 1.40000e+01, 2.92174e+01, 1.00755e-05],
E [2.00000e+00, 1.40000e+01, 1.71055e+01, 1.74132e-04]])
lib/statsmodels/stats/tests/test_anova_rm.py:101: AssertionError
______________________________ test_three_factors_repeated_measures_anova _______________________________
def test_three_factors_repeated_measures_anova():
"""
Testing three factors repeated measures anova
Results reproduces R `ezANOVA` function from library ez
"""
df = AnovaRM(data, 'DV', 'id', within=['A', 'B', 'D']).fit()
a = [[1, 7, 8.7650709, 0.021087505],
[2, 14, 8.4985785, 0.003833921],
[1, 7, 20.5076546, 0.002704428],
[2, 14, 0.8457797, 0.450021759],
[1, 7, 21.7593382, 0.002301792],
[2, 14, 6.2416695, 0.011536846],
[2, 14, 5.4253359, 0.018010647]]
assert_array_almost_equal(df.anova_table.iloc[:,[1, 2, 0, 3]].values,
> a, decimal=5)
E AssertionError:
E Arrays are not almost equal to 5 decimals
E
E (mismatch 75.0%)
E x: array([[7.00000e+00, 8.76507e+00, 1.00000e+00, 2.10875e-02],
E [1.40000e+01, 8.49858e+00, 2.00000e+00, 3.83392e-03],
E [7.00000e+00, 2.05077e+01, 1.00000e+00, 2.70443e-03],...
E y: array([[1.00000e+00, 7.00000e+00, 8.76507e+00, 2.10875e-02],
E [2.00000e+00, 1.40000e+01, 8.49858e+00, 3.83392e-03],
E [1.00000e+00, 7.00000e+00, 2.05077e+01, 2.70443e-03],...
lib/statsmodels/stats/tests/test_anova_rm.py:118: AssertionError
_________________________ test_repeated_measures_aggregate_compare_with_ezANOVA _________________________
def test_repeated_measures_aggregate_compare_with_ezANOVA():
# Results should reproduces those from R's `ezANOVA` (library ez).
ez = pd.DataFrame(
{'F Value': [8.7650709, 8.4985785, 20.5076546, 0.8457797, 21.7593382,
6.2416695, 5.4253359],
'Num DF': [1, 2, 1, 2, 1, 2, 2],
'Den DF': [7, 14, 7, 14, 7, 14, 14],
'Pr > F': [0.021087505, 0.003833921, 0.002704428, 0.450021759,
0.002301792, 0.011536846, 0.018010647]},
index=pd.Index(['A', 'B', 'D', 'A:B', 'A:D', 'B:D', 'A:B:D']))
ez = ez[['F Value', 'Num DF', 'Den DF', 'Pr > F']]
df = (AnovaRM(data.append(data), 'DV', 'id', within=['A', 'B', 'D'],
aggregate_func=np.mean)
.fit()
.anova_table)
> assert_frame_equal(ez, df, check_dtype=False)
lib/statsmodels/stats/tests/test_anova_rm.py:198:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.6/site-packages/pandas/util/testing.py:1340: in assert_frame_equal
obj='{obj}.columns'.format(obj=obj))
/usr/lib64/python3.6/site-packages/pandas/util/testing.py:860: in assert_index_equal
obj=obj, lobj=left, robj=right)
pandas/_libs/testing.pyx:59: in pandas._libs.testing.assert_almost_equal
???
pandas/_libs/testing.pyx:173: in pandas._libs.testing.assert_almost_equal
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = 'DataFrame.columns', message = 'DataFrame.columns values are different (75.0 %)'
left = Index(['F Value', 'Num DF', 'Den DF', 'Pr > F'], dtype='object')
right = Index(['Num DF', 'Den DF', 'F Value', 'Pr > F'], dtype='object'), diff = None
def raise_assert_detail(obj, message, left, right, diff=None):
if isinstance(left, np.ndarray):
left = pprint_thing(left)
elif is_categorical_dtype(left):
left = repr(left)
if PY2 and isinstance(left, string_types):
# left needs to be printable in native text type in python2
left = left.encode('utf-8')
if isinstance(right, np.ndarray):
right = pprint_thing(right)
elif is_categorical_dtype(right):
right = repr(right)
if PY2 and isinstance(right, string_types):
# right needs to be printable in native text type in python2
right = right.encode('utf-8')
msg = """{obj} are different
{message}
[left]: {left}
[right]: {right}""".format(obj=obj, message=message, left=left, right=right)
if diff is not None:
msg += "\n[diff]: {diff}".format(diff=diff)
> raise AssertionError(msg)
E AssertionError: DataFrame.columns are different
E
E DataFrame.columns values are different (75.0 %)
E [left]: Index(['F Value', 'Num DF', 'Den DF', 'Pr > F'], dtype='object')
E [right]: Index(['Num DF', 'Den DF', 'F Value', 'Pr > F'], dtype='object')
/usr/lib64/python3.6/site-packages/pandas/util/testing.py:1035: AssertionError
Essentially pandas and python and ... are changing too fast to keep up given our release schedule.
Debian is using a patched version where they backport some of our fixes, when we are too slow in releasing statsmodels.
Maybe with the recent changes in the setup.py and automatic doc and windows binaries building, it will become easier to quickly throw a minimal compat release at the public (especially if I don't have to be the release manager)
So bottom line, does statsmodels work with Pandas 0.24? I think it's standard operating procedure to use the most recent version of a library, so downgrading to Pandas 0.23 or 0.22 is a suboptimal solution. Can we get statsmodels to play nicely with Pandas 0.24?
Activity
TheChymera commentedon Aug 8, 2018
I now see that you may have moved to py.test, but I still see
nosecropping up a lot in the source code and listed under the dependencies. Is there any other way I should be running the tests?bashtage commentedon Aug 8, 2018
bashtage commentedon Aug 8, 2018
Warnings are not counted as errors or failures. Some of you failures are from using packages released after 0.9.0, e.g.,
TypeError: __new__() got an unexpected keyword argument 'format'TheChymera commentedon Aug 8, 2018
ok,
py.test -vseems to give if not better at least different results: http://bpaste.net/show/f7dbfbb8dc00The main error message now seems to be
ImportError: cannot import name _representation.bashtage commentedon Aug 8, 2018
This means that something isn't being built when running setup since this is an extension module.
TypeError: __new__() got an unexpected keyword argument 'format'is due to changes in pandas after 0.9. You can pin pandas to <=0.22 or use master.TheChymera commentedon Aug 8, 2018
@bashtage what exactly is an extension module? You mean statsmodels bundles some external lib?
bashtage commentedon Aug 8, 2018
An extension module is a compiled module. All of the errors I saw were because these weren't being built.
What happens if you just run
This can also happen you are running the test suite from the statsmodels directory and have called python setup.py install. This happens since there are inti.py files in the directory below, and it will prefer local over site packages.
jbrockmendel commentedon Aug 9, 2018
Might need “python setup.py build_ext --inplace”?
jbrockmendel commentedon Aug 19, 2018
@TheChymera did this get sorted out?
bashtage commentedon Sep 12, 2018
@josef-pkt I think this can be closed.
josef-pkt commentedon Sep 12, 2018
closing, assuming there is nothing left to fix here
TheChymera commentedon Sep 19, 2018
@bashtage @jbrockmendel @josef-pkt sorry guys, this got buried in other work.
Apparently I was running the tests from the wrong directory. Now most errors got taken care of, the log, however, still shows one:
I thought this might be a Pandas version issue (I am using
=dev-python/pandas-0.23.4), but SO shows it might actually be incorrect syntax?jbrockmendel commentedon Sep 19, 2018
Yah, the appropriate DatetimeIndex method would be
to_pydatetime. I'm pretty sure this usage is fixed in statsmodels master.TheChymera commentedon Sep 19, 2018
@jbrockmendel ok, thanks :)
The master branch seems to give a lot of errors though. Any ideas about this?
22 remaining items
josef-pkt commentedon Sep 24, 2018
I reopened so the issue is easier to find.
josef-pkt commentedon Sep 24, 2018
trying to find previous failure for line endings
file search for "splitlines" finds only one likely candidate
in multivariate test_factor.py
TheChymera commentedon Sep 24, 2018
@bashtage regarding the LOCALE:
TheChymera commentedon Sep 24, 2018
interesting, after I xfail-ed the
test_start_params_bugfunction, another failure (test_hdr_multiple_aplha) cropped up:http://bpaste.net/show/081a80130517
how is that possible?
bashtage commentedon Sep 24, 2018
It happens because some tests use the global numpy randomstate singleton, and so can fail from run-to-run depending on how the tests are ordered and the initial seed to the generator. These have mostly been fixed in master, but can't be helped in 0.9.
bashtage commentedon Sep 24, 2018
LOCALE looks normal to me, but I'm not an expert.
TheChymera commentedon Sep 25, 2018
@josef-pkt @bashtage O, now that I've xfailed all the tests that were failing on 2.7 a (mostly non-overlapping) new set of tests seems to fail on 3.6.
There's the full log, and here again the acute snippet. Also, please see how in the full log a number of tests xpass. These are the ones I had marked as failing for 2.7. Interesting how this is complementary...
Any idea what I can do about these?
josef-pkt commentedon Sep 25, 2018
What is your pandas version?
Those are all column reorderings, IIRC because python 3.6 changed to ordered dict.
Those are also supposed to be fixed in master
TheChymera commentedon Sep 25, 2018
@josef-pkt
So
0.23.4but as you can see above there is a notable gap in versions on my distribution, so I cannot reasonably downgrade.josef-pkt commentedon Sep 25, 2018
Essentially pandas and python and ... are changing too fast to keep up given our release schedule.
Debian is using a patched version where they backport some of our fixes, when we are too slow in releasing statsmodels.
Maybe with the recent changes in the setup.py and automatic doc and windows binaries building, it will become easier to quickly throw a minimal compat release at the public (especially if I don't have to be the release manager)
cpoptic commentedon Feb 28, 2019
So bottom line, does statsmodels work with Pandas 0.24? I think it's standard operating procedure to use the most recent version of a library, so downgrading to Pandas 0.23 or 0.22 is a suboptimal solution. Can we get statsmodels to play nicely with Pandas 0.24?
bashtage commentedon Jul 17, 2019
Closing this since our test suite seems to pass reliably on many platforms. Please reopen if this is still an issue.