Pint 0.24.0 (released 2024-06-) triggered CI failures like this:
FAILED ixmp/tests/report/test_reporter.py::test_platform_units[attrseries] - Failed: Did not log:
'x: replace units dimensionless with USD/pkm'
among:
"x: mixed units ['kg', 'USD/pkm'] discarded"
'x: replace units with USD/pkm'
File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/pint/facets/numpy/numpy_func.py", line 958, in implement_single_dimensionless_argument_func
func = getattr(np, func_str)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.3/x64/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'?
Because of this (but for no other reason, i.e. no issue inherent to ixmp), the mitigation also requires to limit NumPy < 2.
Fix
It seems pint 0.24.1 will shortly be released and will reverse the change.
Wait for the release, confirm the fix, remove the work-around, and close this issue.
Pint 0.24.0 (released 2024-06-) triggered CI failures like this:
This was due to hgrecco/pint#2007 affecting this line: https://github.com/iiasa/ixmp/blob/35da509c8a08b55d9bb7fc8854748e6aa49c7c3e/ixmp/report/operator.py#L124-L126
Work-around / mitigation
Limit pint to < 0.24.
At #535, with pint 0.23 and NumPy 2.0.0, we see:
This is mentioned at https://github.com/hgrecco/pint/issues/1974#issuecomment-2106089028.
Because of this (but for no other reason, i.e. no issue inherent to ixmp), the mitigation also requires to limit NumPy < 2.
Fix