Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
Expand All @@ -12,20 +12,20 @@ repos:
- id: detect-private-key

# python code formatting/linting
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.253"
rev: "v0.1.6"
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.11.0
hooks:
- id: black
args: [--line-length, "100"]
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
rev: v3.1.0
hooks:
- id: prettier
types: [yaml]
1 change: 0 additions & 1 deletion notebooks/good_and_bad_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
traces = []
subplot_titles = []
for i in range(len(all_indexes)):

print(i)

index = all_indexes[i] % 32
Expand Down
6 changes: 0 additions & 6 deletions nowcasting_utils/metrics/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def make_forecast_horizon_metrics(results_df, normalize: bool = False) -> List[g
forecast_horizon_metrics = {}
# loop over the number of forecast horizons
for i in range(n_forecast_hoirzons):

forecast_horizon = (i + 1) * time_delta
forecast_horizon_hours = forecast_horizon.seconds / 3600

Expand Down Expand Up @@ -92,7 +91,6 @@ def make_forecast_horizon_metrics(results_df, normalize: bool = False) -> List[g
trace_forecast_horizons = []
# loop over the different columns / metrics and plot them
for i in range(len(plotting_metrics)):

col = plotting_metrics[i]
colour = colours[i]

Expand Down Expand Up @@ -127,7 +125,6 @@ def make_gsp_id_metrics(
n_gsp_ids = int(results_df["gsp_id"].max())
gsp_metrics = {}
for i in range(n_gsp_ids):

gsp_id = i + 1

results_df_one_forecast_hoirzon = results_df[results_df["gsp_id"] == gsp_id]
Expand All @@ -146,7 +143,6 @@ def make_gsp_id_metrics(
# plot metrics
trace_gsp_id = []
for i in range(len(plotting_metrics)):

col = plotting_metrics[i]
colour = colours[i]

Expand Down Expand Up @@ -202,7 +198,6 @@ def make_t0_datetime_utc_metrics(results_df, normalize: bool = False) -> (go.Sca
)

for i in range(len(target_datetimes_utc)):

target_datetime_utc = target_datetimes_utc[i]

results_df_one_datetime = results_df[
Expand All @@ -221,7 +216,6 @@ def make_t0_datetime_utc_metrics(results_df, normalize: bool = False) -> (go.Sca
# plot metrics
trace_gsp_id = []
for i in range(len(plotting_metrics)):

col = plotting_metrics[i]
colour = colours[i]

Expand Down
1 change: 0 additions & 1 deletion nowcasting_utils/metrics/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def make_validation_results(
# TODO #64 vectorize
n_forecast_timesteps = predictions_mw.shape[1]
for i in range(n_forecast_timesteps):

if len(capacity_mwp.shape) == 1:
capacity_time_step = capacity_mwp
else:
Expand Down
1 change: 0 additions & 1 deletion nowcasting_utils/visualization/data_sources/plot_gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def get_traces_gsp_intensity(gsp: GSP, example_index: int):
traces = []

for t_index in range(len(time)):

trace = get_trace_gsp_intensity_one_time_step(
gsp=gsp, example_index=example_index, t_index=t_index
)
Expand Down
1 change: 0 additions & 1 deletion nowcasting_utils/visualization/data_sources/plot_pv.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def get_traces_pv_intensity(pv: PV, example_index: int):
traces = [go.Choroplethmapbox(colorscale="Viridis")]

for t_index in range(len(time)):

trace = get_trace_pv_intensity_one_time_step(
pv=pv, example_index=example_index, t_index=t_index
)
Expand Down
1 change: 0 additions & 1 deletion nowcasting_utils/visualization/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def plot_batch_results(
fig.layout.annotations[-1]["yanchor"] = "bottom"

for i in range(0, batchsize):

row = i // N + 1
col = i % N + 1

Expand Down
1 change: 0 additions & 1 deletion scripts/plot-satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

# loop over examples
for example_index in range(11, 13):

x = satellite.x[example_index].mean()
y = satellite.y[example_index].mean()

Expand Down
1 change: 0 additions & 1 deletion scripts/plot_nwp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

# loop over examples
for example_index in range(5, 6):

x = nwp.x[example_index].mean()
y = nwp.y[example_index].mean()

Expand Down