Skip to content

Commit 3602cc7

Browse files
authored
Merge pull request #178 from openclimatefix/jacob/sensors-galore
Add sensor future minutes for using Meteomatics
2 parents b5fdce6 + 949e6f7 commit 3602cc7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pvnet/models/multimodal/multimodal.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def __init__(
5757
pv_history_minutes: Optional[int] = None,
5858
wind_history_minutes: Optional[int] = None,
5959
sensor_history_minutes: Optional[int] = None,
60+
sensor_forecast_minutes: Optional[int] = None,
6061
optimizer: AbstractOptimizer = pvnet.optimizers.Adam(),
6162
target_key: str = "gsp",
6263
interval_minutes: int = 30,
@@ -121,6 +122,7 @@ def __init__(
121122
addition to the full forecast
122123
sensor_encoder: Encoder for sensor data
123124
sensor_history_minutes: Length of recent sensor data used as input.
125+
sensor_forecast_minutes: Length of forecast sensor data used as input.
124126
adapt_batches: If set to true, we attempt to slice the batches to the expected shape for
125127
the model to use. This allows us to overprepare batches and slice from them for the
126128
data we need for a model run.
@@ -240,9 +242,13 @@ def __init__(
240242
if self.include_sensor:
241243
if sensor_history_minutes is None:
242244
sensor_history_minutes = history_minutes
245+
if sensor_forecast_minutes is None:
246+
sensor_forecast_minutes = forecast_minutes
243247

244248
self.sensor_encoder = sensor_encoder(
245-
sequence_length=sensor_history_minutes // sensor_interval_minutes + 1,
249+
sequence_length=sensor_history_minutes // sensor_interval_minutes
250+
+ sensor_forecast_minutes // sensor_interval_minutes
251+
+ 1,
246252
target_key_to_use=self._target_key_name,
247253
input_key_to_use="sensor",
248254
)

0 commit comments

Comments
 (0)