File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -925,6 +925,23 @@ def check_data(self):
925925 raise ValueError (
926926 f"PowNet: Weekly hydropower timeseries must be of length { self .num_sim_days } ."
927927 )
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." )
928945
929946 ##################################
930947 # The derated capacities of thermal units must be above its minimum capacity
You can’t perform that action at this time.
0 commit comments