Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Pint Changelog
0.24 (unreleased)
-----------------

- Implement numpy roll (Related to issue #981)
- Add `dim_sort` function to _formatter_helpers.
- Add `dim_order` and `default_sort_func` properties to FullFormatter.
(PR #1926, fixes Issue #1841)
Expand Down
2 changes: 2 additions & 0 deletions pint/facets/numpy/numpy_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def implementation(*args, **kwargs):
"take",
"trace",
"transpose",
"roll",
"ceil",
"floor",
"hypot",
Expand Down Expand Up @@ -850,6 +851,7 @@ def implementation(*args, **kwargs):
("median", "a", True),
("nanmedian", "a", True),
("transpose", "a", True),
("roll", "a", True),
("copy", "a", True),
("average", "a", True),
("nanmean", "a", True),
Expand Down
5 changes: 5 additions & 0 deletions pint/testsuite/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ def test_broadcast_arrays(self):
result = np.broadcast_arrays(x, y, subok=True)
helpers.assert_quantity_equal(result, expected)

def test_roll(self):
helpers.assert_quantity_equal(
np.roll(self.q, 1), [[4, 1], [2, 3]] * self.ureg.m
)


class TestNumpyMathematicalFunctions(TestNumpyMethods):
# https://www.numpy.org/devdocs/reference/routines.math.html
Expand Down