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.
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
Plant part updates to fix RMI CI memory issues #1865
Plant part updates to fix RMI CI memory issues #1865
Changes from 19 commits
2fb6948
a9e1cf1
870b45f
e766d8b
81ea97d
6780779
eac2521
bc5257a
049ee55
083f491
aa67d3b
ba47985
f614860
5262aa2
e50bbd3
a654c60
61516db
3d3483d
caf44b1
20fe508
08778c8
c625623
6fb269f
b9197e0
6db9a3c
cef65be
19cd02f
4cc67c1
eb32d7b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
If the ordering isn't informational and duplicates should be prohibited, it might make sense for this to be a
set
rather than alist
. I guess this goes for all of the enums. I wonder if there's some reason that doesn't work.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.
I tried converting all the
list
enums toset
which broke a bunch of stuff because some of the enums are used in for concatenation with a list. Just updated the enums I added (TECH_DESCRIPTIONS
andPLANT_PARTS
) to be sets.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.
Is this list of values stored somewhere else independently, that it can be referenced in case it were to change? I think the home definition should probably be one of:
(side note: if
PLANT_PARTS
were anOrderedDict
I think we could get rid ofPLANT_PARTS_ORDERED
and just usePLANT_PARTS.keys()
directly)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.
I got a circular import error when I tried to import
pudl.analysis.plant_parts_eia.PLANT_PARTS
intopudl.metadata.fields.py
orpudl.metadata.enums.py
. I added PLANT_PARTS as an enum to at least take out the duplication of this list infields.py
.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.
I changed the
PLANT_PARTS
dictionary to anOrderedDict
and removedPLANT_PARTS_ORDERED
.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.
Having very generic column names like this in the global namespace can get confusing. Could it be renamed to be more descriptive / clear about its usage context? Maybe something like
ownership_record_type
?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.
Changed to
ownership_record_type
.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.
As with
appro_part_label
above it would be better if we could refer to the single source of truth for this list directly.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.
See my comment about circular import error.
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.
The
energy_source_code_1
andprime_movers_eia
resource override enum constraints could maybe just be moved to the general entry inFIELD_METADATA
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.
In the database tables these are both constrained by virtue of their FK relationships to the
energy_sources_eia
andprime_movers_eia
coding tables, so adding the enums to the field definitions would be duplicative. But for the purpose of imposing those constraints on this free floating output table it seems like the ENUM constraint makes sense.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.
Ah right, makes sense.