Limit prices used for objectives to investment year #602
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
See first two points in this comment. We want objectives to use the investment year commodity prices, and only these prices, when calculating current and future costs.
It's not obvious unless you enter debug mode, but
priceshas a "year" dimension where the first year is the current year and the second year is the investment year (previously the third year would have been the forecast year, if applicable, but I've accidentally broken this, see #603). I'm not entirely happy about selecting based on the index, but it's the best I can do for now without larger refactoring.This is prep work for #556, where all the costs functions have been changed to only accept prices for a single year (which will be broadcast into the future - no interpolation)
@ahawkes Can you confirm that this is correct. i.e. when calculating costs over the lifetime of a technology (e.g. LCOE), we want to always assume flat-forward prices from the investment year - correct?