numpydantic/tests/test_interface/conftest.py

34 lines
827 B
Python
Raw Normal View History

2024-04-09 01:36:47 +00:00
import pytest
import numpy as np
import dask.array as da
2024-04-30 02:49:38 +00:00
import zarr
2024-04-09 01:36:47 +00:00
from numpydantic import interface
2024-04-30 02:49:38 +00:00
from tests.fixtures import hdf5_array, zarr_nested_array, zarr_array
2024-04-09 01:36:47 +00:00
@pytest.fixture(
scope="function",
params=[
([[1, 2], [3, 4]], interface.NumpyInterface),
(np.zeros((3, 4)), interface.NumpyInterface),
(hdf5_array, interface.H5Interface),
2024-04-09 01:36:47 +00:00
(da.random.random((10, 10)), interface.DaskInterface),
2024-04-30 02:49:38 +00:00
(zarr.ones((10, 10)), interface.ZarrInterface),
(zarr_nested_array, interface.ZarrInterface),
(zarr_array, interface.ZarrInterface),
],
ids=[
"numpy_list",
"numpy",
"H5ArrayPath",
"dask",
"zarr_memory",
"zarr_nested",
"zarr_array",
2024-04-09 01:36:47 +00:00
],
)
def interface_type(request):
return request.param