Skip to content

Fix summary endpt#559

Merged
Bill-Becker merged 6 commits intodevelopfrom
fix-summary-endpt
Jan 10, 2024
Merged

Fix summary endpt#559
Bill-Becker merged 6 commits intodevelopfrom
fix-summary-endpt

Conversation

@Bill-Becker
Copy link
Copy Markdown
Collaborator

  • Fixes an error from the /summary endpoint for off-grid evaluations when there is no ElectricTariffInputs
  • Updates REopt.jl for the HiGHS solver environment

ElectricTariff doesn't exist for off-grid, and this was causing an error when trying to add None's together
@Bill-Becker Bill-Becker requested a review from adfarth January 10, 2024 16:27
Comment thread CHANGELOG.md
Comment thread reoptjl/views.py Outdated
for m in tariffOuts:
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax)
if len(tariffInputs) > 0:
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm curious why we don't just use the outputs year_one_bill_before_tax and year_one_bill_before_tax_bau here, since those are equivalent to the summations done here? I also don't know what exactly year_one_savings_us_dollars is meant to represent but should it include year_one_export_benefit_before_tax?

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.

Good points. the "us_dollars" thing also seems like legacy v2 naming convention - but maybe we kept it instead of updating the web tool. If we changed it to year_one_bill_before_tax - ..._bau, would that include the export benefit? Or do we still need to account for that separately?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We would still need to account for that separately. The year_one_bill_before_tax does not account for the value of exports.

Copy link
Copy Markdown
Collaborator Author

@Bill-Becker Bill-Becker Jan 10, 2024

Choose a reason for hiding this comment

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

Updated to use year_one_bill and included export_benefit

Comment thread reoptjl/views.py Outdated
for m in tariffOuts:
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax)
if len(tariffInputs) > 0:
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_bill_before_tax_bau + m.year_one_export_benefit_before_tax_bau) - (m.year_one_bill_before_tax + m.year_one_export_benefit_before_tax)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Bill-Becker m.year_one_export_benefit_before_tax is actually a positive value if it's a benefit, so we should subtract this here if we want to account for it. However, I wonder if it makes more sense to just use year_one_bill_before_tax until we confirm how the value is used in the UI?

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.

Oops, and I agree - I updated

Copy link
Copy Markdown
Collaborator

@adfarth adfarth left a comment

Choose a reason for hiding this comment

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

Approving and noting that the REopt version will get updated in the highs folder with later updates

@Bill-Becker Bill-Becker merged commit 184a290 into develop Jan 10, 2024
@Bill-Becker Bill-Becker deleted the fix-summary-endpt branch January 10, 2024 22:19
rathod-b pushed a commit that referenced this pull request Feb 27, 2024
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.

2 participants