From b95631b856d8ffa55af958fef77f7067bced75b7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 19:19:09 +0000 Subject: [PATCH 1/7] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/psf/black: 23.9.1 → 23.10.1](https://github.com/psf/black/compare/23.9.1...23.10.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.4) - [github.com/tox-dev/pyproject-fmt: 1.2.0 → 1.4.1](https://github.com/tox-dev/pyproject-fmt/compare/1.2.0...1.4.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 975d0530..503365f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace exclude: compliance_checker/tests/data @@ -19,7 +19,7 @@ repos: - test_requirements.txt - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.1 hooks: - id: black language_version: python3 @@ -31,12 +31,12 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.4 hooks: - id: ruff - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.2.0 + rev: 1.4.1 hooks: - id: pyproject-fmt From dc1d502c4ed5f1c1be544d56d1eb6eb4376de6a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:19:00 +0000 Subject: [PATCH 2/7] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.4...v0.1.6) - [github.com/tox-dev/pyproject-fmt: 1.4.1 → 1.5.3](https://github.com/tox-dev/pyproject-fmt/compare/1.4.1...1.5.3) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 503365f0..fb4b8f8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - test_requirements.txt - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black language_version: python3 @@ -31,12 +31,12 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.6 hooks: - id: ruff - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.4.1 + rev: 1.5.3 hooks: - id: pyproject-fmt From be23f224d85a32874479224c5d87ec46e59ef7ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 02:48:28 +0000 Subject: [PATCH 3/7] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d8904e80..e134f7c0 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -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" From 0d2981f2ffae1afc839616ae3ca17d18ffb14b4c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 19:13:21 +0000 Subject: [PATCH 4/7] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.11.0 → 23.12.1](https://github.com/psf/black/compare/23.11.0...23.12.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.1.9) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb4b8f8a..e65dfe3a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - test_requirements.txt - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 hooks: - id: black language_version: python3 @@ -31,7 +31,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.1.9 hooks: - id: ruff From 4e6e3d1997c599398da095562bba5dd7aaaeda7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 02:53:23 +0000 Subject: [PATCH 5/7] Bump codecov/codecov-action from 3 to 4 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ee836239..c32a9fb4 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -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 From ead0a4a242d76db25a02a4366c574bf754ade4da Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:17:04 +0000 Subject: [PATCH 6/7] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.2.0) - [github.com/tox-dev/pyproject-fmt: 1.5.3 → 1.7.0](https://github.com/tox-dev/pyproject-fmt/compare/1.5.3...1.7.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e65dfe3a..9e13b767 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - test_requirements.txt - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black language_version: python3 @@ -31,12 +31,12 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.0 hooks: - id: ruff - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.5.3 + rev: 1.7.0 hooks: - id: pyproject-fmt From 0b026903e794c05ab4474f1835a31f6adae7d973 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:17:18 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- compliance_checker/ioos.py | 35 +++++++++++++++++------------ compliance_checker/tests/test_cf.py | 10 ++++----- compliance_checker/util.py | 1 + 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/compliance_checker/ioos.py b/compliance_checker/ioos.py index 733b9e91..2deed991 100644 --- a/compliance_checker/ioos.py +++ b/compliance_checker/ioos.py @@ -1,6 +1,7 @@ """ Check for IOOS-approved attributes """ + import re from numbers import Number @@ -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): @@ -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"] + ), ), ) @@ -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", + ] + ), ), ) diff --git a/compliance_checker/tests/test_cf.py b/compliance_checker/tests/test_cf.py index 367ffc6d..360683be 100644 --- a/compliance_checker/tests/test_cf.py +++ b/compliance_checker/tests/test_cf.py @@ -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) @@ -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:", diff --git a/compliance_checker/util.py b/compliance_checker/util.py index 8117ad3e..6b03e98b 100644 --- a/compliance_checker/util.py +++ b/compliance_checker/util.py @@ -1,6 +1,7 @@ """ General purpose utility functions to aid in compliance checking tasks """ + from collections import OrderedDict import isodate