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

DM-38581: Fix astshim tests so that they work with numpy 1.23 #64

Merged
merged 1 commit into from
Apr 5, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/test_chebyMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ def referenceFunc(point):
chebval2d(x1, x2, c2),
)

null_coeff = np.zeros(shape=(0, 4))
# TODO: DM-38580
# This two-step way of creating a zero-size array gives
# an array with non-zero strides which makes pybind11/
# ndarray happy.
null_coeff = np.array([], dtype=float)
null_coeff.shape = (0, 4)
self.assertEqual(nin, null_coeff.shape[1] - 2)

# arbitary input points that cover the full domain
Expand Down
12 changes: 12 additions & 0 deletions tests/test_polyMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def test_PolyMapBidirectional(self):
def test_PolyMapEmptyForwardCoeffs(self):
"""Test constructing a PolyMap with empty forward coefficients
"""
# TODO: DM-38580
# This two-step way of creating a zero-size array gives
# an array with non-zero strides which makes pybind11/
# ndarray happy.
coeff_f = np.array([], dtype=float)
coeff_f.shape = (0, 4)
coeff_i = np.array([
Expand Down Expand Up @@ -183,6 +187,10 @@ def test_PolyMapEmptyInverseCoeffs(self):
[1., 2, 1, 0],
[-1., 2, 0, 1]
])
# TODO: DM-38580
# This two-step way of creating a zero-size array gives
# an array with non-zero strides which makes pybind11/
# ndarray happy.
coeff_i = np.array([], dtype=float)
coeff_i.shape = (0, 4)
pm = ast.PolyMap(coeff_f, coeff_i)
Expand All @@ -206,6 +214,10 @@ def test_PolyMapNoTransform(self):
"""Test constructing a PolyMap with neither forward nor inverse
coefficients
"""
# TODO: DM-38580
# This two-step way of creating a zero-size array gives
# an array with non-zero strides which makes pybind11/
# ndarray happy.
coeff_f = np.array([], dtype=float)
coeff_f.shape = (0, 4)
coeff_i = np.array([], dtype=float)
Expand Down