From 3fd4075e5ed0fa801d6bc17fb6e797764bd86816 Mon Sep 17 00:00:00 2001 From: Keefe Mitman Date: Sun, 2 Jun 2024 14:53:31 -0700 Subject: [PATCH 1/4] Add 2nd monotonic requirement; fixes subtle bug affecting some CCE outputs --- scri/SpEC/file_io/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scri/SpEC/file_io/__init__.py b/scri/SpEC/file_io/__init__.py index a1cff5a..74e0a06 100644 --- a/scri/SpEC/file_io/__init__.py +++ b/scri/SpEC/file_io/__init__.py @@ -604,10 +604,14 @@ def create_abd_from_h5( if file_format == "spectrecce_v1": WMs[i].t -= float(radius) + indices = index_is_monotonic(WMs[i].t) + WMs[i].t = WMs[i].t[indices] + WMs[i].data = WMs[i].data[indices] + # Create an instance of AsymptoticBondiData abd = AsymptoticBondiData( - time=WM_ref.t, - ell_max=WM_ref.ell_max, + time=WMs[list(WMs.keys())[0]].t, + ell_max=WMs[list(WMs.keys())[0]].ell_max, multiplication_truncator=max, ) From 69499e9281842d9d0ffa9ac73dcf8a7a025c124b Mon Sep 17 00:00:00 2001 From: Keefe Mitman Date: Sun, 2 Jun 2024 21:07:08 -0700 Subject: [PATCH 2/4] Undo WM_ref change --- scri/SpEC/file_io/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scri/SpEC/file_io/__init__.py b/scri/SpEC/file_io/__init__.py index 74e0a06..e20af0e 100644 --- a/scri/SpEC/file_io/__init__.py +++ b/scri/SpEC/file_io/__init__.py @@ -610,8 +610,8 @@ def create_abd_from_h5( # Create an instance of AsymptoticBondiData abd = AsymptoticBondiData( - time=WMs[list(WMs.keys())[0]].t, - ell_max=WMs[list(WMs.keys())[0]].ell_max, + time=WM_ref.t, + ell_max=WM_ref.ell_max, multiplication_truncator=max, ) From dff3ae10fed4abfb0c280a0f1fff5fba3021b9de Mon Sep 17 00:00:00 2001 From: Mike Boyle Date: Mon, 3 Jun 2024 21:25:59 -0400 Subject: [PATCH 3/4] Use njit to silence new numba warnings --- scri/utilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scri/utilities.py b/scri/utilities.py index 50b8131..dddc6c3 100644 --- a/scri/utilities.py +++ b/scri/utilities.py @@ -372,7 +372,7 @@ def shuffle(a): b_array_bit += shuffle_width return b - return nb.jit(shuffle) + return nb.njit(shuffle) else: # This function is almost the same as above, except for: @@ -404,4 +404,4 @@ def unshuffle(b): b_array_bit += shuffle_width return a - return nb.jit(unshuffle) + return nb.njit(unshuffle) From fdc2751b4fec06706a48c92583b212fc7d323f41 Mon Sep 17 00:00:00 2001 From: Mike Boyle Date: Mon, 3 Jun 2024 21:26:14 -0400 Subject: [PATCH 4/4] Seed random numbers --- tests/test_waveform_grid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_waveform_grid.py b/tests/test_waveform_grid.py index fe92999..fea7e9d 100644 --- a/tests/test_waveform_grid.py +++ b/tests/test_waveform_grid.py @@ -159,6 +159,7 @@ def test_hyper_translation(): def test_supertranslation_inverses(): + np.random.seed(1234) w1 = samples.random_waveform_proportional_to_time(rotating=False) ell_max = 4 for ellpp, mpp in sf.LM_range(0, ell_max):