Skip to content

Commit

Permalink
try to adress #83
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Nov 8, 2024
1 parent 0ce7444 commit 0710498
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions chronix2grid/generation/consumption/consumption_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@ def compute_load_pattern(params,
else:
if pattern_path in __CACHED__DATA:
tmp_weekly_pattern = __CACHED__DATA[pattern_path]
print(f"Using cached data for {pattern_path}")
else:
tmp_weekly_pattern = pd.read_csv(pattern_path, sep=";")
if tmp_weekly_pattern.isna().any().any():
print(f"WARNING: NA detected for load pattern {pattern_path}")
print(f"Loading cached data for {pattern_path}")
__CACHED__DATA[pattern_path] = tmp_weekly_pattern
used_weekly_pattern = tmp_weekly_pattern["values"].values
if isoweekday_lwp is None or hour_minutes_lwp is None:
Expand Down
2 changes: 1 addition & 1 deletion chronix2grid/generation/renewable/solar_wind_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def compute_solar_pattern(params, solar_pattern, tol=0.0):
end_min = int(pd.Timedelta(params['end_date'] - start_year).total_seconds() // 60)

Nt_inter_hr = int(end_min // 60 + 1)
N_repet = int((Nt_inter_hr - 1) // len(solar_pattern) + 1)
N_repet = int((Nt_inter_hr) // len(solar_pattern) + 1) # thanks DEUCE1957, see issue https://github.com/Grid2op/chronix2grid/issues/83
stacked_solar_pattern = solar_pattern
for i in range(N_repet - 1):
stacked_solar_pattern = np.append(stacked_solar_pattern, solar_pattern)
Expand Down

0 comments on commit 0710498

Please sign in to comment.