Skip to content

Conversation

@Bill-Becker
Copy link
Collaborator

@Bill-Becker Bill-Becker commented Mar 3, 2025

This PR adds a bunch of year one after-tax cost outputs and one capital cost output that were added to REopt.jl#after-tax-savings (to be merged into the main branch), and then adds a select number of those outputs along with some updates to the results table spreadsheet to calculate a modified after-tax payback. See the attached example comparison_table.xlsx doc with a highlight of the additions and updates to the table.

comparison_table Example for PR with Notes.xlsx

Not related to the above, this also includes a fix for cooling load:

  • Added a new vector type monthly_fraction in the simulated_load function in julia_src/http.jl.

For reference, this is what GitHub Copilot produced for a PR summary:

======================================
This pull request includes various updates across configuration files, Julia scripts, Django migrations, and model definitions to enhance functionality and improve maintainability. Key changes include updates to docker-compose.yml for better dependency management, modifications to Julia scripts and dependencies, and significant additions and refinements to Django models and migrations.

Configuration Updates

  • Updated docker-compose.yml to use a more robust Julia command for dependency instantiation and script execution. The command now includes Pkg.instantiate() and script inclusion for better dependency handling.

Julia Code and Dependencies

  • Added a new vector type, monthly_fraction, to the vector_types array in julia_src/http.jl for more comprehensive data processing.
  • Updated the REopt dependency in julia_src/Manifest.toml to version 0.51.1, including a new git-tree-sha1.

Django Migrations

  • Introduced several new fields across multiple models (e.g., FinancialOutputs, ElectricTariffOutputs, ElectricUtilityOutputs) to support additional financial and operational metrics, such as year-one costs and peak grid demand. [1] [2] [3] [4] [5] [6] [7]
  • Renamed fields in FinancialOutputs for improved clarity, such as capital_costs_after_incentives_without_macrs to capital_costs_after_non_discounted_incentives_without_macrs.

Django Models

  • Added methods to ElectricUtilityOutputs for calculating and saving peak grid demand (calculate_peak_demand and save). These methods dynamically compute peak values based on input series.
  • Refactored FinancialOutputs to include new fields for year-one operational costs and savings, both before and after tax, enhancing the granularity of financial reporting. [1] [2]

These updates collectively improve the robustness, clarity, and functionality of the codebase, addressing both backend processing and data modeling requirements.

@Bill-Becker Bill-Becker requested a review from bpulluta March 3, 2025 21:57
"key" : "total_electric_utility_costs",
"bau_value" : lambda df: safe_get(df, "outputs.Financial.lifecycle_elecbill_after_tax_bau"),
"scenario_value": lambda df: safe_get(df, "outputs.Financial.lifecycle_elecbill_after_tax")
"bau_value" : lambda df: safe_get(df, "outputs.Financial.lifecycle_elecbill_after_tax_bau") - safe_get(df, "outputs.Financial.lifecycle_export_benefit_after_tax_bau") + safe_get(df, "outputs.CHP.lifecycle_chp_standby_cost_after_tax_bau"),
Copy link
Collaborator

@bpulluta bpulluta Mar 6, 2025

Choose a reason for hiding this comment

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

If you want this to show the formula I would reformulate this, like this for example:

  • Set these to empty strings
        "label"         : "Total Electric Costs ($)",
        "key"           : "total_electric_utility_costs",
        "bau_value": lambda df: "",
        "scenario_value": lambda df: ""
  • Define the values in the table:
        "label"         : "Lifecycle Export After Tax ($)",
        "key"           : "lifecycle_export_after_tax",
        "bau_value": lambda df: "outputs.Financial.lifecycle_export_benefit_after_tax_bau",
        "scenario_value": lambda df: "outputs.Financial.lifecycle_export_benefit_after_tax"

        "label"         : "CHP Lifecycle Standby Cost After Tax($)",
        "key"           : "chp_lifecycle_export_after_tax",
        "bau_value": lambda df: "outputs.CHP.lifecycle_chp_standby_cost_after_tax_bau",
        "scenario_value": lambda df: "outputs.CHP.lifecycle_chp_standby_cost_after_tax"
  • Add it as a formula like this:
"name": "Total Electric Costs ($)",
"formula": lambda col, bau, headers: f'={col}{headers["Lifecycle Export After Tax ($)"] + 2}+{col}{headers["CHP Lifecycle Standby Cost After Tax($)"] + 2}'

didnt focus too much on accuracy but you get the point, same with the others

@Bill-Becker Bill-Becker merged commit 1fed22b into develop Apr 18, 2025
1 check passed
@Bill-Becker Bill-Becker deleted the after-tax-savings branch April 18, 2025 22:08
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.

3 participants