diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4a02a37..0bfac7a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -20,7 +20,7 @@ jobs: - name: Set up python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.14 - name: Runs pre-commit run: | pip install pre-commit diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9d53303..c6d4444 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3798bcf..528d937 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,24 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - id: check-toml - - repo: https://github.com/psf/black - rev: 22.3.0 - hooks: - - id: black - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort + - id: check-yaml + args: [--unsafe] + - id: debug-statements + - id: destroyed-symlinks + - id: detect-private-key - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.3.7 + rev: v0.13.0 hooks: # Run the linter. - - id: ruff + - id: ruff-check + # Run the formatter. + - id: ruff-format + - repo: https://github.com/pycqa/isort + rev: 6.0.1 + hooks: + - id: isort diff --git a/modelmimic/__init__.py b/modelmimic/__init__.py index ff3fbcc..4e52109 100644 --- a/modelmimic/__init__.py +++ b/modelmimic/__init__.py @@ -1,4 +1,4 @@ -__version_info__ = (0, 0, 2) +__version_info__ = (0, 1, 0) __version__ = ".".join(str(_vi) for _vi in __version_info__) logo = r""" |-------------------------------------------------| diff --git a/modelmimic/mimic.py b/modelmimic/mimic.py index b57d370..7a49dd7 100644 --- a/modelmimic/mimic.py +++ b/modelmimic/mimic.py @@ -1,5 +1,4 @@ -"""Generate model-like data for testing EVV, _mimic_ the output of various CIME tests. -""" +"""Generate model-like data for testing EVV, _mimic_ the output of various CIME tests.""" import argparse from pathlib import Path @@ -230,9 +229,9 @@ def __init__( self.size = size self.ninst = ninst self.dims = dims - assert len(self.dims) == len( - self.size - ), f"Number of dims ({len(self.size)}) must match dim names ({len(self.dims)})" + assert len(self.dims) == len(self.size), ( + f"Number of dims ({len(self.size)}) must match dim names ({len(self.dims)})" + ) self.base_data = {} for _varix, _var in enumerate(self.vars): @@ -415,7 +414,7 @@ def write_to_nc( attrs={**ds_attrs, "inst": iinst}, ) except ValueError: - breakpoint() + raise ens_xarray[iinst] = _dset if casename: _filename = f"{self.name}.{_outfile_name}.{extn}" @@ -468,7 +467,6 @@ def main(args): out_dirs[_testname] = {} for case in _test["ensembles"]: - mimic_case = MimicModelRun( _test[case]["name"], size=_test["size"], diff --git a/modelmimic/utils.py b/modelmimic/utils.py index afbcbc5..e28209f 100644 --- a/modelmimic/utils.py +++ b/modelmimic/utils.py @@ -1,5 +1,4 @@ -"""Utility methods for ModelMimic. -""" +"""Utility methods for ModelMimic.""" from pathlib import Path diff --git a/tests/test_numerics.py b/tests/test_numerics.py index 3592795..2dcdb36 100644 --- a/tests/test_numerics.py +++ b/tests/test_numerics.py @@ -71,7 +71,6 @@ def test_mimic_run(): def test_bcast(): - # Test for auto-detect axis for: # - each axis having a different size # - two axes matching