Skip to content

Commit 00bcb88

Browse files
1jhu1Copilot
andcommitted
run test 006 passed: 3 scenarios, custom cost, cold climate
Co-authored-by: Copilot <copilot@github.com>
1 parent bc8df3c commit 00bcb88

496 files changed

Lines changed: 2441763 additions & 46890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,15 +790,20 @@ def _extract_thickness_m_from_description(desc: str):
790790
else:
791791
total_added_volume_cf = float(rsmeans_materials[0].get("quantity_volume", 0.0))
792792
if total_added_volume_cf > 0.0:
793-
total_material_cost = custom_cost_per_cf * total_added_volume_cf
793+
_lc_mult = int(lifetime_multiplier(insulation_material_lifetime, analysis_period))
794+
total_material_cost = custom_cost_per_cf * total_added_volume_cf * _lc_mult
794795
if labor_cost_multiplier and labor_cost_multiplier > 1.0:
795796
total_labor_cost = total_material_cost * (labor_cost_multiplier - 1.0)
797+
total_overhead_profit_cost = (total_material_cost + total_labor_cost) * (overhead_profit_percent / 100.0)
796798
cost_source = "custom_input"
797799
cost_factor_basis = "custom_cost_per_volume"
798800
runner.registerInfo(
799801
"Custom cost summary (cost_source=custom_input): "
800-
f"material_cost=${total_material_cost:,.2f} "
801-
f"(volume={total_added_volume_cf:.2f} CF × rate ${custom_cost_per_cf}/CF)"
802+
f"material_cost=${total_material_cost:,.2f} (lifetime_multiplier={_lc_mult}), "
803+
f"labor_cost=${total_labor_cost:,.2f}, "
804+
f"overhead_profit_cost=${total_overhead_profit_cost:,.2f} "
805+
f"(volume={total_added_volume_cf:.2f} CF × rate ${custom_cost_per_cf}/CF, "
806+
f"labor_multiplier={labor_cost_multiplier:.2f}, overhead_profit_percent={overhead_profit_percent:.1f}%)"
802807
)
803808
else:
804809
runner.registerWarning("Custom cost mode enabled, but added volume is 0. Skipping cost calculation.")
@@ -824,8 +829,9 @@ def _extract_thickness_m_from_description(desc: str):
824829
summary = rsmeans_lookup.get("summary", {})
825830
# Note: total_material_cost from RSMeans already includes labor
826831
# RSMeans totalOpCost combines material + labor costs.
827-
total_material_cost = float(summary.get("total_material_cost", 0.0))
828-
total_overhead_profit_cost = float(summary.get("total_overhead_profit_cost", 0.0))
832+
_lc_mult = int(lifetime_multiplier(insulation_material_lifetime, analysis_period))
833+
total_material_cost = float(summary.get("total_material_cost", 0.0)) * _lc_mult
834+
total_overhead_profit_cost = float(summary.get("total_overhead_profit_cost", 0.0)) * _lc_mult
829835
cost_source = "rsmeans_api"
830836
materials_results = rsmeans_lookup.get("results", {}).get("materials", [])
831837
mode_values = {

lib/measures/IncreaseInsulationRValueForRoofs/measure.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,16 +1181,20 @@ def _extract_thickness_m_from_description(desc: str):
11811181
else:
11821182
total_added_volume_cf = sum(float(m.get("quantity_volume", 0.0)) for m in rsmeans_materials)
11831183
if total_added_volume_cf > 0.0:
1184-
total_material_cost = custom_cost_per_cf * total_added_volume_cf
1184+
_lc_mult = int(lifetime_multiplier(insulation_material_lifetime, analysis_period))
1185+
total_material_cost = custom_cost_per_cf * total_added_volume_cf * _lc_mult
11851186
if labor_cost_multiplier > 1.0:
11861187
total_labor_cost = total_material_cost * (labor_cost_multiplier - 1.0)
1188+
total_overhead_profit_cost = (total_material_cost + total_labor_cost) * (overhead_profit_percent / 100.0)
11871189
cost_source = "custom_input"
11881190
cost_factor_basis = "custom_cost_per_volume"
11891191
runner.registerInfo(
11901192
"Custom cost summary (cost_source=custom_input): "
1191-
f"material_cost=${total_material_cost:,.2f}, labor_cost=${total_labor_cost:,.2f} "
1193+
f"material_cost=${total_material_cost:,.2f} (lifetime_multiplier={_lc_mult}), "
1194+
f"labor_cost=${total_labor_cost:,.2f} "
1195+
f"overhead_profit_cost=${total_overhead_profit_cost:,.2f} "
11921196
f"(volume={total_added_volume_cf:.2f} CF × rate ${custom_cost_per_cf}/CF, "
1193-
f"labor_multiplier={labor_cost_multiplier:.2f})"
1197+
f"labor_multiplier={labor_cost_multiplier:.2f}, overhead_profit_percent={overhead_profit_percent:.1f}%)"
11941198
)
11951199
else:
11961200
runner.registerWarning("Custom cost mode enabled, but added volume is 0. Skipping cost calculation.")
@@ -1234,8 +1238,9 @@ def _extract_thickness_m_from_description(desc: str):
12341238
# RSMeans summary "total_material_cost" currently
12351239
# represents direct cost from the RSMeans API response.
12361240
# Backward-compatible alias for downstream consumers.
1237-
total_material_cost = float(summary.get("total_material_cost", 0.0))
1238-
total_overhead_profit_cost = float(summary.get("total_overhead_profit_cost", 0.0))
1241+
_lc_mult = int(lifetime_multiplier(insulation_material_lifetime, analysis_period))
1242+
total_material_cost = float(summary.get("total_material_cost", 0.0)) * _lc_mult
1243+
total_overhead_profit_cost = float(summary.get("total_overhead_profit_cost", 0.0)) * _lc_mult
12391244
cost_source = "rsmeans_api"
12401245
materials_results = rsmeans_lookup.get(
12411246
"results", {}

0 commit comments

Comments
 (0)