Skip to content

Commit a75ee76

Browse files
Sukhil PatelSukhil Patel
Sukhil Patel
authored and
Sukhil Patel
committed
Remove datapipe tests
1 parent 0c5a97b commit a75ee76

File tree

1 file changed

+2
-57
lines changed

1 file changed

+2
-57
lines changed

tests/data/test_datamodule.py

+2-57
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import pytest
21
from pvnet.data.datamodule import DataModule
3-
from pvnet.data.wind_datamodule import WindDataModule
4-
from pvnet.data.pv_site_datamodule import PVSiteDataModule
5-
import os
6-
from ocf_datapipes.batch.batches import BatchKey, NWPBatchKey
72

83

94
def test_init():
@@ -17,58 +12,6 @@ def test_init():
1712
val_period=[None, None],
1813
)
1914

20-
21-
@pytest.mark.skip(reason="Has not been updated for ocf-data-sampler yet")
22-
def test_wind_init():
23-
dm = WindDataModule(
24-
configuration=None,
25-
batch_size=2,
26-
num_workers=0,
27-
prefetch_factor=None,
28-
train_period=[None, None],
29-
val_period=[None, None],
30-
test_period=[None, None],
31-
batch_dir="tests/data/sample_batches",
32-
)
33-
34-
35-
@pytest.mark.skip(reason="Has not been updated for ocf-data-sampler yet")
36-
def test_wind_init_with_nwp_filter():
37-
dm = WindDataModule(
38-
configuration=None,
39-
batch_size=2,
40-
num_workers=0,
41-
prefetch_factor=None,
42-
train_period=[None, None],
43-
val_period=[None, None],
44-
test_period=[None, None],
45-
batch_dir="tests/test_data/sample_wind_batches",
46-
nwp_channels={"ecmwf": ["t2m", "v200"]},
47-
)
48-
dataloader = iter(dm.train_dataloader())
49-
50-
batch = next(dataloader)
51-
batch_channels = batch[BatchKey.nwp]["ecmwf"][NWPBatchKey.nwp_channel_names]
52-
print(batch_channels)
53-
for v in ["t2m", "v200"]:
54-
assert v in batch_channels
55-
assert batch[BatchKey.nwp]["ecmwf"][NWPBatchKey.nwp].shape[2] == 2
56-
57-
58-
@pytest.mark.skip(reason="Has not been updated for ocf-data-sampler yet")
59-
def test_pv_site_init():
60-
dm = PVSiteDataModule(
61-
configuration=f"{os.path.dirname(os.path.abspath(__file__))}/test_data/sample_batches/data_configuration.yaml",
62-
batch_size=2,
63-
num_workers=0,
64-
prefetch_factor=None,
65-
train_period=[None, None],
66-
val_period=[None, None],
67-
test_period=[None, None],
68-
batch_dir=None,
69-
)
70-
71-
7215
def test_iter():
7316
dm = DataModule(
7417
configuration=None,
@@ -104,3 +47,5 @@ def test_iter_multiprocessing():
10447

10548
# Make sure we've served 2 batches
10649
assert served_batches == 2
50+
51+
# TODO add test cases with some netcdfs premade samples

0 commit comments

Comments
 (0)