We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 781602e commit 0f12ab4Copy full SHA for 0f12ab4
1 file changed
src/pownet/input.py
@@ -925,6 +925,23 @@ def check_data(self):
925
raise ValueError(
926
f"PowNet: Weekly hydropower timeseries must be of length {self.num_sim_days}."
927
)
928
+
929
+ ##################################
930
+ # Capacities are non-negative
931
932
933
+ attrs_to_check = [
934
+ "solar_capacity",
935
+ "wind_capacity",
936
+ "import_capacity",
937
+ "hydro_capacity",
938
+ "susceptance",
939
+ "line_capacity",
940
+ ]
941
+ for attr in attrs_to_check:
942
+ temp_df = getattr(self, attr)
943
+ if (not temp_df.empty) and (temp_df < 0).any().any():
944
+ raise ValueError(f"PowNet: {attr} must be non-negative.")
945
946
##################################
947
# The derated capacities of thermal units must be above its minimum capacity
0 commit comments