iiasa / ixmp

The ix modeling platform for integrated and cross-cutting scenario analysis
https://docs.messageix.org/ixmp
Apache License 2.0
38 stars 111 forks source link

Work around bug in pint 0.24.0 #534

Open khaeru opened 3 months ago

khaeru commented 3 months ago

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'

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

Fix

khaeru commented 3 months ago

This also affects message-ix-models (see here), so the same work-around could be applied. message_ix is not affected.