Conversation
8 tasks
This reverts commit 16e7c1f.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a refactor the the
demand_sharemodule which I think makes the code more readable and leaves less room for bugs. It also removes legacy code to do with the "forecast" feature, as we now only have the current year and investment year.Main changes:
Most functions in this module were previously taking "year" and "forecast" as arguments, along with a
marketobject that should cover this time period. We're getting rid of the forecast feature, so the forecast year is essentially always the investment year. We can then simplify this the code by extracting the year range from the market object: the first year is the current year, and the second year is the investment year.As a result, there is less need for interpolation in some places as the market object always covers the appropriate years. This is good, as I think we should rely on interpolation sparingly (as this is essentially making up data), and be super explicit when we do need to interpolate.
There are also checks in place to ensure that object dimensions are as expected:
I've moved
decommissioning_demandto thedemand_sharemodule as this seems like a more sensible place for it to belongI've updated the tests, but they're still a mess to be honest and could do with a complete rewrite
In working through this I spotted a bug which I've market with a TODO - I'll fix this in a separate PR as I wanted this PR to be a pure refactor (not changing any results)