From 892193f9705a0b33b6762fd2c14d074e36f2fd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?thorbjoernl=20=28Thorbj=C3=B8rn=29?= <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:48:18 +0000 Subject: [PATCH 1/3] More logging and pytest.ini for investigating flaky ci test --- pyaerocom/io/mscw_ctm/reader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyaerocom/io/mscw_ctm/reader.py b/pyaerocom/io/mscw_ctm/reader.py index 1e66200b6..4e5780270 100755 --- a/pyaerocom/io/mscw_ctm/reader.py +++ b/pyaerocom/io/mscw_ctm/reader.py @@ -574,6 +574,8 @@ def _open_file(self): start_date = min([x for x in [start_date, file_start_date] if x is not None]) end_date = max([x for x in [file_end_date, file_end_date] if x is not None]) + logger.info(f"******* Found enddate, start_date: {end_date}, {start_date}") + logger.info(f"{(end_date - start_date) / np.timedelta64(1, 'h')}") if (end_date - start_date) / np.timedelta64(1, "h") > (366 * 24): raise ValueError( f"ts_type {ts_type} can not be hourly when using multiple years ({start_date} - {end_date})" From 5702be9f3506328b1bd35e6931be92bcb4262be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?thorbjoernl=20=28Thorbj=C3=B8rn=29?= <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:32:49 +0000 Subject: [PATCH 2/3] Attempt to fix flaky test --- pyaerocom/io/mscw_ctm/reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaerocom/io/mscw_ctm/reader.py b/pyaerocom/io/mscw_ctm/reader.py index 4e5780270..aed77aeac 100755 --- a/pyaerocom/io/mscw_ctm/reader.py +++ b/pyaerocom/io/mscw_ctm/reader.py @@ -572,7 +572,7 @@ def _open_file(self): file_end_date = nc["time"][:].data.max() start_date = min([x for x in [start_date, file_start_date] if x is not None]) - end_date = max([x for x in [file_end_date, file_end_date] if x is not None]) + end_date = max([x for x in [end_date, file_end_date] if x is not None]) logger.info(f"******* Found enddate, start_date: {end_date}, {start_date}") logger.info(f"{(end_date - start_date) / np.timedelta64(1, 'h')}") From d07f1a37b05f2edb0645e53ee31856020bfbbb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?thorbjoernl=20=28Thorbj=C3=B8rn=29?= <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:44:10 +0000 Subject: [PATCH 3/3] Fix issue --- pyaerocom/io/mscw_ctm/reader.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyaerocom/io/mscw_ctm/reader.py b/pyaerocom/io/mscw_ctm/reader.py index aed77aeac..60bd6b3fe 100755 --- a/pyaerocom/io/mscw_ctm/reader.py +++ b/pyaerocom/io/mscw_ctm/reader.py @@ -574,8 +574,6 @@ def _open_file(self): start_date = min([x for x in [start_date, file_start_date] if x is not None]) end_date = max([x for x in [end_date, file_end_date] if x is not None]) - logger.info(f"******* Found enddate, start_date: {end_date}, {start_date}") - logger.info(f"{(end_date - start_date) / np.timedelta64(1, 'h')}") if (end_date - start_date) / np.timedelta64(1, "h") > (366 * 24): raise ValueError( f"ts_type {ts_type} can not be hourly when using multiple years ({start_date} - {end_date})"