From 75aa676f667043e020c731a98c6063139355b96e Mon Sep 17 00:00:00 2001 From: Paul Madden Date: Tue, 23 Dec 2025 15:38:57 +0000 Subject: [PATCH 1/2] Reset built number, set version to 2.12.1 --- recipe/meta.json | 6 +++--- src/uwtools/resources/info.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipe/meta.json b/recipe/meta.json index da80c7451..8a55437b5 100644 --- a/recipe/meta.json +++ b/recipe/meta.json @@ -1,6 +1,6 @@ { - "build": "py_2", - "buildnum": 2, + "build": "py_0", + "buildnum": 0, "name": "uwtools", "packages": { "dev": [ @@ -36,5 +36,5 @@ "requests >=2.32,<2.33" ] }, - "version": "2.12.0" + "version": "2.12.1" } diff --git a/src/uwtools/resources/info.json b/src/uwtools/resources/info.json index 0f093f3e2..d231de7c8 100644 --- a/src/uwtools/resources/info.json +++ b/src/uwtools/resources/info.json @@ -1,4 +1,4 @@ { - "buildnum": "2", - "version": "2.12.0" + "buildnum": "0", + "version": "2.12.1" } From 707e177877004e2c9d2ac502a8b2b40d31497365 Mon Sep 17 00:00:00 2001 From: Paul Madden <136389411+maddenp-cu@users.noreply.github.com> Date: Tue, 23 Dec 2025 08:39:26 -0700 Subject: [PATCH 2/2] Accept timedelta hours as float or string representation of float (#835) --- src/uwtools/tests/utils/test_time.py | 3 +++ src/uwtools/utils/time.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/uwtools/tests/utils/test_time.py b/src/uwtools/tests/utils/test_time.py index d5315d5d6..d68c074eb 100644 --- a/src/uwtools/tests/utils/test_time.py +++ b/src/uwtools/tests/utils/test_time.py @@ -31,6 +31,9 @@ def test_utils_time_to_timedelta(): ("01:02:03", timedelta(hours=1, minutes=2, seconds=3)), ("168:00:00", timedelta(days=7)), (6, timedelta(hours=6)), + ("6", timedelta(hours=6)), + (6.25, timedelta(hours=6, minutes=15)), + ("6.25", timedelta(hours=6, minutes=15)), (timedelta(seconds=1), timedelta(seconds=1)), ]: assert time.to_timedelta(value=value) == expected # type: ignore[arg-type] diff --git a/src/uwtools/utils/time.py b/src/uwtools/utils/time.py index 3d243aa25..d76367936 100644 --- a/src/uwtools/utils/time.py +++ b/src/uwtools/utils/time.py @@ -22,8 +22,8 @@ def to_iso8601(value: str | datetime) -> str: def to_timedelta(value: int | str | timedelta) -> timedelta: if isinstance(value, timedelta): return value - if isinstance(value, int): + if isinstance(value, (float, int)): return timedelta(hours=value) keys = ["hours", "minutes", "seconds"] - args = dict(zip(keys, map(int, value.split(":")), strict=False)) + args = dict(zip(keys, map(float, value.split(":")), strict=False)) return timedelta(**args)