diff --git a/arraycontext/fake_numpy.py b/arraycontext/fake_numpy.py index 916d79d2d179f20bafb0e3af8f13b9431a4c2b34..251a5a27f5e9875455feb2c669404b2d71348b10 100644 --- a/arraycontext/fake_numpy.py +++ b/arraycontext/fake_numpy.py @@ -148,7 +148,9 @@ class BaseFakeNumpyNamespace: def __getattr__(self, name): def loopy_implemented_elwise_func(*args): if all(np.isscalar(ary) for ary in args): - return getattr(np, name)(*args) + return getattr( + np, self._c_to_numpy_arc_functions.get(name, name) + )(*args) actx = self._array_context prg = _get_scalar_func_loopy_program(actx, @@ -160,7 +162,7 @@ class BaseFakeNumpyNamespace: if name in self._c_to_numpy_arc_functions: from warnings import warn warn(f"'{name}' in ArrayContext.np is deprecated. " - "Use '{c_to_numpy_arc_functions[name]}' as in numpy. " + f"Use '{self._c_to_numpy_arc_functions[name]}' as in numpy. " "The old name will stop working in 2021.", DeprecationWarning, stacklevel=3) diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py index d97f00f0f1dd1a72c997109e28914376c917652d..39e49b22a42402788959273793a4a2c322fc9496 100644 --- a/test/test_arraycontext.py +++ b/test/test_arraycontext.py @@ -283,6 +283,8 @@ def assert_close_to_numpy_in_containers(actx, op, args): ("max", 1, np.float64), ("any", 1, np.float64), ("all", 1, np.float64), + ("arctan", 1, np.float64), + ("atan", 1, np.float64), # float + complex ("sin", 1, np.float64),