Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 600357f

Browse files
authored
Fix typos in comments
1 parent 84ec16d commit 600357f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/convert-ESO-PV-forecasts-from-CSV-to-HDF5.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@
1616
1717
1. `gsp_name`: A string identifying the Grid Supply Point region.
1818
2. `forecast_date_time`: The UTC datetime when ESO ran their forecast.
19-
The `forecast_date_time` will be a little time (about an hour or two?)
19+
The `forecast_date_time` will be about an hour or two
2020
after the initialisation time of the numerical weather predictions
2121
fed into ESO's forecasting algorithm. This script takes the floor('30T') of the
2222
original forecast_date_time from ESO. `forecast_date_time` tells us when ESO
2323
ran their PV forecast. The `target_date_time` (the time that each forecast is
2424
_about_) can be calculated as the sum of `forecast_date_time` and `step`.
25+
The `step` is computed after taking the floor('30T') of the `forecast_date_time`,
26+
so the re-computed `target_date_time` should be correct.
2527
To give a little more background: For most forecasts, any given row is identified
2628
by _two_ datetimes: The datetime that the forecast was run (the `forecast_date_time`);
2729
and the datetime that the forecast is _about_ (the `target_date_time`).
2830
3. `step`: The Timedelta between the forecast_date_time and the target_date_time.
2931
3032
It's not possible to append to NetCDF files, so this script loads everything into memory,
31-
and strip away stuff we don't need, and maintain a list of xr.DataSets to be concatenated.
33+
and strips away stuff we don't need, and maintains a list of xr.DataSets to be concatenated.
3234
"""
3335

3436
from pathlib import Path
@@ -61,7 +63,7 @@ def filenames_and_datetime_periods(path: Path) -> pd.Series:
6163
"""Gets all CSV filenames in `path`.
6264
6365
Returns a Series where the Index is a pd.PeriodIndex at monthly frequency,
64-
and the values at the full Path to the CSV file. The index is sorted.
66+
and the values are the full Path to the CSV file. The index is sorted.
6567
6668
This is the header and first line of an ESO CSVs:
6769
@@ -167,10 +169,10 @@ def convert_to_dataarray(df: pd.DataFrame) -> xr.DataArray:
167169
df = df.drop(columns="TARGET_DATE_TIME")
168170

169171
# Make sure "step" is positive:
170-
# (step can be negative for ASL forecasts, for some reasons).
172+
# (step can be negative for ASL forecasts. I don't know why!).
171173
df = df[df.step >= pd.Timedelta(0)]
172174

173-
# Rename to more column names more like the ones we're used to.
175+
# Rename to column names more like the ones we're used to in OCF.
174176
df = df.rename(columns={"SITE_ID": "gsp_name"})
175177

176178
# Set index

0 commit comments

Comments
 (0)