Skip to content

Commit

Permalink
Merge branch 'develop' into remove_pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf authored Apr 3, 2024
2 parents b941744 + 303d136 commit 9f99a53
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:
continue-on-error: true

- name: Upload to codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: coverage.xml
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- test_requirements.txt

- repo: https://github.com/psf/black
rev: 23.10.0
rev: 24.1.1
hooks:
- id: black
language_version: python3
Expand All @@ -29,13 +29,13 @@ repos:
hooks:
- id: add-trailing-comma

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
hooks:
- id: ruff

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.2.0
rev: 1.7.0
hooks:
- id: pyproject-fmt

Expand Down
35 changes: 21 additions & 14 deletions compliance_checker/ioos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Check for IOOS-approved attributes
"""

import re
from numbers import Number

Expand Down Expand Up @@ -1543,12 +1544,14 @@ def check_gts_ingest_requirements(self, ds):
BaseCheck.HIGH,
False, # always fail
"NDBC/GTS Ingest Requirements",
[var_passed_ingest_msg.format(", ".join(_var_passed))]
if all_passed_ingest_reqs
else [
var_passed_ingest_msg.format(", ".join(_var_passed)),
var_failed_ingest_msg.format(", ".join(_var_failed)),
],
(
[var_passed_ingest_msg.format(", ".join(_var_passed))]
if all_passed_ingest_reqs
else [
var_passed_ingest_msg.format(", ".join(_var_passed)),
var_failed_ingest_msg.format(", ".join(_var_failed)),
]
),
)

def check_instrument_variables(self, ds):
Expand Down Expand Up @@ -1764,9 +1767,11 @@ def check_instrument_make_model_calib_date(self, ds):
BaseCheck.MEDIUM,
valid,
"instrument_variable:make_model",
None
if valid
else [f"Attribute {v}:make_model ({mm}) should be a string"],
(
None
if valid
else [f"Attribute {v}:make_model ({mm}) should be a string"]
),
),
)

Expand All @@ -1784,11 +1789,13 @@ def check_instrument_make_model_calib_date(self, ds):
BaseCheck.MEDIUM,
valid,
"instrument_variable:calibration_date",
None
if valid
else [
f"Attribute {v}:calibration_date ({cd}) should be an ISO-8601 string",
],
(
None
if valid
else [
f"Attribute {v}:calibration_date ({cd}) should be an ISO-8601 string",
]
),
),
)

Expand Down
10 changes: 4 additions & 6 deletions compliance_checker/tests/test_cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,9 +1300,7 @@ def test_check_time_coordinate(self):
# NB: >= 60 seconds is nonstandard, but isn't actually a CF requirement
# until CF 1.9 onwards
dataset.variables["time"].units = "months since 0-1-1 23:00:60"
dataset.variables[
"time"
].climatology = (
dataset.variables["time"].climatology = (
"nonexistent_variable_reference_only_used_to_test_year_zero_failure"
)
results = self.cf.check_time_coordinate(dataset)
Expand Down Expand Up @@ -2952,9 +2950,9 @@ def test_bad_lsid(self):
messages = results[0].msgs
assert results[0].value[0] < results[0].value[1]
assert len(messages) == 1
taxon_lsid[
0
] = "http://www.lsid.info/urn:lsid:marinespecies.org:taxname:99999999999"
taxon_lsid[0] = (
"http://www.lsid.info/urn:lsid:marinespecies.org:taxname:99999999999"
)
results = self.cf.check_taxa(dataset)
assert messages[0].startswith(
"Taxon id must match one of the following forms:",
Expand Down
1 change: 1 addition & 0 deletions compliance_checker/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
General purpose utility functions to aid in compliance checking tasks
"""

from collections import OrderedDict

import isodate
Expand Down

0 comments on commit 9f99a53

Please sign in to comment.