-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix summary endpt #559
Fix summary endpt #559
Conversation
Bill-Becker
commented
Jan 10, 2024
- 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
reoptjl/views.py
Outdated
@@ -855,7 +855,10 @@ def queryset_for_summary(api_metas,summary_dict:dict): | |||
) | |||
if len(tariffOuts) > 0: | |||
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) |
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.
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
?
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.
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?
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.
We would still need to account for that separately. The year_one_bill_before_tax
does not account for the value of exports.
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.
Updated to use year_one_bill
and included export_benefit
reoptjl/views.py
Outdated
@@ -855,7 +855,10 @@ def queryset_for_summary(api_metas,summary_dict:dict): | |||
) | |||
if len(tariffOuts) > 0: | |||
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) |
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.
@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?
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.
Oops, and I agree - I updated
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.
Approving and noting that the REopt version will get updated in the highs folder with later updates