You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have accumulated several dictionaries of information related to states and provinces in various modules. With the integration of the bulk EIA electricity data it seems like it may finally be worth consolidating them to avoid duplication and ensure that there's a single source of truth with a uniform method of access.
Existing constants to replace
pudl.metadata.enums.US_STATES
pudl.metadata.enums.US_TERRITORIES
pudl.metadata.enums.US_STATES_TERRITORIES
pudl.metadata.enums.CANADA_PROVINCES_TERRITORIES (mapping of abbreviations to names)
pudl.metadata.enums.EPACEMS_STATES (bespoke subset of state & territories applicable only to EPA CEMS data)
pudl.transform.eia.APPROXIMATE_TIMEZONES (state/territory/province to timezone mapping)
pudl.metadata.dfs.STATES (state and census region codes required for bulk EIA data aggregations)
pudl.analysis.state_demand.STATES (state FIPS codes)
zaneselvans
changed the title
Consolidates static state, territory, and province data in one place
Consolidate static state, territory, and province data in one place
Sep 28, 2022
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
We have accumulated several dictionaries of information related to states and provinces in various modules. With the integration of the bulk EIA electricity data it seems like it may finally be worth consolidating them to avoid duplication and ensure that there's a single source of truth with a uniform method of access.
Existing constants to replace
pudl.metadata.enums.US_STATES
pudl.metadata.enums.US_TERRITORIES
pudl.metadata.enums.US_STATES_TERRITORIES
pudl.metadata.enums.CANADA_PROVINCES_TERRITORIES
(mapping of abbreviations to names)pudl.metadata.enums.EPACEMS_STATES
(bespoke subset of state & territories applicable only to EPA CEMS data)pudl.transform.eia.APPROXIMATE_TIMEZONES
(state/territory/province to timezone mapping)pudl.metadata.dfs.STATES
(state and census region codes required for bulk EIA data aggregations)pudl.analysis.state_demand.STATES
(state FIPS codes)Other tasks
political_subdivisions
fields & resource metadatapolitical_subdivisions
into the static table ETLNew table structure
This isn't going to be a well normalized table. It's just a way to look up state-associated attributes. Columns should include:
country_code
(string, primary key): ISO-3166-1 country code (alpha-2 or alpha-3?)country_name
(string, primary key): ISO-3166-1 country namesubdivision_category
(string): ISO-3166-2 subdivision category (e.g. state, district, outlying area, territory, province)subdivision_code
(string): 2-letter subdivision abbreviation (ISO-3166-2 political subdivisions)subdivision_name
(string): full political subdivision name (ISO-3166)state_id_fips
(string): 2-character numerical state FIPS code (or NA if not in the US)region_code_us_census
(string): US Census region abbreviation (or NA if not in the US)timezone
(string): Approximate canonical timezone, (from IANA, e.g.America/New_York
) associated with the political subdivision.is_epacems
(bool): Whether this subdivision is present in the EPA CEMS dataset.The text was updated successfully, but these errors were encountered: