doc/refactor: improve documentation and usability of investment costs#465
Merged
danielolsen merged 11 commits intodevelopfrom Apr 27, 2021
Merged
doc/refactor: improve documentation and usability of investment costs#465danielolsen merged 11 commits intodevelopfrom
danielolsen merged 11 commits intodevelopfrom
Conversation
BainanXia
reviewed
Apr 26, 2021
rouille
reviewed
Apr 26, 2021
rouille
reviewed
Apr 26, 2021
rouille
reviewed
Apr 26, 2021
rouille
reviewed
Apr 26, 2021
rouille
approved these changes
Apr 26, 2021
BainanXia
approved these changes
Apr 26, 2021
ahurli
reviewed
Apr 26, 2021
| lines.Cost *= calculate_inflation(2010) | ||
| transformers.Cost *= calculate_inflation(2020) | ||
| lines.cost *= calculate_inflation(2010) | ||
| transformers.cost *= calculate_inflation(2020) |
Contributor
There was a problem hiding this comment.
If we're calculating inflation to "today", do we want to update this to 2021? Or better yet, get the current year?
from datetime import datetime
datetime.today().year
Contributor
Author
There was a problem hiding this comment.
The first parameter of calculate_inflation is the start_year, and if the end_year is not specified then we automatically use the latest year for which we have data in powersimdata.design.investment.const.inflation_rate_pct.
| :param bool sum_results: whether to sum series to return total cost. Defaults to | ||
| True. | ||
| :return: (*pandas.Series/float*) -- cost of upgrading HVDC lines, in $USD, | ||
| inflation-adjusted to today. If ``sum_results``, a float is returned, otherwise |
Contributor
There was a problem hiding this comment.
Same as above regarding the hardcoded "today" year in _calculate_single_line_cost.
f64d1fd to
cb1b1cb
Compare
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.
Pull Request doc
Purpose
What the code is doing
"Cost"(AC line calculations) or"CAPEX_total"(plant calculations). This should be more intuitive for the user, who shouldn't have to wade through many unrelated columns when they are really just interested in cost. The indices are still preserved, in case they want to do grouping using more info in the Grid'splantorbranchdata frames. We also update the docstrings for these changed return types.Testing
Existing tests still pass. The refactor of the cost-prioritized upgrades for congested mesh branches has been tested manually, since it is tough to create an automated test due to the instantiation of a base Grid within this algorithm:
(completes successfully)
As far as I can tell, this is the only use of the changed code in this repo that is not already covered by unit tests.
Time estimate
5-10 minutes.