alchemistry / alchemlyb

the simple alchemistry library
https://alchemlyb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
197 stars 51 forks source link

new version of pandas >=1.4 breaks NAMD-based test due to change in DataFrame column order #200

Closed xiki-tempula closed 2 years ago

xiki-tempula commented 2 years ago

In the recent CI https://github.com/alchemistry/alchemlyb/runs/7051459012?check_suite_focus=true The test src/alchemlyb/tests/test_fep_estimators.py::TestBAR::test_bar[X_delta_f12] shows a flipped sign

self = <alchemlyb.tests.test_fep_estimators.TestBAR object at 0x7f70d16a1700>
X_delta_f = (                    0.0       0.1  0.2  0.3  0.4  ...  0.6  0.7  0.8       0.9  1.0
time    fep-lambda               ...         0.0 -1.969434  NaN  NaN  NaN  ...  NaN  NaN  NaN       NaN  NaN
[30170 rows x 11 columns], -4.18405, 0.03457)
    def compare_delta_f(self, X_delta_f):
        est = self.cls().fit(X_delta_f[0])
        delta_f, d_delta_f = self.get_delta_f(est)
>       assert X_delta_f[1] == pytest.approx(delta_f, rel=1e-3)
E       assert -4.18405 == 4.184059763024196 ± 4.2e-03
E         comparison failed
E         Obtained: -4.18405
E         Expected: 4.184059763024196 ± 4.2e-03
src/alchemlyb/tests/test_fep_estimators.py:138: AssertionError
orbeckst commented 2 years ago

See https://github.com/alchemistry/alchemlyb/pull/201#issuecomment-1170609311 for the reason.