-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Allocate generation_fuel_eia923 table data to generators #785
Conversation
Codecov Report
@@ Coverage Diff @@
## sprint27 #785 +/- ##
============================================
+ Coverage 71.03% 72.18% +1.14%
============================================
Files 42 43 +1
Lines 4957 5071 +114
============================================
+ Hits 3521 3660 +139
+ Misses 1436 1411 -25
Continue to review full report at Codecov.
|
Working on Issue #777
this is a little premature considering the fact that we don't have these years rn...
src/pudl/analysis/mcoe.py
Outdated
gen = pudl_out.gen_eia923() | ||
if pudl_out.fill_net_gen: | ||
gen = pudl_out.gen_allocated() |
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.
Would it make sense to move this conditional logic into a helper function in pudl_out
that would check the status of fill_net_gen
and return the corresponding dataframe?
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.
that is a good idea!
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.
hey @rousik I integrated this logic into pudl_out
as you suggested! I did a little bit of additional column management such that the columns in output of pudl_out.gen_eia923()
is the same whether fill_net_gen
is True or False. let me know what you think!
self._dfs['hr_by_unit'] = pudl.analysis.mcoe.heat_rate_by_unit( | ||
self) | ||
self._dfs['hr_by_unit'] = ( | ||
pudl.analysis.mcoe.heat_rate_by_unit(self) |
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.
Passing self
to some other method sounds like object-oriented design gone wrong. I see that this is not a problem introduced by this PR so I do not expect solution for it here but we should probably consider refactoring the code and eliminate this pattern in the future.
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.
Oh yes, the output/analysis layer needs a big overhaul. They were made originally in the very early days. I have a few ideas for this, but it'd be great to get your input on that when the time comes!
This PR attempts to implement a solution to allocation the data from the generation_feul_eia923 table reported at the plant/fuel/prime_mover level to the plant/gen level. The bulk of this happens inside of
pudl.analysis.allocate_net_gen.py
and is integrated intopudl.analysis.mcoe
andpudl.output.pudltabl
Closes Issue #777.