From b86087f85c57019e04375389243fe40763cb0081 Mon Sep 17 00:00:00 2001 From: veenstrajelmer Date: Thu, 26 Mar 2026 16:30:25 +0100 Subject: [PATCH 1/4] more concise warning message --- hatyan/astrog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hatyan/astrog.py b/hatyan/astrog.py index d235a70..1022bb3 100644 --- a/hatyan/astrog.py +++ b/hatyan/astrog.py @@ -488,7 +488,8 @@ def astrab(date,dT_fortran=False,lon=5.3876,lat=52.1562): if (datedt.datetime(2091,1,1)).any(): # converted from Exception to warning in https://github.com/Deltares/hatyan/issues/420 - logger.warning(f'Requested time out of range (1900-2091): {date}') + logger.warning('Requested time out of range (1900-2091), requested range: ' + f'{date.min()} to {date.max()}') # constants - general EPOCH = dt.datetime(1899, 12, 31, 12, 0, 0) # 1900.0 # -12h shift because julian date 0 is at noon? From 2869a0434e3bb07271741f10f25277d9ae5c8056 Mon Sep 17 00:00:00 2001 From: veenstrajelmer Date: Thu, 26 Mar 2026 16:32:30 +0100 Subject: [PATCH 2/4] more concise warning message --- hatyan/astrog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hatyan/astrog.py b/hatyan/astrog.py index 1022bb3..0f55a2f 100644 --- a/hatyan/astrog.py +++ b/hatyan/astrog.py @@ -488,8 +488,8 @@ def astrab(date,dT_fortran=False,lon=5.3876,lat=52.1562): if (datedt.datetime(2091,1,1)).any(): # converted from Exception to warning in https://github.com/Deltares/hatyan/issues/420 - logger.warning('Requested time out of range (1900-2091), requested range: ' - f'{date.min()} to {date.max()}') + logger.warning('Requested time out of historic range (1900-2091), requested ' + f'range: {date.min()} to {date.max()}') # constants - general EPOCH = dt.datetime(1899, 12, 31, 12, 0, 0) # 1900.0 # -12h shift because julian date 0 is at noon? From 6696acd4387d98fc9476d12ef112d2e7030ff6cb Mon Sep 17 00:00:00 2001 From: veenstrajelmer Date: Thu, 26 Mar 2026 16:33:02 +0100 Subject: [PATCH 3/4] more concise warning message --- hatyan/astrog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hatyan/astrog.py b/hatyan/astrog.py index 0f55a2f..f75b066 100644 --- a/hatyan/astrog.py +++ b/hatyan/astrog.py @@ -488,8 +488,8 @@ def astrab(date,dT_fortran=False,lon=5.3876,lat=52.1562): if (datedt.datetime(2091,1,1)).any(): # converted from Exception to warning in https://github.com/Deltares/hatyan/issues/420 - logger.warning('Requested time out of historic range (1900-2091), requested ' - f'range: {date.min()} to {date.max()}') + logger.warning('Requested time(s) outside of historic range (1900-2091), ' + f'requested range: {date.min()} to {date.max()}') # constants - general EPOCH = dt.datetime(1899, 12, 31, 12, 0, 0) # 1900.0 # -12h shift because julian date 0 is at noon? From 716e39be9bd7874f5787fa183c59246f1dfd24bf Mon Sep 17 00:00:00 2001 From: veenstrajelmer Date: Thu, 26 Mar 2026 16:34:18 +0100 Subject: [PATCH 4/4] updated test --- tests/test_astrog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_astrog.py b/tests/test_astrog.py index 97347ef..9b5e162 100644 --- a/tests/test_astrog.py +++ b/tests/test_astrog.py @@ -173,7 +173,7 @@ def test_astrog_astrab_outofbounds(caplog): # converted exception to warning in https://github.com/Deltares/hatyan/issues/420 timeInput = dt.datetime(1890,1,1) _ = hatyan.astrog.astrab(timeInput,hatyan.astrog.dT(timeInput,dT_fortran=True)) - assert "equested time out of range (1900-2091)" in caplog.text + assert "Requested time(s) outside of historic range (1900-2091)" in caplog.text @pytest.mark.systemtest