Skip to content

Commit 75bcb9b

Browse files
committed
fix: update nondispatch timeseries
1 parent ee6ba3d commit 75bcb9b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/pownet/input.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def update_capacity(self, capacity_df: pd.DataFrame, unit_type: str) -> None:
11191119
ValueError: If the timeseries does not contain all units of the given type.
11201120
"""
11211121

1122-
allowed_unit_types = ["hydro", "solar", "wind", "import"]
1122+
allowed_unit_types = ["hydro", "daily_hydro","solar", "wind", "import"]
11231123
if unit_type not in allowed_unit_types:
11241124
raise ValueError(f"Given unit type: {unit_type} not supported.")
11251125

@@ -1129,10 +1129,17 @@ def update_capacity(self, capacity_df: pd.DataFrame, unit_type: str) -> None:
11291129
raise ValueError(
11301130
"PowNet: The length of the hydropower timeseries must remain the same."
11311131
)
1132+
1133+
# Check that index matches
1134+
if not capacity_df.index.equals(current_capacity.index):
1135+
raise ValueError(
1136+
"PowNet: The index of the hydropower timeseries must remain the same."
1137+
)
1138+
11321139
# Check that all hydropower units are present
11331140
if set(capacity_df.columns) != set(current_capacity.columns):
11341141
raise ValueError(
1135-
"PowNet: The hydropower timeseries must contain all hydropower units."
1142+
"PowNet: Unit names in the capacity timeseries must remain the same."
11361143
)
11371144
# Save a copy to prevent unintended changes
11381145
setattr(self, f"{unit_type}_capacity", capacity_df.copy())

0 commit comments

Comments
 (0)