Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test fixtures #454

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
strategy:
matrix:
python-version: ["3.11", "3.12"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/min-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
strategy:
matrix:
python-version: ["3.12"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
strategy:
matrix:
python-version: ["3.12"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand Down
18 changes: 11 additions & 7 deletions virtualizarr/tests/test_readers/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,22 @@ def scalar_fill_value_hdf5_file(tmpdir):
compound_fill = (-9999, -9999.0)

fill_values = [
{"fill_value": -9999, "data": np.random.randint(0, 10, size=(5))},
{"fill_value": -9999.0, "data": np.random.random(5)},
{"fill_value": np.nan, "data": np.random.random(5)},
{"fill_value": False, "data": np.array([True, False, False, True, True])},
{"fill_value": "NaN", "data": np.array(["three"], dtype="S10")},
{"fill_value": compound_fill, "data": compound_data},
{"label": "int", "fill_value": -9999, "data": np.random.randint(0, 10, size=(5))},
{"label": "float", "fill_value": -9999.0, "data": np.random.random(5)},
{"label": "npNan", "fill_value": np.nan, "data": np.random.random(5)},
{
"label": "False",
"fill_value": False,
"data": np.array([True, False, False, True, True]),
},
{"label": "NaN", "fill_value": "NaN", "data": np.array(["three"], dtype="S10")},
{"label": "compound", "fill_value": compound_fill, "data": compound_data},
]


@pytest.fixture(params=fill_values)
def cf_fill_value_hdf5_file(tmpdir, request):
filepath = f"{tmpdir}/cf_fill_value.nc"
filepath = f"{tmpdir}/cf_fill_value_{request.param['label']}.nc"
f = h5py.File(filepath, "w")
dset = f.create_dataset(name="data", data=request.param["data"], chunks=True)
dim_scale = f.create_dataset(
Expand Down
4 changes: 2 additions & 2 deletions virtualizarr/tests/test_readers/test_kerchunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_open_virtual_dataset_existing_kerchunk_refs(
# Test valid json and parquet reference formats

if reference_format == "json":
ref_filepath = tmp_path / "ref.json"
ref_filepath = tmp_path / "ref1.json"

import ujson

Expand Down Expand Up @@ -237,7 +237,7 @@ def test_notimplemented_read_inline_refs(tmp_path, netcdf4_inlined_ref):
# For now, we raise a NotImplementedError if we read existing references that have inlined data
# https://github.com/zarr-developers/VirtualiZarr/pull/251#pullrequestreview-2361916932

ref_filepath = tmp_path / "ref.json"
ref_filepath = tmp_path / "ref2.json"

import ujson

Expand Down
Loading