Skip to content

Commit

Permalink
Merge pull request #1721 from keewis/numpy-1.25
Browse files Browse the repository at this point in the history
add NEP18 overrides for `max`, `min`, and `round`
  • Loading branch information
jules-ch authored Mar 22, 2023
2 parents 5314065 + 833a5ca commit d0106d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pint/facets/numpy/numpy_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ def implementation(*args, **kwargs):
("ptp", "a", True),
("ravel", "a", True),
("round_", "a", True),
("round", "a", True),
("sort", "a", True),
("median", "a", True),
("nanmedian", "a", True),
Expand All @@ -816,6 +817,8 @@ def implementation(*args, **kwargs):
("broadcast_to", ["array"], True),
("amax", ["a", "initial"], True),
("amin", ["a", "initial"], True),
("max", ["a", "initial"], True),
("min", ["a", "initial"], True),
("searchsorted", ["a", "v"], False),
("isclose", ["a", "b"], False),
("nan_to_num", ["x", "nan", "posinf", "neginf"], True),
Expand Down
2 changes: 1 addition & 1 deletion pint/testsuite/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def test_round_numpy_func(self):
np.around(1.0275 * self.ureg.m, decimals=2), 1.03 * self.ureg.m
)
helpers.assert_quantity_equal(
np.round_(1.0275 * self.ureg.m, decimals=2), 1.03 * self.ureg.m
np.round(1.0275 * self.ureg.m, decimals=2), 1.03 * self.ureg.m
)

def test_trace(self):
Expand Down

0 comments on commit d0106d7

Please sign in to comment.