Skip to content

Commit

Permalink
Merge pull request #2858 from catalyst-cooperative/rename-eia-output-…
Browse files Browse the repository at this point in the history
…assets

Rename EIA denorm assets
  • Loading branch information
bendnorman authored Sep 19, 2023
2 parents 0a912e4 + a2042de commit 8b468db
Show file tree
Hide file tree
Showing 15 changed files with 1,751 additions and 144 deletions.
2 changes: 1 addition & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Data Coverage

* :ref:`core_eia860__scd_emissions_control_equipment`, see issue :issue:`2338` & PR
:pr:`2561`.
* :ref:`denorm_emissions_control_equipment_eia860`, see issue :issue:`2338` & PR
* :ref:`out_eia860__yearly_emissions_control_equipment`, see issue :issue:`2338` & PR
:pr:`2561`.
* :ref:`core_eia860__yearly_boiler_emissions_control_equipment_assn`, see
:issue:`2338` & PR :pr:`2561`.
Expand Down
1,607 changes: 1,607 additions & 0 deletions migrations/versions/b3eb1a80721c_rename_eia_output_assets.py

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/pudl/analysis/allocate_gen_fuel.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ def allocate_gen_fuel_asset_factory(
name=f"generation_fuel_by_generator_energy_source_{agg_freqs[freq]}_eia923",
ins={
"gf": AssetIn(
key=f"denorm_generation_fuel_combined_{agg_freqs[freq]}_eia923"
key=f"out_eia923__{agg_freqs[freq]}_generation_fuel_combined"
),
"bf": AssetIn(key=f"denorm_boiler_fuel_{agg_freqs[freq]}_eia923"),
"gen": AssetIn(key=f"denorm_generation_{agg_freqs[freq]}_eia923"),
"bf": AssetIn(key=f"out_eia923__{agg_freqs[freq]}_boiler_fuel"),
"gen": AssetIn(key=f"out_eia923__{agg_freqs[freq]}_generation"),
"bga": AssetIn(key="core_eia860__assn_boiler_generator"),
"gens": AssetIn(key="denorm_generators_eia"),
"gens": AssetIn(key="out_eia__yearly_generators"),
},
io_manager_key=io_manager_key,
compute_kind="Python",
Expand Down Expand Up @@ -261,7 +261,7 @@ def gen_fuel_by_gen_esc(
"net_gen_fuel_alloc": AssetIn(
key=f"generation_fuel_by_generator_energy_source_{agg_freqs[freq]}_eia923"
),
"pu": AssetIn(key="denorm_plants_utilities_eia"),
"pu": AssetIn(key="_out_eia__plants_utilities"),
"bga": AssetIn(key="core_eia860__assn_boiler_generator"),
},
io_manager_key=io_manager_key,
Expand All @@ -277,7 +277,7 @@ def gen_fuel_by_gen(
net_gen_fuel_alloc=net_gen_fuel_alloc,
sum_cols=DATA_COLUMNS,
)
# make the output resemble denorm_generation_eia923:
# make the output resemble out_eia923__generation:
.pipe(pudl.output.eia923.denorm_by_gen, pu=pu, bga=bga)
)

