Skip to content

Reorganize emissions info #121#136

Open
urwahah wants to merge 3 commits into
developmentfrom
reorganize-emissions-info-#121
Open

Reorganize emissions info #121#136
urwahah wants to merge 3 commits into
developmentfrom
reorganize-emissions-info-#121

Conversation

@urwahah

@urwahah urwahah commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Fuel switching (and maybe load shifting later on) requires the grid emissions data to be available for loads to site energy calculations. This is a fairly significant revision to the architecture of energy.py so it would be better to review and implement this before I start changing the calculations :-)

To summarize the changes:
Currently:

  1. run_loads_to_site calls loads_to_site_energy, which iterates through the equipment scenarios, and saves the site energy results as a temporary file
  2. run_site_to_source passes those results to site_to_source, which iterates through the emissions scenarios for final source emissions

Proposed:

  1. run_loads_to_site calls loads_to_site_energy
    a. loads_to_site_energy calls grid_emissions, which iterates through the emissions scenarios to return a dataframe containing grid emissions data
    b. loads_to_site_energy iterates over both emissions and equipment scenarios (nested) to calculate site energy
  2. run_site_to_source passes the site energy results file (same as before) to site_to_source, which iterates through the emissions scenarios for final source emissions

@urwahah urwahah requested a review from t-kramer July 10, 2026 05:20
Comment thread src/energy.py
results.append(df)

total_emissions_kg = sum(r[Col.TOTAL_EMISSIONS_KG_CO2E.value].sum() for r in results)
total_emissions_kg = df[Col.TOTAL_EMISSIONS_KG_CO2E.value].sum()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated but i changed this because it was doing a cumulative sum of all emissions scenarios which didn't seem helpful to me. now it outputs the total emissions for each scenario - still summed up for all equipment scenarios, but better for a high level check i suppose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant