Skip to content

Commit

Permalink
add comments to pvnet tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Aug 13, 2024
1 parent ae3a57a commit 3ed14c0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/dataset/test_pvnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def test_pvnet(pvnet_config_filename):
# Create dataset object
dataset = PVNetDataset(pvnet_config_filename)

assert len(dataset.locations) == 317
assert len(dataset.valid_t0_times) == 39 # NB. I have not checked this value is in fact correct
assert len(dataset.locations) == 317 # no of GSPs not including the National level
# NB. I have not checked this value is in fact correct, but it does seem to stay constant
assert len(dataset.valid_t0_times) == 39
assert len(dataset) == 317*39

# Generate a sample
Expand All @@ -39,9 +40,13 @@ def test_pvnet(pvnet_config_filename):

for nwp_source in ["ukv"]:
assert nwp_source in sample[BatchKey.nwp]


# check the shape of the data is correct
# 30 minutes of 5 minute data (inclusive), one channel, 2x2 pixels
assert sample[BatchKey.satellite_actual].shape == (7, 1, 2, 2)
# 3 hours of 60 minute data (inclusive), one channel, 2x2 pixels
assert sample[BatchKey.nwp]["ukv"][NWPBatchKey.nwp].shape == (4, 1, 2, 2)
# 3 hours of 30 minute data (inclusive)
assert sample[BatchKey.gsp].shape == (7,)


Expand Down

0 comments on commit 3ed14c0

Please sign in to comment.