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

Upgrade to pandas 2.0 #343

Open
phackstock opened this issue Oct 18, 2023 · 0 comments
Open

Upgrade to pandas 2.0 #343

phackstock opened this issue Oct 18, 2023 · 0 comments

Comments

@phackstock
Copy link
Contributor

As I was trying to update climate-assessment to use the latest scmdata to use pandas 2.0 (here: iiasa/climate-assessment#46 (comment)) I got an error which looks to be related to pymagicc and pandas 2.0

Installing pymagicc and trying to run the tests gave me the following error:

(.venv) hackstock@nb-hackstock:~/Documents/code/pymagicc$ pytest
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 939, in _find_spec
AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec'
...
TypeError: required field "lineno" missing from alias

I was able to remedy that by upgrading pytest to the latest version. But then I got this error:

...
.venv/lib/python3.10/site-packages/pint_pandas/__init__.py:3: in <module>
    from .pint_array import PintArray, PintType
.venv/lib/python3.10/site-packages/pint_pandas/pint_array.py:198: in <module>
    np.complex128: pd.core.dtypes.dtypes.PandasDtype("complex128"),
E   AttributeError: module 'pandas.core.dtypes.dtypes' has no attribute 'PandasDtype'

which again seems to be related to pandas 2 and Pint-Pandas (version 0.4). Looks like pint-pandas version 0.5 fixes this.
I tried updating to pint-pandas 0.5 but that poses a version conflict since pint-pandas 0.5 requires pint 0.22 and scmdata required pint 0.20 (openscm/scmdata#271 and openscm/scmdata#234).

Any help would be much appreciated.

Failing Test

Fails on import

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

1 participant