Skip to content
Open
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
6 changes: 2 additions & 4 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
3 changes: 2 additions & 1 deletion lib/ncdata/utils/_dim_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import dask.array as da
import numpy as np

from ncdata import NcData


Expand Down Expand Up @@ -34,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
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