tl;dr: Two problems, firstly, unit_parse doesn't work with the latest python + numpy, due to a issue in pint. If I upgrade pint, then unit_parse fails due to outdated support_files.
File ".venv/lib/python3.12/site-packages/numpy/__init__.py", line 410, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'cumproduct'. Did you mean: 'cumprod'?
which seems to be because of https://github.com/hgrecco/pint/issues/1974, python 3 + numpy 2 + pint don't play nicely. They fixed it in pint 0.24.1, so pip install pint=0.24.1
It seems the support_files/constants_en.txt and support_files/default_en.txt are not the same as the ones that now come with pint. If I update them, everything now works correctly.
Is there any reason unit_parse bundles these files? and doesn't just create a default pint registry? Happy to send a pull request to fix this by either updating the bundled files, or changing to use a default pint setup.
tl;dr: Two problems, firstly, unit_parse doesn't work with the latest python + numpy, due to a issue in pint. If I upgrade pint, then unit_parse fails due to outdated support_files.
Very simple program:
fails with:
which seems to be because of https://github.com/hgrecco/pint/issues/1974, python 3 + numpy 2 + pint don't play nicely. They fixed it in pint 0.24.1, so
pip install pint=0.24.1
now fails with:
It seems the
support_files/constants_en.txt
andsupport_files/default_en.txt
are not the same as the ones that now come with pint. If I update them, everything now works correctly.Is there any reason unit_parse bundles these files? and doesn't just create a default pint registry? Happy to send a pull request to fix this by either updating the bundled files, or changing to use a default pint setup.