Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI broken for pandas 2.1 #93

Closed
IAlibay opened this issue Sep 14, 2023 · 4 comments
Closed

CI broken for pandas 2.1 #93

IAlibay opened this issue Sep 14, 2023 · 4 comments

Comments

@IAlibay
Copy link
Member

IAlibay commented Sep 14, 2023

See #92

Looks like Pandas 2.1 has some compatibility issues with solvation-analysis.

@orbeckst
Copy link
Member

From the failed CI run https://github.com/MDAnalysis/solvation-analysis/actions/runs/6185101020/job/16790038552

________________ ERROR at setup of test_residence_times[fec-10] ________________

solvation_data_sparse =                                                 distance  ... solvent_ix
frame solute_ix solute_atom_ix solvent_atom_i...9508  ...        150
                               4204             2.208404  ...        350

[13599 rows x 4 columns]

    @pytest.fixture(scope='module')
    def residence(solvation_data_sparse):
>       return Residence(solvation_data_sparse, step=10)

solvation_analysis/tests/conftest.py:322: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
solvation_analysis/residence.py:88: in __init__
    self._auto_covariances = self._calculate_auto_covariance_dict()
solvation_analysis/residence.py:123: in _calculate_auto_covariance_dict
    adjacency_df = adjacency_mini.reindex(frame_solute_index, fill_value=0)
/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/frame.py:5144: in reindex
    return super().reindex(
/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/generic.py:5521: in reindex
    return self._reindex_axes(
/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/generic.py:5544: in _reindex_axes
    new_index, indexer = ax.reindex(
/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/indexes/base.py:4426: in reindex
    indexer = self.get_indexer(
/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/indexes/base.py:3942: in get_indexer
    return self._get_indexer(target, method, limit, tolerance)
/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/indexes/base.py:3963: in _get_indexer
    tgt_values = engine._extract_level_codes(  # type: ignore[union-attr]
index.pyx:723: in pandas._libs.index.BaseMultiIndexCodesEngine._extract_level_codes
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = MultiIndex([(500, 650,  0),
            (500, 651,  1),
            (500, 652,  2),
            (500, 653,  3),
      ...   (990, 695, 45),
            (990, 696, 46)],
           names=['frame', 'solute_ix', 'solute_atom_ix'], length=2350)
new_levels = FrozenList([[500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, ...3, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696]])
copy = True

    def _recode_for_new_levels(
        self, new_levels, copy: bool = True
    ) -> Generator[np.ndarray, None, None]:
        if len(new_levels) != self.nlevels:
>           raise AssertionError(
                f"Length of new_levels ({len(new_levels)}) "
                f"must be same as self.nlevels ({self.nlevels})"
            )
E           AssertionError: Length of new_levels (2) must be same as self.nlevels (3)

/usr/local/miniconda/envs/test/lib/python3.11/site-packages/pandas/core/indexes/multi.py:2464: AssertionError

....
....
....


FAILED solvation_analysis/tests/test_plotting.py::test_compare_residence_times - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED solvation_analysis/tests/test_residence.py::test_residence_from_solute - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED solvation_analysis/tests/test_residence.py::test_residence_time_warning - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED solvation_analysis/tests/test_solute.py::test_run_w_all - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
FAILED solvation_analysis/tests/test_solute.py::test_iba_all_analysis - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
ERROR solvation_analysis/tests/test_residence.py::test_residence_times[fec-10] - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
ERROR solvation_analysis/tests/test_residence.py::test_residence_times[bn-80] - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
ERROR solvation_analysis/tests/test_residence.py::test_residence_times[pf6-nan] - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
ERROR solvation_analysis/tests/test_residence.py::test_plot_auto_covariance[fec] - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
ERROR solvation_analysis/tests/test_residence.py::test_plot_auto_covariance[bn] - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)
ERROR solvation_analysis/tests/test_residence.py::test_plot_auto_covariance[pf6] - AssertionError: Length of new_levels (2) must be same as self.nlevels (3)

@orbeckst
Copy link
Member

Is it pandas >= 2.1 or is 2.0 also broken?

orbeckst added a commit that referenced this issue Sep 18, 2023
- temporary fix for #93
- pin in setup.py, pyproject.yaml, test_env.yaml and requirements.txt
This was referenced Sep 18, 2023
orbeckst added a commit to orbeckst/solvation_analysis-feedstock that referenced this issue Sep 18, 2023
Code has some incompatibilities with pandas >= 2.1. 
This is a temporary fix to pin the package dependency to
pandas <2.1.

See also MDAnalysis/solvation-analysis#93
@orbeckst
Copy link
Member

#92 answered my question: it is 2.1 so pandas<2.1 should work.

@hmacdope
Copy link
Member

Fixed with pin in #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants