From d9258acbb384f786bfccd586065c1e347cd11ab3 Mon Sep 17 00:00:00 2001 From: devsjc <47188100+devsjc@users.noreply.github.com> Date: Tue, 11 Mar 2025 16:15:53 +0000 Subject: [PATCH] fix(tests): REmove sharding test for now --- src/satellite_consumer/test_storage.py | 61 -------------------------- 1 file changed, 61 deletions(-) diff --git a/src/satellite_consumer/test_storage.py b/src/satellite_consumer/test_storage.py index 01435ac..d79f8a0 100644 --- a/src/satellite_consumer/test_storage.py +++ b/src/satellite_consumer/test_storage.py @@ -137,64 +137,3 @@ class TestContainer(TypedDict): store_da = xr.open_dataarray(test["dst"], engine="zarr", consolidated=False) self.assertTrue((store_da.isel(time=0).values == 1.0).all()) - @unittest.skip("Not yet done") - def test_chunk_shard_speed(self) -> None: - """Tests that a specific chunking and sharding configuration is faster than another.""" - - class TestContainer(TypedDict): - name: str - dst: str - - - testCoords = Coordinates( - time=[np.datetime64(f"2021-01-01T0{h}:00", "ns") for h in range(14)], - y_geostationary=list(range(3712)), - x_geostationary=list(range(3712)), - variable=[f"var{n}" for n in range(11)], - ) - - with mocks3() as s3dir, tempfile.TemporaryDirectory(suffix="zarr") as tmpdir: - - tests: list[TestContainer] = [ - {"name": "test_local", "dst": tmpdir + "/test.zarr"}, - {"name": "test_s3", "dst": s3dir + "test.zarr"}, - ] - - group: zarr.Group = zarr.create_group(dst, overwrite=True) - time_zarray: zarr.Array = group.create_array( - name="time", dimension_names=["time"], - shape=(len(testCoords.time),), dtype="int", attributes={ - "units": "nanoseconds since 1970-01-01", "calendar": "proleptic_gregorian", - }, - ) - time_zarray[:] = testCoords.time - x_geo_zarray = group.create_array( - name="x_geostationary", dimension_names=["x_geostationary"], - shape=(len(testCoords.x_geostationary),), dtype="float", attributes={ - "coordinate_reference_system": "geostationary", - }, - ) - x_geo_zarray[:] = testCoords.x_geostationary - y_geo_zarray = group.create_array( - name="y_geostationary", dimension_names=["y_geostationary"], - shape=(len(testCoords.y_geostationary),), dtype="float", attributes={ - "coordinate_reference_system": "geostationary", - }, - ) - y_geo_zarray[:] = testCoords.y_geostationary - var_zarray = group.create_array( - name="variable", dimension_names=["variable"], - shape=(len(testCoords.variable),), dtype="str", - ) - var_zarray[:] = testCoords.variable - - data_zarray = group.create_array( - name="data", dimension_names=testCoords.dims(), dtype="float", - shape=testCoords.shape(), chunks=testCoords.chunks(), - shards=testCoords.shards(), - fill_value=np.nan, config={"write_empty_chunks": False}, - ) - data_zarray[:] = np.random.rand(*testCoords.shape()) - - -