Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
8 changes: 3 additions & 5 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

- name: "Install dependencies"
run: |
conda install --yes numpy pytest pytest-mock iris xarray filelock requests zarr aiohttp fsspec
conda install --yes numpy pytest pytest-mock iris "xarray<2026.03" cftime filelock requests zarr aiohttp fsspec

- name: "Install repo-under-test"
run: |
Expand All @@ -90,11 +90,9 @@ jobs:
- name: "Run doctests: Docs"
if: matrix.session == 'doctests-docs'
run: |
cd docs
pytest --doctest-glob="*.rst" --doctest-continue-on-failure
tools/run_doctests.py -v "./docs/**/*.rst"

- name: "Run doctests: API"
if: matrix.session == 'doctests-api'
run: |
cd lib
pytest --doctest-modules --doctest-continue-on-failure
tools/run_doctests.py -v -mr ncdata
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ repos:
- id: no-commit-to-branch

- repo: https://github.com/codespell-project/codespell
rev: "v2.4.2"
rev: "v2.4.3"
hooks:
- id: codespell
types_or: [asciidoc, python, markdown, rst]
additional_dependencies: [tomli]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
rev: 26.5.1
hooks:
- id: black
pass_filenames: false
Expand All @@ -47,7 +47,7 @@ repos:
types: [file, python]

- repo: https://github.com/pycqa/isort
rev: 8.0.1
rev: 9.0.0b5
hooks:
- id: isort
name: isort (python)
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2

build:
os: ubuntu-24.04
os: ubuntu-26.04
tools:
python: mambaforge-4.10
python: miniforge3-26.3
jobs:
# Content here largely copied from Iris
# see : https://github.com/SciTools/iris/pull/4855
Expand Down
1 change: 1 addition & 0 deletions docs/changelog_fragments/173.dev.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix xarray 2025.09.1 problem.
1 change: 1 addition & 0 deletions docs/changelog_fragments/174.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document how to create a developer installation.
1 change: 1 addition & 0 deletions docs/changelog_fragments/175.dev.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pinned python for now, since 3.14 causes problems with Iris (notably).
2 changes: 1 addition & 1 deletion docs/userdocs/getting_started/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ and :attr:`~ncdata.NcData.attributes`:
>>> data
<ncdata._core.NcData object at ...>
>>> print(data)
<NcData: myname
<NcData: urrgh
>

>>> dim = NcDimension("x", 3)
Expand Down
2 changes: 1 addition & 1 deletion lib/ncdata/utils/_dim_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def index_by_dimensions(
>>> data = NcData(dimensions=[NcDimension(nn, 10) for nn in ("time", "levels")])

>>> data1 = index_by_dimensions(data, time=slice(0, 10)) # equivalent to [:10]
>>> data2 = index_by_dimensions(data, levels=[1,2,5])
>>> data2 = index_by_dimension(data, levels=[1,2,5])
>>> data3 = index_by_dimensions(data, time=3, levels=slice(2, 10, 3))

Notes
Expand Down
2 changes: 2 additions & 0 deletions tests/data_testcase_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ def standard_testcase(request, session_testdir):
# """
"small_rotPole_precipitation",
"small_FC_167",
# And this one, which has recently acquired a problem?
"test_monotonic_coordinate",
],
# Xarray can save ~anything
"save": [r"test_monotonic_coordinate"],
Expand Down
29 changes: 29 additions & 0 deletions tools/check_doctest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from doctest import ELLIPSIS as ELLIPSIS_FLAG
from run_doctests import run_doctest_paths, _parser, parserargs_as_kwargs

# tstargs = ['ncdata', '-da', '--options', 'verbose=1']

# tstargs = [
# "/home/users/patrick.peglar/git/ncdata/docs/userdocs/user_guide/howtos.rst",
# "--options",
# "verbose=1",
# ]

# tstargs = ["-mvr", "iris.coords", "-o", "verbose=True"]

# tstargs = ["-mvr", "iris.tests.unit.fileformats.netcdf", "-e", "attribute_handlers"]

tstargs = ["-mvr", "iris._combine", "-o", "raise_on_error=True"]

tstargs = ["-r", "../docs/userdocs/**/*.rst", "-e", "started.rst"]

args = _parser.parse_args(tstargs)
kwargs = parserargs_as_kwargs(args)
# if not "options" in kwargs:
# kwargs["options"] = "ELLIPSIS=1"
run_doctest_paths(**kwargs)

#
# Currently good:
# $ tools/run_doctests.py docs/userdocs/getting_started/introduction.rst -o "optionflags=8"
# $ tools/run_doctests.py docs/userdocs/getting_started/*.rst -vo "optionflags=8"
Loading
Loading