Expand All @@ -287,8 +287,8 @@ def gen_fuel_by_gen(
"net_gen_fuel_alloc": AssetIn(
key=f"generation_fuel_by_generator_energy_source_{agg_freqs[freq]}_eia923"
),
"gens": AssetIn(key="denorm_generators_eia"),
"own_eia860": AssetIn(key="denorm_ownership_eia860"),
"gens": AssetIn(key="out_eia__yearly_generators"),
"own_eia860": AssetIn(key="out_eia860__yearly_ownership"),
},
io_manager_key=io_manager_key,
compute_kind="Python",
Expand Down Expand Up @@ -348,7 +348,7 @@ def allocate_gen_fuel_by_generator_energy_source(
net generation from the :ref:`core_eia923__monthly_generation_fuel` table.
Args:
gf: Temporally aggregated :ref:`denorm_generation_fuel_combined_eia923` dataframe.
gf: Temporally aggregated :ref:`out_eia923__generation_fuel_combined` dataframe.
bf: Temporally aggregated :ref:`core_eia923__monthly_boiler_fuel` dataframe.
gen: Temporally aggregated :ref:`core_eia923__monthly_generation` dataframe.
bga: :ref:`core_eia860__assn_boiler_generator` dataframe.
Expand Down
10 changes: 5 additions & 5 deletions src/pudl/analysis/mcoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def hr_by_unit_asset(gen: pd.DataFrame, bga: pd.DataFrame) -> pd.DataFrame:
ins={
"bga": AssetIn(key="core_eia860__assn_boiler_generator"),
"hr_by_unit": AssetIn(key=f"heat_rate_by_unit_{agg_freqs[freq]}"),
"gens": AssetIn(key="denorm_generators_eia"),
"gens": AssetIn(key="out_eia__yearly_generators"),
},
io_manager_key=io_manager_key,
compute_kind="Python",
Expand All @@ -81,8 +81,8 @@ def hr_by_gen_asset(
name=f"fuel_cost_by_generator_{agg_freqs[freq]}",
ins={
"hr_by_gen": AssetIn(key=f"heat_rate_by_generator_{agg_freqs[freq]}"),
"gens": AssetIn(key="denorm_generators_eia"),
"frc": AssetIn(key=f"denorm_fuel_receipts_costs_{agg_freqs[freq]}_eia923"),
"gens": AssetIn(key="out_eia__yearly_generators"),
"frc": AssetIn(key=f"out_eia923__{agg_freqs[freq]}_fuel_receipts_costs"),
},
io_manager_key=io_manager_key,
compute_kind="Python",
Expand All @@ -98,7 +98,7 @@ def fc_asset(
"gen": AssetIn(
key=f"generation_fuel_by_generator_{agg_freqs[freq]}_eia923"
),
"gens": AssetIn(key="denorm_generators_eia"),
"gens": AssetIn(key="out_eia__yearly_generators"),
},
io_manager_key=io_manager_key,
compute_kind="Python",
Expand Down Expand Up @@ -172,7 +172,7 @@ def mcoe_asset(
name=f"mcoe_generators_{agg_freqs[freq]}",
ins={
"mcoe": AssetIn(key=f"mcoe_{agg_freqs[freq]}"),
"gens": AssetIn(key="denorm_generators_eia"),
"gens": AssetIn(key="out_eia__yearly_generators"),
},
io_manager_key=io_manager_key,
compute_kind="Python",
Expand Down
18 changes: 10 additions & 8 deletions src/pudl/analysis/service_territory.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def utility_ids_all_eia(
denorm_utilities_eia: pd.DataFrame,
out_eia__yearly_utilities: pd.DataFrame,
core_eia861__yearly_service_territory: pd.DataFrame,
) -> pd.DataFrame:
"""Compile IDs and Names of all known EIA Utilities.
Expand All @@ -43,7 +43,7 @@ def utility_ids_all_eia(
process and PUDL database yet.
Args:
denorm_utilities_eia: De-normalized EIA 860 utility attributes table.
out_eia__yearly_utilities: De-normalized EIA 860 utility attributes table.
core_eia861__yearly_service_territory: Normalized EIA 861 Service Territory table.
Returns:
Expand All @@ -52,7 +52,7 @@ def utility_ids_all_eia(
return (
pd.concat(
[
denorm_utilities_eia[["utility_id_eia", "utility_name_eia"]],
out_eia__yearly_utilities[["utility_id_eia", "utility_name_eia"]],
core_eia861__yearly_service_territory[
["utility_id_eia", "utility_name_eia"]
],
Expand Down Expand Up @@ -279,7 +279,7 @@ def _save_geoparquet(gdf, entity_type, dissolve, limit_by_state):
def compile_geoms(
core_eia861__yearly_balancing_authority: pd.DataFrame,
core_eia861__assn_balancing_authority: pd.DataFrame,
denorm_utilities_eia: pd.DataFrame,
out_eia__yearly_utilities: pd.DataFrame,
core_eia861__yearly_service_territory: pd.DataFrame,
core_eia861__assn_utility: pd.DataFrame,
census_counties: pd.DataFrame,
Expand All @@ -303,7 +303,7 @@ def compile_geoms(
)

utilids_all_eia = utility_ids_all_eia(
denorm_utilities_eia, core_eia861__yearly_service_territory
out_eia__yearly_utilities, core_eia861__yearly_service_territory
)

if entity_type == "ba":
Expand Down Expand Up @@ -386,7 +386,7 @@ def dagster_compile_geoms(
context,
core_eia861__yearly_balancing_authority: pd.DataFrame,
core_eia861__assn_balancing_authority: pd.DataFrame,
denorm_utilities_eia: pd.DataFrame,
out_eia__yearly_utilities: pd.DataFrame,
core_eia861__yearly_service_territory: pd.DataFrame,
core_eia861__assn_utility: pd.DataFrame,
core_censusdp1__entity_county: pd.DataFrame,
Expand All @@ -404,7 +404,7 @@ def dagster_compile_geoms(
return compile_geoms(
core_eia861__yearly_balancing_authority=core_eia861__yearly_balancing_authority,
core_eia861__assn_balancing_authority=core_eia861__assn_balancing_authority,
denorm_utilities_eia=denorm_utilities_eia,
out_eia__yearly_utilities=out_eia__yearly_utilities,
core_eia861__yearly_service_territory=core_eia861__yearly_service_territory,
core_eia861__assn_utility=core_eia861__assn_utility,
census_counties=core_censusdp1__entity_county,
Expand Down Expand Up @@ -605,7 +605,9 @@ def main():
core_eia861__assn_balancing_authority=pd.read_sql(
"core_eia861__assn_balancing_authority", pudl_engine
),
denorm_utilities_eia=pd.read_sql(AssetKey("denorm_utilities_eia")),
out_eia__yearly_utilities=pd.read_sql(
AssetKey("out_eia__yearly_utilities")
),
core_eia861__yearly_service_territory=pd.read_sql(
AssetKey("core_eia861__yearly_service_territory")
),
Expand Down
2 changes: 1 addition & 1 deletion src/pudl/etl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
pudl.output.eia923,
pudl.output.eia_bulk_elec,
],
group_name="denorm_eia",
group_name="out_eia",
),
*load_assets_from_modules(
[pudl.analysis.allocate_gen_fuel], group_name="allocate_gen_fuel"
Expand Down
10 changes: 5 additions & 5 deletions src/pudl/metadata/resources/eia.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@
"etl_group": "entity_eia",
"field_namespace": "eia",
},
"denorm_utilities_eia": {
"out_eia__yearly_utilities": {
"description": ("Denormalized table containing all EIA utility attributes."),
"schema": {
"fields": [
Expand Down Expand Up @@ -774,7 +774,7 @@
"sources": ["eia860", "eia923"],
"etl_group": "outputs",
},
"denorm_plants_eia": {
"out_eia__yearly_plants": {
"description": ("Denormalized table containing all EIA plant attributes."),
"schema": {
"fields": [
Expand Down Expand Up @@ -839,7 +839,7 @@
"sources": ["eia860", "eia923"],
"etl_group": "outputs",
},
"denorm_plants_utilities_eia": {
"_out_eia__plants_utilities": {
"description": (
"Denormalized table containing all plant and utility IDs and names from EIA."
),
Expand All @@ -859,7 +859,7 @@
"sources": ["eia860", "eia923"],
"etl_group": "outputs",
},
"denorm_boilers_eia": {
"out_eia__yearly_boilers": {
"description": ("Denormalized table containing all EIA boiler attributes."),
"schema": {
"fields": [
Expand Down Expand Up @@ -977,7 +977,7 @@
"sources": ["eia860", "eia923"],
"etl_group": "outputs",
},
"denorm_generators_eia": {
"out_eia__yearly_generators": {
"description": ("Denormalized table containing all EIA generator attributes."),
"schema": {
"fields": [
Expand Down
44 changes: 22 additions & 22 deletions src/pudl/metadata/resources/eia860.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
# See: https://github.com/catalyst-cooperative/pudl/issues/1196
"exclude": [
"core_eia923__monthly_boiler_fuel",
"denorm_boiler_fuel_eia923",
"denorm_boiler_fuel_monthly_eia923",
"out_eia923__boiler_fuel",
"out_eia923__monthly_boiler_fuel",
],
},
},
Expand Down Expand Up @@ -229,8 +229,8 @@
"exclude": [
"core_eia923__monthly_boiler_fuel",
"capacity_factor_by_generator_monthly",
"denorm_generation_eia923",
"denorm_generation_monthly_eia923",
"out_eia923__generation",
"out_eia923__monthly_generation",
"fuel_cost_by_generator_monthly",
"core_eia923__monthly_fuel_receipts_costs",
"core_eia923__monthly_generation",
Expand Down Expand Up @@ -279,7 +279,7 @@
"sources": ["eia860"],
"etl_group": "eia860",
},
"denorm_ownership_eia860": {
"out_eia860__yearly_ownership": {
"description": (
"Generator Ownership, reported in EIA-860 Schedule 4. Includes only "
"jointly or third-party owned generators. Denormalized to include plant "
Expand Down Expand Up @@ -374,14 +374,14 @@
# See: https://github.com/catalyst-cooperative/pudl/issues/1196
"exclude": [
"core_eia923__monthly_boiler_fuel",
"denorm_boiler_fuel_eia923",
"denorm_boiler_fuel_monthly_eia923",
"denorm_fuel_receipts_costs_eia923",
"denorm_fuel_receipts_costs_monthly_eia923",
"denorm_generation_eia923",
"denorm_generation_monthly_eia923",
"denorm_generation_fuel_combined_eia923",
"denorm_generation_fuel_combined_monthly_eia923",
"out_eia923__boiler_fuel",
"out_eia923__monthly_boiler_fuel",
"out_eia923__fuel_receipts_costs",
"out_eia923__monthly_fuel_receipts_costs",
"out_eia923__generation",
"out_eia923__monthly_generation",
"out_eia923__generation_fuel_combined",
"out_eia923__monthly_generation_fuel_combined",
"generation_fuel_by_generator_energy_source_monthly_eia923",
"generation_fuel_by_generator_monthly_eia923",
"core_eia923__monthly_fuel_receipts_costs",
Expand Down Expand Up @@ -456,14 +456,14 @@
"core_eia861__yearly_demand_side_management_ee_dr",
"core_eia861__yearly_demand_side_management_misc",
"core_eia861__yearly_demand_side_management_sales",
"denorm_boiler_fuel_eia923",
"denorm_boiler_fuel_monthly_eia923",
"denorm_fuel_receipts_costs_eia923",
"denorm_fuel_receipts_costs_monthly_eia923",
"denorm_generation_eia923",
"denorm_generation_monthly_eia923",
"denorm_generation_fuel_combined_eia923",
"denorm_generation_fuel_combined_monthly_eia923",
"out_eia923__boiler_fuel",
"out_eia923__monthly_boiler_fuel",
"out_eia923__fuel_receipts_costs",
"out_eia923__monthly_fuel_receipts_costs",
"out_eia923__generation",
"out_eia923__monthly_generation",
"out_eia923__generation_fuel_combined",
"out_eia923__monthly_generation_fuel_combined",
"fuel_cost_by_generator_monthly",
"generation_fuel_by_generator_energy_source_monthly_eia923",
"generation_fuel_by_generator_monthly_eia923",
Expand Down Expand Up @@ -533,7 +533,7 @@
"sources": ["eia860"],
"etl_group": "eia860",
},
"denorm_emissions_control_equipment_eia860": {
"out_eia860__yearly_emissions_control_equipment": {
"description": (
"""The cost, type, operating status, retirement date, and install year of
emissions control equipment reported to EIA. Includes control ids for sulfur dioxide
Expand Down
Loading

0 comments on commit 8b468db

Please sign in to comment.