Skip to content

Commit

Permalink
fix(tests): REmove sharding test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Mar 11, 2025
1 parent a603c4e commit d9258ac
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions src/satellite_consumer/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())



0 comments on commit d9258ac

Please sign in to comment.