Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 169a7f7

Browse files
Merge pull request #654 from openclimatefix/fake-optical-flow
option to not make optical flow when making fake batch
2 parents 638bfe8 + d5a8856 commit 169a7f7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

nowcasting_dataset/data_sources/fake/batch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ def optical_flow_fake(
396396
configuration = Configuration()
397397
configuration.input_data = Configuration().input_data.set_all_to_defaults()
398398

399+
if configuration.input_data.opticalflow is None:
400+
return None
401+
399402
batch_size = configuration.process.batch_size
400403
image_size_pixels_height = (
401404
configuration.input_data.opticalflow.opticalflow_input_image_size_pixels_height

tests/data_sources/fake/test_fake.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ def test_metadata_fake_gsp():
3737
assert m.y_centers_osgb[0] in metadata["location_y"].values
3838

3939

40+
def test_model_no_opticalflow(configuration): # noqa: D103
41+
42+
configuration.input_data.opticalflow = None
43+
44+
_ = Batch.fake(configuration=configuration)
45+
46+
4047
def test_model(configuration): # noqa: D103
4148

4249
assert configuration.input_data.opticalflow is not None

0 commit comments

Comments
 (0)