From 57e7f4a17240a95a65ce1a1ba6b51f9f72817f77 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Thu, 4 Jan 2024 21:21:18 +0100 Subject: [PATCH] NUMBA_OPT=0 fails CI; removing debug leftovers; add max(1, time) --- .github/workflows/tests+pypi.yml | 2 +- examples/PyMPDATA_examples/Olesik_et_al_2022/wall_time.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests+pypi.yml b/.github/workflows/tests+pypi.yml index 0d15ab26..84c5edae 100644 --- a/.github/workflows/tests+pypi.yml +++ b/.github/workflows/tests+pypi.yml @@ -147,7 +147,7 @@ jobs: run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV - env: - NUMBA_OPT: 0 + NUMBA_OPT: 1 run: | pytest --durations=10 -p no:unraisableexception -We tests/unit_tests pytest --durations=10 -p no:unraisableexception -We -k "not test_timing_3d" tests/smoke_tests diff --git a/examples/PyMPDATA_examples/Olesik_et_al_2022/wall_time.py b/examples/PyMPDATA_examples/Olesik_et_al_2022/wall_time.py index d88f7d7d..33a7e2a9 100644 --- a/examples/PyMPDATA_examples/Olesik_et_al_2022/wall_time.py +++ b/examples/PyMPDATA_examples/Olesik_et_al_2022/wall_time.py @@ -27,15 +27,14 @@ def test_wall_time(n_runs=3, mrats=(20,), generate=False, print_tab=True, rtol=R minimum_values = [] while i < n_runs: result = make_data(settings, grid, opts) - print("\t", i, opts, result["wall_time"]) wall_times = result["wall_time"] minimal = np.nanmin(wall_times) minimum_values.append(minimal) i += 1 selected_value = np.min(minimum_values) if opts == {"n_iters": 1}: - norm = selected_value - print(norm) + at_least_one_to_avoid_nans = 1 + norm = max(at_least_one_to_avoid_nans, selected_value) table_data["opts"].append(str(opts) + "(" + grid.__class__.__name__ + ")") table_data["values"].append( np.nan if norm == 0 else round(selected_value / norm, 1)