Skip to content

Commit

Permalink
Clean up and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhil Patel authored and Sukhil Patel committed Oct 4, 2024
1 parent 710a2d9 commit 93f54e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/backtest_sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@
# When sun as elevation below this, the forecast is set to zero
MIN_DAY_ELEVATION = 0

# All pv system ids to produce forecasts for, need to be added in ascending order
# Add all pv site ids here that you wish to produce forecasts for
ALL_SITE_IDS = []
# Need to be in ascending order
ALL_SITE_IDS.sort()

# ------------------------------------------------------------------
# FUNCTIONS
Expand Down Expand Up @@ -251,7 +253,8 @@ def get_loctimes_datapipes(config_path):
unbatch_level=1
) # might not need this part since the site datapipe is creating examples

# Create times datapipe so each worker receives len(ALL_SITE_IDS) copies of the same datetime for its batch
# Create times datapipe so each worker receives
# len(ALL_SITE_IDS) copies of the same datetime for its batch
t0_datapipe = IterableWrapper(
[[t0 for site_id in ALL_SITE_IDS] for t0 in available_target_times]
)
Expand Down Expand Up @@ -301,7 +304,7 @@ def predict_batch(self, batch: NumpyBatch) -> xr.Dataset:
)

# Get effective capacities for this forecast
site_capacities = ds_site.nominal_capacity_wp.values
site_capacities = self.ds_site.nominal_capacity_wp.values
# Get the solar elevations. We need to un-normalise these from the values in the batch
elevation = batch[BatchKey.pv_solar_elevation] * ELEVATION_STD + ELEVATION_MEAN
# We only need elevation mask for forecasted values, not history
Expand Down

0 comments on commit 93f54e9

Please sign in to comment.