iiasa / message-ix-models

Tools for the MESSAGEix-GLOBIOM family of models
https://docs.messageix.org/models
Apache License 2.0
17 stars 33 forks source link

Add units to atol in np.isclose #97

Closed glatterf42 closed 1 year ago

glatterf42 commented 1 year ago

Changed in pint 0.21: atol in numpy.isclose() now requires units to be specified, see e.g. their commit that resolved their tests issues introduced by this change.

hgrecco/pint/issues/1277 might also occur somewhere in our code as workarounds that we can now possibly remove.

Adding a unit to atol in tests/test_util.py's test_convert_units(). Do we use numpy.isclose() or numpy.allclose() with units anywhere else? Does the new behaviour need documentation for our users?

How to review

PR checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #97 (4567499) into main (3ded82f) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #97   +/-   ##
=======================================
  Coverage   67.09%   67.09%           
=======================================
  Files          58       58           
  Lines        4009     4009           
=======================================
  Hits         2690     2690           
  Misses       1319     1319           
Impacted Files Coverage Δ
message_ix_models/tests/test_util.py 100.00% <100.00%> (ø)