Add discounted result calcualtions #238
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have an application where I want to use the
DiscountedCostByTechnology
result variable. However,otoole
does this calculation internally within theTotalDiscountedCost
calculation, and does not print out this data. This PR addresses this.Specifically, in this PR I have:
Broken out the calculations for
DiscountedCapitalInvestment
,DiscountedCostByTechnology
, andDiscountedOperationalCost
into separate functions. When results are calculated, dataframes for each of these are generated, which can be written out in csvs or xlsx.Functions that rely on this data (such as
TotalDiscountedCost
), now use these intermediate dataframes to perform the calculation. This simplifies theTotalDiscountedCost
result calculation quite a bit.Tests for each of
TotalDiscountedCost
,DiscountedCapitalInvestment
,DiscountedCostByTechnology
, andDiscountedOperationalCost
have been added.Updated the setup config file to write out
DiscountedCapitalInvestment
,DiscountedCostByTechnology
, andDiscountedOperationalCost
by default.Additionally, I have
1.1.3
produced identical resultsIMPORTANT NOTE ON THE TOTAL DISCOUNTED COST
I believe otoole is currently following the old (incorrect) objective function definition found in
OSeMOSYS_fast
- it does not account for costs of storage (see this issue ticket for description). However, this has since been corrected with OSeMOSYS PR 81 and 91. This PR does NOT correct this issue, as it only updates implementation details and results stay the same. A new ticket (#237) has been created to address the incorrect calcualtion.Issue Ticket Number
na
Documentation
na