From ce44ca58282f45049def7b219ebfbd981625fd2e Mon Sep 17 00:00:00 2001 From: Claire Kopenhafer Date: Wed, 20 Dec 2023 17:55:07 -0500 Subject: [PATCH 1/2] Ignore units when performing exact Sod tests --- yt/frontends/enzo/answer_testing_support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt/frontends/enzo/answer_testing_support.py b/yt/frontends/enzo/answer_testing_support.py index f57caf46a1f..2e8ddca404f 100644 --- a/yt/frontends/enzo/answer_testing_support.py +++ b/yt/frontends/enzo/answer_testing_support.py @@ -104,7 +104,7 @@ def __call__(self): field = ad[k].d for xmin, xmax in zip(self.left_edges, self.right_edges): mask = (position >= xmin) * (position <= xmax) - exact_field = np.interp(position[mask], exact["pos"], exact[k]) + exact_field = np.interp(position[mask].value, exact["pos"], exact[k]) myname = f"ShockTubeTest_{k}" # yield test vs analytical solution yield AssertWrapper( From 78abdfb933c19fc457fc66a5df37da31850e502d Mon Sep 17 00:00:00 2001 From: Claire Kopenhafer Date: Thu, 21 Dec 2023 09:49:16 -0500 Subject: [PATCH 2/2] Swap value to ndview for mem usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Robert --- yt/frontends/enzo/answer_testing_support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt/frontends/enzo/answer_testing_support.py b/yt/frontends/enzo/answer_testing_support.py index 2e8ddca404f..87def1b9981 100644 --- a/yt/frontends/enzo/answer_testing_support.py +++ b/yt/frontends/enzo/answer_testing_support.py @@ -104,7 +104,7 @@ def __call__(self): field = ad[k].d for xmin, xmax in zip(self.left_edges, self.right_edges): mask = (position >= xmin) * (position <= xmax) - exact_field = np.interp(position[mask].value, exact["pos"], exact[k]) + exact_field = np.interp(position[mask].ndview, exact["pos"], exact[k]) myname = f"ShockTubeTest_{k}" # yield test vs analytical solution yield AssertWrapper(