-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d280ee6
commit 236b602
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from datetime import datetime | ||
|
||
from ocf_datapipes.training.windnet import ( | ||
windnet_datapipe, | ||
windnet_netcdf_datapipe, | ||
) | ||
from ocf_datapipes.utils.utils import combine_to_single_dataset, uncombine_from_single_dataset | ||
import pytest | ||
|
||
|
||
def test_windnet_datapipe(configuration_filename): | ||
start_time = datetime(1900, 1, 1) | ||
end_time = datetime(2050, 1, 1) | ||
dp = windnet_datapipe( | ||
configuration_filename, | ||
start_time=start_time, | ||
end_time=end_time, | ||
) | ||
datasets = next(iter(dp)) | ||
dataset = combine_to_single_dataset(datasets) | ||
# Need to serialize attributes to strings | ||
dataset.to_netcdf("test.nc", mode="w", engine="h5netcdf", compute=True) | ||
dp = windnet_netcdf_datapipe( | ||
config_filename=configuration_filename, | ||
filenames=["test.nc"], | ||
keys=["gsp", "nwp", "sat", "pv"], | ||
) | ||
datasets = next(iter(dp)) |