From 1e4e730087ad6fd8ddf52db3d8ccef78ee7133db Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Thu, 21 Nov 2024 08:03:33 -0700 Subject: [PATCH] Fix a few more edge cases --- tst/run_tests.py | 4 ++-- tst/scripts/utils/artemis.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tst/run_tests.py b/tst/run_tests.py index a1aae1d..d3fdb2a 100755 --- a/tst/run_tests.py +++ b/tst/run_tests.py @@ -166,7 +166,7 @@ def main(**kwargs): # insert arguments for artemis.make() artemis_cmake_args = kwargs.pop("cmake") artemis_make_nproc = kwargs.pop("make_nproc") - module.artemis.make(artemis_cmake_args, artemis_make_nproc) + artemis.make(artemis_cmake_args, artemis_make_nproc) except Exception: logger.error("Exception occurred", exc_info=True) test_errors.append("make()") @@ -308,7 +308,7 @@ def set_globals(args): else: # If we are in a directory with an executable, default to using that local_path = os.path.join(os.getcwd(), "artemis") - if os.path.exists(local_path) and os.access(local_path, os.X_OK): + if os.path.isfile(local_path) and os.access(local_path, os.X_OK): # If no out_dir was passed, set it to the cwd if out_dir is None: out_dir = os.getcwd() diff --git a/tst/scripts/utils/artemis.py b/tst/scripts/utils/artemis.py index e52b946..e8b7322 100644 --- a/tst/scripts/utils/artemis.py +++ b/tst/scripts/utils/artemis.py @@ -47,6 +47,8 @@ def set_mpi_oversubscribe(use_oversubscribe): def set_supplied_exe(use_exe): global use_supplied_exe use_supplied_exe = use_exe + custom_msg = "use pre-existing" if use_exe else "build" + print("...Regression will " + custom_msg + " executable...\n") # Optionally set custom path for executable, and update other variables related to where @@ -252,7 +254,6 @@ def create_colorbar(ax, norm, where="top", cax=None, cmap="viridis", **kargs): # Shared function to compute analytic Ogilvie & Lubow (2002) spiral positions def spiral_pos(r, r0=1.0, p0=np.pi, h=0.05): - # Analytic spiral position from def mod_2pi(p): while p > 2 * np.pi: p -= 2 * np.pi