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 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 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 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): 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" 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",