-
Notifications
You must be signed in to change notification settings - Fork 1
Electricity annual revenue profile fix #49
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
Electricity annual revenue profile fix #49
Conversation
…eously replaced with total revenue
self.TotalRevenue.value = self.ElecRevenue.value.copy() | ||
#self.TotalCummRevenue.value = self.ElecCummRevenue.value | ||
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER]: | ||
self.HeatRevenue.value, self.HeatCummRevenue.value = CalculateRevenue( | ||
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value, | ||
model.surfaceplant.HeatkWhProduced.value, self.HeatPrice.value) | ||
self.TotalRevenue.value = self.HeatRevenue.value | ||
self.TotalRevenue.value = self.HeatRevenue.value.copy() | ||
#self.TotalCummRevenue.value = self.HeatCummRevenue.value | ||
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value in [PlantType.ABSORPTION_CHILLER]: | ||
self.CoolingRevenue.value, self.CoolingCummRevenue.value = CalculateRevenue( | ||
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value, | ||
model.surfaceplant.cooling_kWh_Produced.value, self.CoolingPrice.value) | ||
self.TotalRevenue.value = self.CoolingRevenue.value | ||
self.TotalRevenue.value = self.CoolingRevenue.value.copy() |
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.
Adding .copy()
here prevents subsequent changes to self.TotalRevenue
from affecting self.{Elec|Heat|Cooling}Revenue
because self.TotalRevenue
is now a copy of the values instead of a reference to the same object.
1 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 -28.12 -28.12 | ||
2 15.00 2.70 2.70 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 0.76 1.94 -26.18 |
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.
Example file diffs should only change electricity annual revenue column, which I manually verified in full for Fervo Cape Station 3 example and sanity-eyeball-checked for other results.
Fix issue with revenue profile electricity annual revenue being erroneously replaced with total revenue (NREL#342)
Demonstration of fix for
Fervo_Project_Cape-3
: