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
Add a static table of political subdivision attributes. #1966
Conversation
Consolidates several dictionaries and enumerations that we had scattered across the codebase into a single static table, with information about states, territories, provinces, etc. Including membership in various geographic aggregations, FIPS codes, etc. In the process, also added a new `ownership_country` column to the `ownership_eia860` table, to clearly differentiate between country and political subdivision information, which was comingled in the state column previously. Closes #1958
Codecov ReportBase: 82.5% // Head: 82.4% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev #1966 +/- ##
=======================================
- Coverage 82.5% 82.4% -0.2%
=======================================
Files 64 64
Lines 7086 7092 +6
=======================================
- Hits 5852 5849 -3
- Misses 1234 1243 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
src/pudl/metadata/enums.py
Outdated
STATE_TO_CENSUS_DIVISION: dict[str, str] = { | ||
x.subdivision_code: x.division_code_us_census | ||
for x in POLITICAL_SUBDIVISIONS.itertuples() | ||
} |
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.
@TrentonBush this is the state to census division (smaller area than census region in the Census nomenclature, even though EIA seems to be calling the census divisions census regions?) that I think you need.
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.
Looks good! I have a couple of questions about the enum tables and one column naming request in POLITICAL_SUBDIVISIONS
Consolidates several dictionaries and enumerations that we had scattered across the codebase into a single static table, with information about states, territories, provinces, etc. Including membership in various geographic aggregations, FIPS codes, etc.
In the process, also added a new
ownership_country
column to theownership_eia860
table, to clearly differentiate between country and political subdivision information, which was comingled in the state column previously.Closes #1958