Skip to content
Snippets Groups Projects
Commit 48da03e6 authored by Thomas Gibson's avatar Thomas Gibson
Browse files

Remove deprecated np.bool and np.object aliasing

parent feda66bb
No related branches found
No related tags found
No related merge requests found
...@@ -144,7 +144,7 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries): ...@@ -144,7 +144,7 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
def _div_helper(self, diff_func, vecs): def _div_helper(self, diff_func, vecs):
if not isinstance(vecs, np.ndarray): if not isinstance(vecs, np.ndarray):
raise TypeError("argument must be an object array") raise TypeError("argument must be an object array")
assert vecs.dtype == np.object assert vecs.dtype == object
if vecs.shape[-1] != self.ambient_dim: if vecs.shape[-1] != self.ambient_dim:
raise ValueError("last dimension of *vecs* argument must match " raise ValueError("last dimension of *vecs* argument must match "
......
...@@ -179,7 +179,7 @@ class ExecutionMapper(mappers.Evaluator, ...@@ -179,7 +179,7 @@ class ExecutionMapper(mappers.Evaluator,
if isinstance(bool_crit, DOFArray): if isinstance(bool_crit, DOFArray):
# continues below # continues below
pass pass
elif isinstance(bool_crit, (np.bool_, np.bool, np.number)): elif isinstance(bool_crit, (bool, np.bool_, np.number)):
if bool_crit: if bool_crit:
return self.rec(expr.then) return self.rec(expr.then)
else: else:
......
...@@ -649,7 +649,7 @@ def forward_metric_derivative_mat(ambient_dim, dim=None, dd=None): ...@@ -649,7 +649,7 @@ def forward_metric_derivative_mat(ambient_dim, dim=None, dd=None):
if dim is None: if dim is None:
dim = ambient_dim dim = ambient_dim
result = np.zeros((ambient_dim, dim), dtype=np.object) result = np.zeros((ambient_dim, dim), dtype=object)
for j in range(dim): for j in range(dim):
result[:, j] = forward_metric_derivative_vector(ambient_dim, j, dd=dd) result[:, j] = forward_metric_derivative_vector(ambient_dim, j, dd=dd)
...@@ -660,7 +660,7 @@ def inverse_metric_derivative_mat(ambient_dim, dim=None, dd=None): ...@@ -660,7 +660,7 @@ def inverse_metric_derivative_mat(ambient_dim, dim=None, dd=None):
if dim is None: if dim is None:
dim = ambient_dim dim = ambient_dim
result = np.zeros((ambient_dim, dim), dtype=np.object) result = np.zeros((ambient_dim, dim), dtype=object)
for i in range(dim): for i in range(dim):
for j in range(ambient_dim): for j in range(ambient_dim):
result[i, j] = inverse_metric_derivative( result[i, j] = inverse_metric_derivative(
...@@ -688,12 +688,12 @@ def inverse_first_fundamental_form(ambient_dim, dim=None, dd=None): ...@@ -688,12 +688,12 @@ def inverse_first_fundamental_form(ambient_dim, dim=None, dd=None):
form1 = first_fundamental_form(ambient_dim, dim, dd) form1 = first_fundamental_form(ambient_dim, dim, dd)
if dim == 1: if dim == 1:
inv_form1 = np.array([[1.0/form1[0, 0]]], dtype=np.object) inv_form1 = np.array([[1.0/form1[0, 0]]], dtype=object)
elif dim == 2: elif dim == 2:
(E, F), (_, G) = form1 # noqa: N806 (E, F), (_, G) = form1 # noqa: N806
inv_form1 = 1.0 / (E * G - F * F) * np.array([ inv_form1 = 1.0 / (E * G - F * F) * np.array([
[G, -F], [-F, E] [G, -F], [-F, E]
], dtype=np.object) ], dtype=object)
else: else:
raise ValueError("%dD surfaces not supported" % dim) raise ValueError("%dD surfaces not supported" % dim)
...@@ -732,7 +732,7 @@ def second_fundamental_form(ambient_dim, dim=None, dd=None): ...@@ -732,7 +732,7 @@ def second_fundamental_form(ambient_dim, dim=None, dd=None):
raise ValueError("%dD surfaces not supported" % dim) raise ValueError("%dD surfaces not supported" % dim)
from pytools import flatten from pytools import flatten
form2 = np.empty((dim, dim), dtype=np.object) form2 = np.empty((dim, dim), dtype=object)
for ref_axes in second_ref_axes: for ref_axes in second_ref_axes:
i, j = flatten([rst_axis] * n for rst_axis, n in ref_axes) i, j = flatten([rst_axis] * n for rst_axis, n in ref_axes)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment