From aa430d0957b8f8de2167c8bd949fb37805ff9528 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 20 Nov 2020 09:41:31 -0600 Subject: [PATCH] Be compatible with both actx.np.acos and actx.np.arccos --- meshmode/array_context.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meshmode/array_context.py b/meshmode/array_context.py index 8c4a2e25..d238c72d 100644 --- a/meshmode/array_context.py +++ b/meshmode/array_context.py @@ -73,7 +73,7 @@ class _BaseFakeNumpyNamespace: "degrees", "radians", "unwrap", "deg2rad", "rad2deg", # Deprecated, for compatibility (see below) - "atan2", + "atan2", "acos", # Hyperbolic functions "sinh", "cosh", "tanh", "arcsinh", "arccosh", "arctanh", @@ -239,6 +239,13 @@ class ArrayContext: warn("'atan2' in ArrayContext.np is deprecated. Use 'arctan2', " "as in numpy2. This will be disallowed in 2021.", DeprecationWarning, stacklevel=3) + elif name == "arccos": + name = "acos" + elif name == "acos": + from warnings import warn + warn("'acos' in ArrayContext.np is deprecated. Use 'arccos', " + "as in numpy2. This will be disallowed in 2021.", + DeprecationWarning, stacklevel=3) from pymbolic import var -- GitLab