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/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: "Install dependencies"
run: |
conda install --yes pytest iris xarray filelock requests
conda install --yes "numpy<2" pytest iris xarray filelock requests

- name: "Install *latest* Iris"
run: |
Expand Down
1 change: 1 addition & 0 deletions requirements/readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:

dependencies:
- netCDF4>=1.4
- numpy <2.0
- iris
- xarray
- filelock
Expand Down
28 changes: 22 additions & 6 deletions tests/data_testcase_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ def data_types():
yield "string"


# Just confirm that the above list of types matches those used by netCDF4, except for
# 'string' replacing 'S1'.
assert set(data_types()) == (
set(nc.default_fillvals.keys()) - set(["S1"]) | set(["string"])
# Confirm that the above list of types matches those of netCDF4, with specific fixes
# Get the dtype list from the netCDF default fill-values.
_nc_dtypes = set(nc.default_fillvals.keys())
# Remove the numpy-only complex types
_nc_dtypes = set(
typename for typename in _nc_dtypes if np.dtype(typename).kind != "c"
)

# Also replace 'S1' with our own 'string' type marker
_nc_dtypes.remove("S1")
_nc_dtypes.add("string")
# This should match the list of dtypes which we support (and test against)
assert set(data_types()) == _nc_dtypes

# Suitable test values for each attribute/data type.
_INT_Approx_2x31 = int(2**31 - 1)
Expand Down Expand Up @@ -509,7 +515,17 @@ def standard_testcase(request, session_testdir):
},
"xarray": {
# We think Xarray can load ~anything (maybe returning nothing)
"load": [],
"load": [
# .. except a few specific bounds variables generate a peculiar error
# """
# xarray.core.variable.MissingDimensionsError: 'time_bnd' has more than
# 1-dimension and the same name as one of its dimensions
# ('time', 'time_bnd'). xarray disallows such variables because they
# conflict with the coordinates used to label dimensions.
# """
"small_rotPole_precipitation",
"small_FC_167",
],
# Xarray can save ~anything
"save": [r"test_monotonic_coordinate"],
},
Expand Down