@@ -1004,32 +1004,58 @@ def source_get_components(comp_type):
10041004 fallback_head = PLEXOSStorage (name = "Fallback_head" )
10051005 fallback_tail = PLEXOSStorage (name = "Fallback_tail" )
10061006
1007- for component in [gen_t1 , gen_fallback_head , gen_fallback_tail , storage_head , storage_tail , fallback_head , fallback_tail ]:
1007+ for component in [
1008+ gen_t1 ,
1009+ gen_fallback_head ,
1010+ gen_fallback_tail ,
1011+ storage_head ,
1012+ storage_tail ,
1013+ fallback_head ,
1014+ fallback_tail ,
1015+ ]:
10081016 context .target_system .add_component (component )
10091017
1010- monkeypatch .setattr (getters_utils , "_attach_reservoir_time_series_to_storage" , lambda * _args , ** _kwargs : None )
1018+ monkeypatch .setattr (
1019+ getters_utils , "_attach_reservoir_time_series_to_storage" , lambda * _args , ** _kwargs : None
1020+ )
10111021
10121022 getters_utils .ensure_head_storage_generator_membership (context )
10131023 getters_utils .ensure_tail_storage_generator_membership (context )
10141024
1015- head_memberships = context .target_system .get_supplemental_attributes_with_component (gen_t1 , PLEXOSMembership )
1016- assert any (m .collection == CollectionEnum .HeadStorage and m .child_object .name == "PlantA_head" for m in head_memberships )
1025+ head_memberships = context .target_system .get_supplemental_attributes_with_component (
1026+ gen_t1 , PLEXOSMembership
1027+ )
1028+ assert any (
1029+ m .collection == CollectionEnum .HeadStorage and m .child_object .name == "PlantA_head"
1030+ for m in head_memberships
1031+ )
10171032
1018- tail_memberships = context .target_system .get_supplemental_attributes_with_component (gen_t1 , PLEXOSMembership )
1019- assert any (m .collection == CollectionEnum .TailStorage and m .child_object .name == "PlantA_tail" for m in tail_memberships )
1033+ tail_memberships = context .target_system .get_supplemental_attributes_with_component (
1034+ gen_t1 , PLEXOSMembership
1035+ )
1036+ assert any (
1037+ m .collection == CollectionEnum .TailStorage and m .child_object .name == "PlantA_tail"
1038+ for m in tail_memberships
1039+ )
10201040
1021- fallback_h = context .target_system .get_supplemental_attributes_with_component (gen_fallback_head , PLEXOSMembership )
1041+ fallback_h = context .target_system .get_supplemental_attributes_with_component (
1042+ gen_fallback_head , PLEXOSMembership
1043+ )
10221044 assert any (m .collection == CollectionEnum .HeadStorage for m in fallback_h )
10231045
1024- fallback_t = context .target_system .get_supplemental_attributes_with_component (gen_fallback_tail , PLEXOSMembership )
1046+ fallback_t = context .target_system .get_supplemental_attributes_with_component (
1047+ gen_fallback_tail , PLEXOSMembership
1048+ )
10251049 assert any (m .collection == CollectionEnum .TailStorage for m in fallback_t )
10261050
10271051
10281052def test_generator_node_memberships_deduplicate_same_target_node (context , monkeypatch ):
10291053 import r2x_sienna_to_plexos .getters as getters_mod
10301054 import r2x_sienna_to_plexos .getters_mappings as mappings_mod
10311055
1032- monkeypatch .setattr (getters_mod , "_build_generator_display_name_index" , lambda _ctx : {"SRC1" : "GEN_A" , "SRC2" : "GEN_A" })
1056+ monkeypatch .setattr (
1057+ getters_mod , "_build_generator_display_name_index" , lambda _ctx : {"SRC1" : "GEN_A" , "SRC2" : "GEN_A" }
1058+ )
10331059 monkeypatch .setattr (mappings_mod , "SOURCE_GENERATOR_TYPES" , [dict ])
10341060
10351061 bus = types .SimpleNamespace (name = "N1" )
0 commit comments