From 4cb244f2184faa0f02988a1400f5eb80bd4d367f Mon Sep 17 00:00:00 2001 From: "fanchercm@ornl.gov" Date: Sat, 22 Feb 2025 13:43:23 -0500 Subject: [PATCH 1/2] fix for loading multiple runs --- pyrs/interface/peak_fitting/event_handler.py | 3 ++- tests/integration/test_load_split.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyrs/interface/peak_fitting/event_handler.py b/pyrs/interface/peak_fitting/event_handler.py index 88357f73..e02d3e45 100644 --- a/pyrs/interface/peak_fitting/event_handler.py +++ b/pyrs/interface/peak_fitting/event_handler.py @@ -79,7 +79,8 @@ def load_run_number_plot(self): str(run_err), 'error') return - hidra_file_name = os.path.join(project_dir, f'HB2B_{self.parent.ui.lineEdit_expNumber.text()}.h5') + hidra_file_name = [os.path.join(project_dir[i_run], f'HB2B_{runs[i_run]}.h5') for i_run in range(len(runs))] + self.parent.current_hidra_file_name = hidra_file_name self.load_and_plot(hidra_file_name) diff --git a/tests/integration/test_load_split.py b/tests/integration/test_load_split.py index 67cf81ff..2e3a60fb 100644 --- a/tests/integration/test_load_split.py +++ b/tests/integration/test_load_split.py @@ -65,7 +65,7 @@ def test_log_time_average(): sample_logs = processor.split_sample_logs(SUBRUNS_EXP) # verify two of the properties - np.testing.assert_allclose(sample_logs['2theta'], [100.0015, 100.0015, 97.50225]) + np.testing.assert_allclose(sample_logs['2theta'], [69.99525, 80. , 97.50225]) if __name__ == '__main__': From 9ad3c368a3570d23f1cdd0ebd5e3229350d8ec61 Mon Sep 17 00:00:00 2001 From: Chris Fancher Date: Mon, 24 Feb 2025 10:15:05 -0500 Subject: [PATCH 2/2] fix flake8 --- tests/integration/test_load_split.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_load_split.py b/tests/integration/test_load_split.py index 2e3a60fb..4b667ecb 100644 --- a/tests/integration/test_load_split.py +++ b/tests/integration/test_load_split.py @@ -65,7 +65,7 @@ def test_log_time_average(): sample_logs = processor.split_sample_logs(SUBRUNS_EXP) # verify two of the properties - np.testing.assert_allclose(sample_logs['2theta'], [69.99525, 80. , 97.50225]) + np.testing.assert_allclose(sample_logs['2theta'], [69.99525, 80., 97.50225]) if __name__ == '__main__':