Skip to content

Commit

Permalink
CLN: Remove default name for a new axis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Stevens-Haas committed Jan 6, 2024
1 parent 341f15c commit 0ae9f6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pysindy/utils/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ def __array_finalize__(self, obj) -> None:
(
not isinstance(obj, AxesArray),
self.shape == (),
not hasattr(self, "__ax_map"),
not hasattr(self, "_ax_map"),
)
):
self._ax_map = _AxisMapping({})
# required by ravel() and view() used in numpy testing. Also for zeros_like...
elif all(
(
isinstance(obj, AxesArray),
not hasattr(self, "__ax_map"),
not hasattr(self, "_ax_map"),
self.shape == obj.shape,
)
):
Expand Down
6 changes: 3 additions & 3 deletions test/utils/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
assert_(c is b)
check = np.add.accumulate(d, axis=0)
c = np.add.accumulate(a, axis=0)
# assert_equal(c, check)
assert_equal(c, check)
b = np.zeros_like(c)
c = np.add.accumulate(a, 0, None, b)
assert_equal(c, check)
Expand All @@ -119,11 +119,11 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
a = d.copy().view(AxesArray)
np.add.at(check, ([0, 1], [0, 2]), 1.0)
np.add.at(a, ([0, 1], [0, 2]), 1.0)
assert_equal(a, check)
assert_equal(np.asarray(a), np.asarray(check)) # modified
b = np.array(1.0).view(AxesArray)
a = d.copy().view(AxesArray)
np.add.at(a, ([0, 1], [0, 2]), b)
assert_equal(a, check)
assert_equal(np.asarray(a), np.asarray(check)) # modified


def test_n_elements():
Expand Down

0 comments on commit 0ae9f6a

Please sign in to comment.