Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 14 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion modelmimic/__init__.py
Original file line number Diff line number Diff line change
@@ -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"""
|-------------------------------------------------|
Expand Down
12 changes: 5 additions & 7 deletions modelmimic/mimic.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -468,7 +467,6 @@ def main(args):

out_dirs[_testname] = {}
for case in _test["ensembles"]:

mimic_case = MimicModelRun(
_test[case]["name"],
size=_test["size"],
Expand Down
3 changes: 1 addition & 2 deletions modelmimic/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Utility methods for ModelMimic.
"""
"""Utility methods for ModelMimic."""

from pathlib import Path

Expand Down
1 change: 0 additions & 1 deletion tests/test_numerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down