Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit support for python 3.11 and 3.12 #31

Merged
merged 6 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/pull_request_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion gaps/hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions gaps/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 3 additions & 0 deletions gaps/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion gaps/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""GAPs Version Number. """

__version__ = "0.6.1"
__version__ = "0.6.2"
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
Loading