Skip to content

Commit

Permalink
fix: Removing feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pesap committed Dec 9, 2024
1 parent 2857f51 commit e77198e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/r2x/parser/reeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,9 @@ def _construct_hydro_budgets(self) -> None:
hydro_cf,
month_hrs,
)
month_of_hour = np.array(
[dt.astype("datetime64[M]").astype(int) % 12 + 1 for dt in self.hourly_time_index]
)
# month_of_hour = np.array(
# [dt.astype("datetime64[M]").astype(int) % 12 + 1 for dt in self.hourly_time_index]
# )
month_of_day = np.array(
[dt.astype("datetime64[M]").astype(int) % 12 + 1 for dt in self.daily_time_index]
)
Expand All @@ -707,9 +707,9 @@ def _construct_hydro_budgets(self) -> None:
region = generator.bus.name
hydro_ratings = hydro_data.filter((pl.col("tech") == tech) & (pl.col("region") == region))

hourly_time_series = np.zeros(len(month_of_hour), dtype=float)
if self.config.feature_flags.get("daily-budgets", None):
hourly_time_series = np.zeros(len(month_of_day), dtype=float)
# hourly_time_series = np.zeros(len(month_of_hour), dtype=float)
# if self.config.feature_flags.get("daily-budgets", None):
hourly_time_series = np.zeros(len(month_of_day), dtype=float)

for row in hydro_ratings.iter_rows(named=True):
month = row["month"]
Expand All @@ -719,12 +719,12 @@ def _construct_hydro_budgets(self) -> None:
month_max_budget = (
generator.active_power * Percentage(row["hydro_cf"], "") * Time(row["hrs"], "h")
)
if self.config.feature_flags.get("daily-budgets", None):
daily_max_budget = month_max_budget / (row["hrs"] / 24)
hourly_time_series[month_of_day == month] = daily_max_budget.magnitude
else:
month_indices = month_of_hour == month
hourly_time_series[month_indices] = month_max_budget.magnitude
# if self.config.feature_flags.get("daily-budgets", None):
daily_max_budget = month_max_budget / (row["hrs"] / 24)
hourly_time_series[month_of_day == month] = daily_max_budget.magnitude
# else:
# month_indices = month_of_hour == month
# hourly_time_series[month_indices] = month_max_budget.magnitude

ts = SingleTimeSeries.from_array(
Energy(hourly_time_series / 1e3, "GWh"),
Expand Down

0 comments on commit e77198e

Please sign in to comment.