@@ -549,6 +549,7 @@ def load_grid(self,
549549 else :
550550 tmp = dict (** el )
551551 if "geo" in tmp :
552+ # bug in pandapower 3.0.0 in this case
552553 del tmp ["geo" ]
553554 pp .create_bus (self ._grid , index = ind , ** tmp )
554555 self ._init_private_attrs ()
@@ -773,26 +774,26 @@ def _init_private_attrs(self) -> None:
773774 )
774775 self .thermal_limit_a = self .thermal_limit_a .astype (dt_float )
775776
776- self .p_or = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
777- self .q_or = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
778- self .v_or = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
779- self .a_or = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
780- self .p_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
781- self .q_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
782- self .v_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
783- self .a_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .NaN )
784- self .load_p = np .full (self .n_load , dtype = dt_float , fill_value = np .NaN )
785- self .load_q = np .full (self .n_load , dtype = dt_float , fill_value = np .NaN )
786- self .load_v = np .full (self .n_load , dtype = dt_float , fill_value = np .NaN )
787- self .prod_p = np .full (self .n_gen , dtype = dt_float , fill_value = np .NaN )
788- self .prod_v = np .full (self .n_gen , dtype = dt_float , fill_value = np .NaN )
789- self .prod_q = np .full (self .n_gen , dtype = dt_float , fill_value = np .NaN )
790- self .storage_p = np .full (self .n_storage , dtype = dt_float , fill_value = np .NaN )
791- self .storage_q = np .full (self .n_storage , dtype = dt_float , fill_value = np .NaN )
792- self .storage_v = np .full (self .n_storage , dtype = dt_float , fill_value = np .NaN )
777+ self .p_or = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
778+ self .q_or = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
779+ self .v_or = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
780+ self .a_or = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
781+ self .p_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
782+ self .q_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
783+ self .v_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
784+ self .a_ex = np .full (self .n_line , dtype = dt_float , fill_value = np .nan )
785+ self .load_p = np .full (self .n_load , dtype = dt_float , fill_value = np .nan )
786+ self .load_q = np .full (self .n_load , dtype = dt_float , fill_value = np .nan )
787+ self .load_v = np .full (self .n_load , dtype = dt_float , fill_value = np .nan )
788+ self .prod_p = np .full (self .n_gen , dtype = dt_float , fill_value = np .nan )
789+ self .prod_v = np .full (self .n_gen , dtype = dt_float , fill_value = np .nan )
790+ self .prod_q = np .full (self .n_gen , dtype = dt_float , fill_value = np .nan )
791+ self .storage_p = np .full (self .n_storage , dtype = dt_float , fill_value = np .nan )
792+ self .storage_q = np .full (self .n_storage , dtype = dt_float , fill_value = np .nan )
793+ self .storage_v = np .full (self .n_storage , dtype = dt_float , fill_value = np .nan )
793794 self ._nb_bus_before = None
794795
795- self .line_status = np .full (self .n_line , dtype = dt_bool , fill_value = np .NaN )
796+ self .line_status = np .full (self .n_line , dtype = dt_bool , fill_value = np .nan )
796797 self .line_status .flags .writeable = False
797798
798799 # store the topoid -> objid
@@ -814,11 +815,11 @@ def _init_private_attrs(self) -> None:
814815 # store the topoid -> objid
815816 self ._init_big_topo_to_bk ()
816817
817- self .theta_or = np .full (self .n_line , fill_value = np .NaN , dtype = dt_float )
818- self .theta_ex = np .full (self .n_line , fill_value = np .NaN , dtype = dt_float )
819- self .load_theta = np .full (self .n_load , fill_value = np .NaN , dtype = dt_float )
820- self .gen_theta = np .full (self .n_gen , fill_value = np .NaN , dtype = dt_float )
821- self .storage_theta = np .full (self .n_storage , fill_value = np .NaN , dtype = dt_float )
818+ self .theta_or = np .full (self .n_line , fill_value = np .nan , dtype = dt_float )
819+ self .theta_ex = np .full (self .n_line , fill_value = np .nan , dtype = dt_float )
820+ self .load_theta = np .full (self .n_load , fill_value = np .nan , dtype = dt_float )
821+ self .gen_theta = np .full (self .n_gen , fill_value = np .nan , dtype = dt_float )
822+ self .storage_theta = np .full (self .n_storage , fill_value = np .nan , dtype = dt_float )
822823
823824 self ._get_topo_vect ()
824825 self .tol = 1e-5 # this is NOT the pandapower tolerance !!!! this is used to check if a storage unit
@@ -835,10 +836,10 @@ def _init_private_attrs(self) -> None:
835836
836837 def storage_deact_for_backward_comaptibility (self ) -> None :
837838 cls = type (self )
838- self .storage_theta = np .full (cls .n_storage , fill_value = np .NaN , dtype = dt_float )
839- self .storage_p = np .full (cls .n_storage , dtype = dt_float , fill_value = np .NaN )
840- self .storage_q = np .full (cls .n_storage , dtype = dt_float , fill_value = np .NaN )
841- self .storage_v = np .full (cls .n_storage , dtype = dt_float , fill_value = np .NaN )
839+ self .storage_theta = np .full (cls .n_storage , fill_value = np .nan , dtype = dt_float )
840+ self .storage_p = np .full (cls .n_storage , dtype = dt_float , fill_value = np .nan )
841+ self .storage_q = np .full (cls .n_storage , dtype = dt_float , fill_value = np .nan )
842+ self .storage_v = np .full (cls .n_storage , dtype = dt_float , fill_value = np .nan )
842843 self ._topo_vect .flags .writeable = True
843844 self ._topo_vect .resize (cls .dim_topo )
844845 self ._topo_vect .flags .writeable = False
@@ -1208,30 +1209,30 @@ def runpf(self, is_dc : bool=False) -> Tuple[bool, Union[Exception, None]]:
12081209 return False , BackendError (f'powerflow diverged with error :"{ msg } ", you can check `env.backend.div_exception` for more information' )
12091210
12101211 def _reset_all_nan (self ) -> None :
1211- self .p_or [:] = np .NaN
1212- self .q_or [:] = np .NaN
1213- self .v_or [:] = np .NaN
1214- self .a_or [:] = np .NaN
1215- self .p_ex [:] = np .NaN
1216- self .q_ex [:] = np .NaN
1217- self .v_ex [:] = np .NaN
1218- self .a_ex [:] = np .NaN
1219- self .prod_p [:] = np .NaN
1220- self .prod_q [:] = np .NaN
1221- self .prod_v [:] = np .NaN
1222- self .load_p [:] = np .NaN
1223- self .load_q [:] = np .NaN
1224- self .load_v [:] = np .NaN
1225- self .storage_p [:] = np .NaN
1226- self .storage_q [:] = np .NaN
1227- self .storage_v [:] = np .NaN
1212+ self .p_or [:] = np .nan
1213+ self .q_or [:] = np .nan
1214+ self .v_or [:] = np .nan
1215+ self .a_or [:] = np .nan
1216+ self .p_ex [:] = np .nan
1217+ self .q_ex [:] = np .nan
1218+ self .v_ex [:] = np .nan
1219+ self .a_ex [:] = np .nan
1220+ self .prod_p [:] = np .nan
1221+ self .prod_q [:] = np .nan
1222+ self .prod_v [:] = np .nan
1223+ self .load_p [:] = np .nan
1224+ self .load_q [:] = np .nan
1225+ self .load_v [:] = np .nan
1226+ self .storage_p [:] = np .nan
1227+ self .storage_q [:] = np .nan
1228+ self .storage_v [:] = np .nan
12281229 self ._nb_bus_before = None
12291230
1230- self .theta_or [:] = np .NaN
1231- self .theta_ex [:] = np .NaN
1232- self .load_theta [:] = np .NaN
1233- self .gen_theta [:] = np .NaN
1234- self .storage_theta [:] = np .NaN
1231+ self .theta_or [:] = np .nan
1232+ self .theta_ex [:] = np .nan
1233+ self .load_theta [:] = np .nan
1234+ self .gen_theta [:] = np .nan
1235+ self .storage_theta [:] = np .nan
12351236 self ._topo_vect .flags .writeable = True
12361237 self ._topo_vect [:] = - 1
12371238 self ._topo_vect .flags .writeable = False
0 commit comments