File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -1610,19 +1610,22 @@ def _fill_names(cls):
16101610 cls ._reset_cls_dict ()
16111611
16121612 if cls .shunts_data_available and cls .name_shunt is None :
1613- cls .name_shunt = [
1614- "shunt_{}_{}" .format (bus_id , sh_id )
1615- for sh_id , bus_id in enumerate (cls .shunt_to_subid )
1616- ]
1617- cls .name_shunt = np .array (cls .name_shunt )
1618- warnings .warn (
1619- "name_shunt is None so default storage unit names have been assigned to your grid. "
1620- "(FYI: storage names are used to make the correspondence between the chronics and "
1621- "the backend)"
1622- "This might result in impossibility to load data."
1623- '\n \t If "env.make" properly worked, you can safely ignore this warning.'
1624- )
1625- cls ._reset_cls_dict ()
1613+ if cls .shunt_to_subid is not None :
1614+ # used for legacy lightsim2grid
1615+ # shunt names were defined after...
1616+ cls .name_shunt = [
1617+ "shunt_{}_{}" .format (bus_id , sh_id )
1618+ for sh_id , bus_id in enumerate (cls .shunt_to_subid )
1619+ ]
1620+ cls .name_shunt = np .array (cls .name_shunt )
1621+ warnings .warn (
1622+ "name_shunt is None so default shunt names have been assigned to your grid. "
1623+ "(FYI: shunt names are used to make the correspondence between the chronics and "
1624+ "the backend)"
1625+ "This might result in impossibility to load data."
1626+ '\n \t If "env.make" properly worked, you can safely ignore this warning.'
1627+ )
1628+ cls ._reset_cls_dict ()
16261629
16271630 @classmethod
16281631 def _check_names (cls ):
You can’t perform that action at this time.
0 commit comments