Skip to content

Commit

Permalink
More logging (#26)
Browse files Browse the repository at this point in the history
* add max prediction for each batch

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

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

* add max of each column after normalized

* change debug to info

* add loggin of gsp capacities

* fix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
peterdudfield and pre-commit-ci[bot] authored Jun 8, 2023
1 parent 08244d6 commit 5de4285
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pvnet/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def app(t0=None, apply_adjuster=True, gsp_ids=gsp_ids, write_predictions=True):
preds = model(device_batch).detach().cpu().numpy()

# Calculate unnormalised elevation and sun-dowm mask
logger.info("Remove predictions after sundown")
logger.info("Zeroing predictions after sundown")
elevation = batch[BatchKey.gsp_solar_elevation] * ELEVATION_STD + ELEVATION_MEAN
# We only need elevation mask for forecasted values, not history
elevation = elevation[:, -preds.shape[-1] :]
Expand Down Expand Up @@ -288,9 +288,9 @@ def app(t0=None, apply_adjuster=True, gsp_ids=gsp_ids, write_predictions=True):
),
)
# Multiply normalised forecasts by capacities and clip negatives
logger.info(f"Converting to absolute MW using {gsp_capacities}")
df_abs = df_normed.clip(0, None) * gsp_capacities.T
logger.debug(f"Maximum predictions: {df_abs.max()}")

logger.info(f"Maximum predictions: {df_abs.max()}")
# ---------------------------------------------------------------------------
# 6. Make national total
logger.info("Summing to national forecast")
Expand Down

0 comments on commit 5de4285

Please sign in to comment.