From f0951ee9fb64d1c7dff8891e1c030145ccfa0e16 Mon Sep 17 00:00:00 2001 From: wrongkindofdoctor <20195932+wrongkindofdoctor@users.noreply.github.com> Date: Mon, 16 Sep 2024 17:10:43 -0400 Subject: [PATCH] change value for for hourly data search in datelabel get_timedelta_kwargs to return 1hr instead of hr so that the frequency for hourly data matchew required catalog specification --- src/util/datelabel.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util/datelabel.py b/src/util/datelabel.py index 4c9539431..7bc064085 100644 --- a/src/util/datelabel.py +++ b/src/util/datelabel.py @@ -56,6 +56,8 @@ # match-case statement to give date format # input can be int or str + + def date_fmt(date: str): date_digits = len(date) match date_digits: @@ -72,6 +74,8 @@ def date_fmt(date: str): return fmt # convert a string to a cftime object + + def str_to_cftime(time_str: str, fmt=None, calendar=None): if fmt is None: fmt = date_fmt(time_str) @@ -1175,8 +1179,8 @@ def _parse_input_string(cls, quantity, unit): s = 'wk' elif s in ['daily', 'day', 'days', 'dy', 'd', 'diurnal', 'diurnally']: s = 'day' - elif s in ['hourly', 'hour', 'hours', 'hr', 'h']: - s = 'hr' + elif s in ['hourly', 'hour', 'hours', 'hr', 'h', '1hr']: + s = '1hr' elif s in ['minutes', 'minute', 'min']: s = 'min' else: @@ -1201,7 +1205,7 @@ def _get_timedelta_kwargs(cls, q, s): return {'weeks': q} elif s == 'day': return {'days': q} - elif s == 'hr': + elif s == '1hr': return {'hours': q} elif s == 'min': return {'minutes': q}