From 1bd7b2dd536e8c9249e4d90170bb37ead42d9d79 Mon Sep 17 00:00:00 2001 From: ppinchuk Date: Tue, 17 Oct 2023 12:13:54 -0600 Subject: [PATCH 1/6] Add tests for python 3.11 and 3.12 --- .github/workflows/pull_request_tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_tests.yml b/.github/workflows/pull_request_tests.yml index 1b8e165e..e9d6b158 100644 --- a/.github/workflows/pull_request_tests.yml +++ b/.github/workflows/pull_request_tests.yml @@ -9,8 +9,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.10'] + python-version: [3.12] include: + - os: ubuntu-latest + python-version: 3.11 + - os: ubuntu-latest + python-version: '3.10' - os: ubuntu-latest python-version: 3.9 - os: ubuntu-latest From 8fffb98a5623d45feb4f4a81e2cf039d22aa8a5b Mon Sep 17 00:00:00 2001 From: ppinchuk Date: Thu, 2 Nov 2023 13:23:47 -0600 Subject: [PATCH 2/6] Fix updated format function in new python versions --- gaps/utilities.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gaps/utilities.py b/gaps/utilities.py index 9e83f5ae..baeb754e 100644 --- a/gaps/utilities.py +++ b/gaps/utilities.py @@ -26,6 +26,9 @@ def __new__(cls, value): obj = cls._new_post_hook(obj, value) return obj + def __format__(self, format_spec): + return str.__format__(self._value_, format_spec) + # pylint: disable=inconsistent-return-statements @classmethod def _missing_(cls, value): From 11c5b3655352be5e60dd293732fb0e8b5b63bbf5 Mon Sep 17 00:00:00 2001 From: ppinchuk Date: Thu, 2 Nov 2023 13:30:33 -0600 Subject: [PATCH 3/6] Add standby option --- gaps/status.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gaps/status.py b/gaps/status.py index 3d5d8f2e..90f7021a 100644 --- a/gaps/status.py +++ b/gaps/status.py @@ -149,16 +149,15 @@ class QOSOption(CaseInsensitiveEnum): """Normal QOS.""" HIGH = "high" """High QOS.""" + STANDBY = "standby" + """Standby QOS.""" UNSPECIFIED = "unspecified" """Unspecified QOS.""" @classmethod def _new_post_hook(cls, obj, value): """Hook for post-processing after __new__""" - if value in {"high"}: - obj.charge_factor = 2 - else: - obj.charge_factor = 1 + obj.charge_factor = 2 if value in {"high"} else 1 return obj From cb407017ff6bd8a28b657fad42a45bd806830fe9 Mon Sep 17 00:00:00 2001 From: ppinchuk Date: Thu, 2 Nov 2023 13:38:26 -0600 Subject: [PATCH 4/6] More informative error message --- gaps/hpc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gaps/hpc.py b/gaps/hpc.py index 63d636ea..868b89f5 100644 --- a/gaps/hpc.py +++ b/gaps/hpc.py @@ -600,10 +600,16 @@ def _subprocess_popen(cmd): stdout = stdout.decode("ascii").rstrip() if process.returncode != 0: - raise OSError( + msg = ( f"Subprocess submission failed with return code " f"{process.returncode} and stderr:\n{stderr}" ) + if "Invalid qos specification" in stderr: + msg = ( + f"{msg}\n(This error typically occurs if your allocation " + "runs out of AUs)" + ) + raise OSError(msg) return stdout, stderr From 97397e361609cc9593cd28d6e82c8d76cdc55e09 Mon Sep 17 00:00:00 2001 From: ppinchuk Date: Thu, 2 Nov 2023 13:39:37 -0600 Subject: [PATCH 5/6] Add Python 3.11 and 3.12 --- setup.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 0b6cbe19..79e29c20 100644 --- a/setup.py +++ b/setup.py @@ -20,12 +20,7 @@ DEV_REQUIREMENTS = ["black", "pylint", "jupyter", "pipreqs"] TEST_REQUIREMENTS = ["pytest", "pytest-cov", "h5py"] -DOC_REQUIREMENTS = [ - "make", - "ghp-import", - "numpydoc", - "pandoc" -] +DOC_REQUIREMENTS = ["make", "ghp-import", "numpydoc", "pandoc"] DESCRIPTION = ( "National Renewable Energy Laboratory's (NREL's) Geospatial Analysis " "Pipelines (GAPs) framework" @@ -53,6 +48,8 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Libraries :: Application Frameworks", ], test_suite="tests", From 2ea93a82e3079efc72d2191fd44089bd7e0402e9 Mon Sep 17 00:00:00 2001 From: ppinchuk Date: Thu, 2 Nov 2023 13:39:48 -0600 Subject: [PATCH 6/6] Bump version --- gaps/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gaps/version.py b/gaps/version.py index b36f437d..38022799 100644 --- a/gaps/version.py +++ b/gaps/version.py @@ -1,3 +1,3 @@ """GAPs Version Number. """ -__version__ = "0.6.1" +__version__ = "0.6.2"