Skip to content

Commit 5f3cae7

Browse files
author
Matic Lubej
committed
make test a bit more pretty
1 parent cd96dc0 commit 5f3cae7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/mask/test_snow_mask.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ def test_snow_coverage(task, result, test_eopatch):
3636

3737

3838
def test_snow_empty_eopatch(test_eopatch):
39-
bands = test_eopatch.data["BANDS-S2-L1C"]
40-
empty_bands_array = np.array([], dtype=bands.dtype).reshape((0, *bands.shape[1:]))
41-
empty_eopatch = EOPatch(bbox=test_eopatch.bbox, timestamps=[], data={"BANDS-S2-L1C": empty_bands_array})
39+
_, h, w, c = test_eopatch.data["BANDS-S2-L1C"].shape
40+
empty_eopatch = EOPatch(bbox=test_eopatch.bbox, timestamps=[])
41+
empty_eopatch.data["BANDS-S2-L1C"] = np.array([], dtype=np.float32).reshape((0, h, w, c))
42+
4243
task = SnowMaskTask((FeatureType.DATA, "BANDS-S2-L1C"), [2, 3, 7, 11], mask_name="TEST_SNOW_MASK")
4344
resulting_eopatch = task(empty_eopatch) # checks if the task runs without errors
44-
assert resulting_eopatch.mask["TEST_SNOW_MASK"].shape == (*empty_bands_array.shape[:-1], 1)
45+
assert resulting_eopatch.mask["TEST_SNOW_MASK"].shape == (0, h, w, 1)

0 commit comments

Comments
 (0)