-
Notifications
You must be signed in to change notification settings - Fork 0
Add threshold-based scoring, Chen 2022 calibration application, and assessment lifetime references #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add threshold-based scoring, Chen 2022 calibration application, and assessment lifetime references #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,13 +2,9 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import numpy as np | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import pandas as pd | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import plotly.graph_objects as go | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import plotly.express as px | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from plotly.subplots import make_subplots | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from scipy import stats | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from sklearn.preprocessing import MinMaxScaler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from datetime import datetime | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import io | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ═══════════════════════════════════════════════════════════════ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # PAGE CONFIGURATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -39,7 +35,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'system_parameters': { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'length_km': 96, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'lifetime_years': 100, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'lifetime_years': 50, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'functional_unit': '1 passenger-km', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'system_boundary': 'Cradle-to-grave' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -77,6 +73,28 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| REF_FRP = 1000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| REF_GLASS = 500 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| REF_LENGTH = 96 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ASSESSMENT_LIFETIME_YEARS = 50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENVIRONMENTAL_REFERENCES = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'co2_min_tons': 5000.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'co2_max_tons': 50000.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'renewable_target_pct': 40.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'noise_target_db': 15.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'land_efficiency_target_pax_ha': 5000.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OPERATIONAL_REFERENCES = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'time_savings_target_hours_day': 2500.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'availability_target_pct': 98.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'energy_efficiency_baseline_kwh_pkm': 0.20, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'land_efficiency_target_pax_ha': 5000.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECONOMIC_REFERENCES = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'jobs_target': 12000.0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'multiplier_target': 3.5, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'max_maintenance_ratio': 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+80
to
+96
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'co2_max_tons': 50000.0, | |
| 'renewable_target_pct': 40.0, | |
| 'noise_target_db': 15.0, | |
| 'land_efficiency_target_pax_ha': 5000.0 | |
| } | |
| OPERATIONAL_REFERENCES = { | |
| 'time_savings_target_hours_day': 2500.0, | |
| 'availability_target_pct': 98.0, | |
| 'energy_efficiency_baseline_kwh_pkm': 0.20, | |
| 'land_efficiency_target_pax_ha': 5000.0 | |
| } | |
| ECONOMIC_REFERENCES = { | |
| 'jobs_target': 12000.0, | |
| 'multiplier_target': 3.5, | |
| 'max_maintenance_ratio': 1.0 | |
| 'co2_max_tons': 50000.0 | |
| } | |
| OPERATIONAL_REFERENCES = { | |
| 'time_savings_target_hours_day': 2500.0, | |
| 'energy_efficiency_baseline_kwh_pkm': 0.20, | |
| 'land_efficiency_target_pax_ha': 5000.0 | |
| } | |
| ECONOMIC_REFERENCES = { | |
| 'jobs_target': 12000.0, | |
| 'multiplier_target': 3.5 |
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noise_quality_multiplier still hard-codes 15.0 even though ENVIRONMENTAL_REFERENCES defines noise_target_db. This partially defeats the goal of centralizing thresholds and can lead to drift if references change. Use the reference value in this normalization to keep scoring behavior consistent with the configured targets.
| noise_quality_multiplier = 1.0 + (noise_reduction / 15.0) * 0.10 | |
| noise_quality_multiplier = 1.0 + ( | |
| noise_reduction / ENVIRONMENTAL_REFERENCES['noise_target_db'] | |
| ) * 0.10 |
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raw_carbon_intensity_val is already computed from the Chen-calibrated operational energy (energy_per_pax_km_calibrated) and the user-provided grid carbon intensity (plus the existing 0.800 Chen factor). Applying operational_carbon_factor again here likely double-calibrates operational carbon and will cause the benchmark carbon intensity (0.0352 kgCO₂/pkm) to be under-shot when using the default grid carbon intensity. Consider removing this extra calibration step or re-deriving the operational carbon calibration approach so energy/carbon aren’t calibrated twice.
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total_ee_raw is calculated using COEFFICIENTS that are already labeled as Chen-calibrated in-file (see the coefficient block header). Multiplying by apply_chen_calibration(..., 'embodied_energy') here likely applies calibration twice, which will skew embodied energy results and break the Chen benchmark validation (which compares against already-calibrated benchmark totals). Prefer a single calibration strategy: either keep base coefficients and apply calibration once, or keep calibrated coefficients and do not apply an additional embodied-energy adjustment factor.
| total_ee = apply_chen_calibration(total_ee_raw, 'embodied_energy') | |
| # COEFFICIENTS are already Chen-calibrated; avoid applying embodied-energy calibration twice. | |
| total_ee = total_ee_raw |
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total_carbon_raw is computed from EMISSION_FACTORS that are already documented as Chen-calibrated, but it is then overwritten with apply_chen_calibration(..., 'embodied_carbon'). This likely double-applies calibration and will inflate embodied carbon (and thus total CO₂) relative to the Chen benchmark totals used elsewhere in the app. Consider removing the extra embodied_carbon calibration here (or switching emission factors back to uncalibrated values and calibrating only once).
| total_carbon_raw = apply_chen_calibration(total_carbon_raw, 'embodied_carbon') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHEN_2022_BENCHMARK['system_parameters']['lifetime_years']was changed to 50, which appears to be the tool’s assessment lifetime rather than the Chen 2022 benchmark lifetime. In this repo the benchmark metadata elsewhere still uses 100 years (see SD_LCA_LCCA_Enhanced.py), so this update risks misrepresenting the Chen reference and confusing validation. Consider keeping the benchmark lifetime aligned with the source (or the existing benchmark metadata) and usingASSESSMENT_LIFETIME_YEARSonly for the tool’s configurable assessment horizon.