Skip to content

Commit

Permalink
Pvnet production (#207)
Browse files Browse the repository at this point in the history
* align delays closer to production delays

* increase min sat delay and more explicit sat dropout

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dfulu and pre-commit-ci[bot] authored Jun 8, 2023
1 parent 9d74c93 commit ace680a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ocf_datapipes/training/pvnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def construct_loctime_pipelines(
configuration=config,
key_for_t0="gsp",
shuffle=True,
nwp_max_t0_offset=minutes(90),
nwp_max_t0_offset=minutes(180),
)

return location_pipe, t0_datapipe
Expand Down Expand Up @@ -338,23 +338,22 @@ def slice_datapipes_by_time(
get_t0_datapipe = DatapipeKeyForker(fork_keys, t0_datapipe)

sat_and_hrv_dropout_kwargs = dict(
# In samples where dropout is applied, the first non-nan value could be 20 - 45 mins before
# time t0.
dropout_timedeltas=[minutes(m) for m in range(-45, -15, 5)],
dropout_frac=0 if production else 0.5,
# Satellite is either 30 minutes or 60 minutes delayed
dropout_timedeltas=[minutes(-60), minutes(-30)],
dropout_frac=0 if production else 1.0,
)

# Satellite data never more recent than t0-15mins
sat_delay = minutes(-15)
# Satellite data never more recent than t0-30mins
sat_delay = minutes(-30)

if "nwp" in datapipes_dict:
datapipes_dict["nwp"] = datapipes_dict["nwp"].convert_to_nwp_target_time_with_dropout(
t0_datapipe=get_t0_datapipe("nwp"),
sample_period_duration=minutes(60),
history_duration=minutes(conf_in.nwp.history_minutes),
forecast_duration=minutes(conf_in.nwp.forecast_minutes),
# The NWP forecast will always be at least 90 minutes stale
dropout_timedeltas=[minutes(-90)],
# The NWP forecast will always be at least 180 minutes stale
dropout_timedeltas=[minutes(-180)],
dropout_frac=0 if production else 1.0,
)

Expand Down

0 comments on commit ace680a

Please sign in to comment.