Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 28, 2022
1 parent cb9ac4a commit 9367294
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions ocf_datapipes/training/metnet_gsp_national.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ def metnet_national_datapipe(
modalities = []
if gsp_in_image and "hrv" in used_datapipes.keys():
sat_hrv_datapipe, sat_gsp_datapipe = sat_hrv_datapipe.fork(2)
gsp_history = gsp_history.drop_gsp(gsps_to_keep=[0])\
.create_gsp_image(image_datapipe=sat_gsp_datapipe)
gsp_history = gsp_history.drop_gsp(gsps_to_keep=[0]).create_gsp_image(
image_datapipe=sat_gsp_datapipe
)
elif gsp_in_image and "sat" in used_datapipes.keys():
sat_datapipe, sat_gsp_datapipe = sat_datapipe.fork(2)
gsp_history = gsp_history.drop_gsp(gsps_to_keep=[0])\
.create_gsp_image(image_datapipe=sat_gsp_datapipe)
gsp_history = gsp_history.drop_gsp(gsps_to_keep=[0]).create_gsp_image(
image_datapipe=sat_gsp_datapipe
)
if "nwp" in used_datapipes.keys():
modalities.append(nwp_datapipe)
if "hrv" in used_datapipes.keys():
Expand Down
5 changes: 4 additions & 1 deletion tests/training/test_metnet_gsp_national.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ def test_metnet_datapipe():
if i + 1 % 50000 == 0:
break


def test_metnet_gsp_image_datapipe():
filename = os.path.join(os.path.dirname(ocf_datapipes.__file__), "../tests/config/test.yaml")
gsp_datapipe = metnet_national_datapipe(filename, use_pv=False, gsp_in_image=True, output_size=128)
gsp_datapipe = metnet_national_datapipe(
filename, use_pv=False, gsp_in_image=True, output_size=128
)
dataloader = iter(gsp_datapipe)
batch = next(dataloader)
x, y = batch
Expand Down

0 comments on commit 9367294

Please sign in to comment.