1111_PROJECT_ROOT = Path (__file__ ).resolve ().parent .parent
1212RATE_DESIGN_DIR = _PROJECT_ROOT / "rate_design"
1313
14- SB_scenarios_path = Path (__file__ ).parent / "SB_scenarios.json"
15-
1614
1715def define_electrical_tariff_key (
1816 SB_scenario : SB_scenario ,
@@ -35,19 +33,17 @@ def define_electrical_tariff_key(
3533
3634
3735def generate_electrical_tariff_mapping (
38- metadata_df : pl .DataFrame ,
36+ metadata_has_hp : pl .DataFrame ,
3937 SB_scenario : SB_scenario ,
4038 electric_utility : electric_utility ,
4139) -> pl .DataFrame :
42- has_hp = metadata_df ["postprocess_group.has_hp" ]
40+ has_hp = metadata_has_hp ["postprocess_group.has_hp" ]
4341
44- electrical_tariff_mapping_df = (
45- metadata_df .select (pl .col ("bldg_id" ))
46- .with_columns (pl .lit ("" ).alias ("tariff_key" ))
47- .with_columns (
48- define_electrical_tariff_key (SB_scenario , electric_utility , has_hp ).alias (
49- "tariff_key"
50- )
42+ electrical_tariff_mapping_df = metadata_has_hp .select (
43+ pl .col ("bldg_id" )
44+ ).with_columns (
45+ define_electrical_tariff_key (SB_scenario , electric_utility , has_hp ).alias (
46+ "tariff_key"
5147 )
5248 )
5349
@@ -70,11 +66,13 @@ def map_electric_tariff(
7066 if utility_metadata_df .is_empty ():
7167 return
7268
73- print (utility_metadata_df .head (20 ))
74-
69+ metadata_has_hp = utility_metadata_df .select (
70+ pl .col ("bldg_id" , "postprocess_group.has_hp" )
71+ )
7572 electrical_tariff_mapping_df = generate_electrical_tariff_mapping (
76- utility_metadata_df , SB_scenario , electric_utility
73+ metadata_has_hp , SB_scenario , electric_utility
7774 )
75+
7876 print (electrical_tariff_mapping_df .head (20 ))
7977
8078 output_path = (
0 commit comments