From 48b46791bdbeb1a5b20bac10bfa40b5c1d064336 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni <kaushikcfd@gmail.com> Date: Fri, 18 Jun 2021 10:44:10 -0500 Subject: [PATCH] prefer np.isscalar(s) over isinstance(s, Number) --- arraycontext/impl/pytato.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arraycontext/impl/pytato.py b/arraycontext/impl/pytato.py index b5d91a9..9509c0b 100644 --- a/arraycontext/impl/pytato.py +++ b/arraycontext/impl/pytato.py @@ -303,8 +303,7 @@ class PytatoExecutable: # {{{ extract loopy arguments execute the program for pos, arg in enumerate(args): - if isinstance(arg, np.number): - + if np.isscalar(arg): input_kwargs_to_loopy[self.input_id_to_name_in_program[(pos,)]] = ( cla.to_device(self.actx.queue, np.array(arg))) elif is_array_container(arg): -- GitLab