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

Add units to atol in np.isclose #97

Merged
merged 3 commits into from
May 5, 2023
Merged

Add units to atol in np.isclose #97

merged 3 commits into from
May 5, 2023

Conversation

glatterf42
Copy link
Member

@glatterf42 glatterf42 commented May 2, 2023

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

  • Read the diff and note that the CI checks all pass.

PR checklist

  • Continuous integration checks all ✅
  • Add, expand, or update documentation.
  • Update doc/whatsnew.

Change in pint 0.21
@glatterf42 glatterf42 added the ci Continuous integration & testing label May 2, 2023
@glatterf42 glatterf42 self-assigned this May 2, 2023
@codecov
Copy link

codecov bot commented May 2, 2023

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%> (ø)

@glatterf42 glatterf42 requested a review from khaeru May 2, 2023 09:31
@khaeru khaeru merged commit 2b8e8a3 into main May 5, 2023
@glatterf42 glatterf42 deleted the adjust-to-pint-0.21 branch May 5, 2023 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration & testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants