Skip to content

Commit

Permalink
Merge branch 'rename-core-assets' into rename-eia-output-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
bendnorman committed Sep 18, 2023
2 parents ac79bd5 + 0a912e4 commit 325fb52
Show file tree
Hide file tree
Showing 9 changed files with 1,516 additions and 171 deletions.
12 changes: 6 additions & 6 deletions devtools/python-output-table-conversion-debug.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
"\n",
"You can create an asset by creating a new function and adding the `@asset` decorator. For now, the only attribute you should add to the decorator is the `compute_type = \"Python\"`. All this does is add a cute tag to the asset in the dag to let people know how the asset is being processed.\n",
"\n",
"Next you'll want to figure out what tables the output table depends on. Read through the old output function to see which normalized tables or output functions are being used as inputs to the joins and imputations. Once you have the input table names, add them to the asset function parameters. For example, the `utilities_eia860()` function merges `utilities_entity_eia`, `utilities_eia860`, and `utilities_eia` tables together so the asset would look like this:\n",
"Next you'll want to figure out what tables the output table depends on. Read through the old output function to see which normalized tables or output functions are being used as inputs to the joins and imputations. Once you have the input table names, add them to the asset function parameters. For example, the `utilities_eia860()` function merges `core_eia__entity_utilities`, `core_eia860__scd_utilities`, and `core_pudl__assn_utilities_eia` tables together so the asset would look like this:\n",
"\n",
"```python\n",
"@asset(compute_kind=\"Python\")\n",
"def denorm_utilities_eia860(\n",
" utilities_entity_eia: pd.DataFrame,\n",
" utilities_eia860: pd.DataFrame,\n",
" utilities_eia: pd.DataFrame,\n",
" core_eia__entity_utilities: pd.DataFrame,\n",
" core_eia860__scd_utilities: pd.DataFrame,\n",
" core_pudl__assn_utilities_eia: pd.DataFrame,\n",
"):\n",
" ... # joining logic\n",
" return joined_df\n",
Expand Down Expand Up @@ -108,9 +108,9 @@
"```python\n",
"@asset(io_manager_key=\"pudl_sqlite_io_manager\", compute_kind=\"Python\")\n",
"def denorm_utilities_eia860(\n",
" utilities_entity_eia: pd.DataFrame,\n",
" core_eia__entity_utilities: pd.DataFrame,\n",
" core_eia860__scd_utilities: pd.DataFrame,\n",
" utilities_eia: pd.DataFrame,\n",
" core_pudl__assn_utilities_eia: pd.DataFrame,\n",
"):\n",
" ... # joining logic\n",
" return joined_df\n",
Expand Down
1,331 changes: 1,331 additions & 0 deletions migrations/versions/1c2c961a7be5_rename_ferc_output_assets.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions notebooks/work-in-progress/better-heatrates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
"* `generation_fuel_eia923`\n",
"* `boiler_generator_assn_eia860`\n",
"* `generators_eia860`\n",
"* `core_eia__entity_generators`\n",
"* `generators_entity_eia`\n",
"* `boiler_fuel_eia923`"
]
},
Expand Down Expand Up @@ -681,7 +681,7 @@
" prime_mover_code,\n",
" bypass_heat_recovery,\n",
" associated_combined_heat_and_power,\n",
"FROM core_eia__entity_generators\n",
"FROM generators_entity_eia\n",
"\"\"\"\n",
"\n",
"gen_eia923_sql = \"\"\"\n",
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 @@ -65,7 +65,7 @@
[pudl.analysis.allocate_gen_fuel], group_name="allocate_gen_fuel"
),
*load_assets_from_modules([pudl.analysis.mcoe], group_name="mcoe"),
*load_assets_from_modules([pudl.output.ferc1], group_name="denorm_ferc1"),
*load_assets_from_modules([pudl.output.ferc1], group_name="out_ferc1"),
*load_assets_from_modules(
[pudl.analysis.service_territory], group_name="service_territory_eia861"
),
Expand Down
52 changes: 26 additions & 26 deletions src/pudl/metadata/resources/ferc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@
"etl_group": "ferc1",
"field_namespace": "ferc1",
},
"denorm_plants_utilities_ferc1": {
"_out_ferc1__yearly_plants_utilities": {
"description": "Denormalized table that contains FERC plant and utility information.",
"schema": {
"fields": [
Expand All @@ -847,7 +847,7 @@
"etl_group": "outputs",
"sources": ["ferc1"],
},
"denorm_balance_sheet_assets_ferc1": {
"out_ferc1__yearly_balance_sheet_assets": {
"description": "Denormalized table that contains FERC balance sheet asset information.",
"schema": {
"fields": [
Expand All @@ -873,7 +873,7 @@
"etl_group": "outputs",
"sources": ["ferc1"],
},
"denorm_balance_sheet_liabilities_ferc1": {
"out_ferc1__yearly_balance_sheet_liabilities": {
"description": "Denormalized table that contains FERC balance sheet liability information.",
"schema": {
"fields": [
Expand All @@ -899,7 +899,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_cash_flow_ferc1": {
"out_ferc1__yearly_cash_flow": {
"description": "Denormalized table that contains FERC cash flow information.",
"schema": {
"fields": [
Expand All @@ -923,7 +923,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_depreciation_amortization_summary_ferc1": {
"out_ferc1__yearly_depreciation_amortization_summary": {
"description": "Denormalized table that contains FERC depreciation amortization information.",
"schema": {
"fields": [
Expand All @@ -948,7 +948,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electric_energy_dispositions_ferc1": {
"out_ferc1__yearly_electric_energy_dispositions": {
"description": "Denormalized table that contains FERC electric energy dispositions information.",
"schema": {
"fields": [
Expand All @@ -971,7 +971,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electric_energy_sources_ferc1": {
"out_ferc1__yearly_electric_energy_sources": {
"description": "Denormalized table that contains FERC electric energy sources information.",
"schema": {
"fields": [
Expand All @@ -994,7 +994,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electric_operating_expenses_ferc1": {
"out_ferc1__yearly_electric_operating_expenses": {
"description": "Denormalized table that contains FERC electric operating expense information.",
"schema": {
"fields": [
Expand All @@ -1014,7 +1014,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electric_operating_revenues_ferc1": {
"out_ferc1__yearly_electric_operating_revenues": {
"description": "Denormalized table that contains FERC electric operating revenue information.",
"schema": {
"fields": [
Expand All @@ -1040,7 +1040,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electric_plant_depreciation_changes_ferc1": {
"out_ferc1__yearly_electric_plant_depreciation_changes": {
"description": "Denormalized table that contains FERC electric plant depreciation changes information.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1069,7 +1069,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electric_plant_depreciation_functional_ferc1": {
"out_ferc1__yearly_electric_plant_depreciation_functional": {
"description": "Denormalized table that contains FERC electric plant depreciation functional information.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1098,7 +1098,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_electricity_sales_by_rate_schedule_ferc1": {
"out_ferc1__yearly_electricity_sales_by_rate_schedule": {
"description": "Denormalized table that contains FERC electricity sales by rate schedule information.",
"schema": {
"fields": [
Expand All @@ -1121,7 +1121,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_income_statement_ferc1": {
"out_ferc1__yearly_income_statement": {
"description": "Denormalized table that contains FERC income statement information.",
"schema": {
"fields": [
Expand All @@ -1148,7 +1148,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_other_regulatory_liabilities_ferc1": {
"out_ferc1__yearly_other_regulatory_liabilities": {
"description": "Denormalized table that contains FERC other regulatory liabilities information.",
"schema": {
"fields": [
Expand All @@ -1168,7 +1168,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_retained_earnings_ferc1": {
"out_ferc1__yearly_retained_earnings": {
"description": "Denormalized table that contains FERC retained earnings information.",
"schema": {
"fields": [
Expand All @@ -1194,7 +1194,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_transmission_statistics_ferc1": {
"out_ferc1__yearly_transmission_statistics": {
"description": "Denormalized table that contains FERC transmission statistics information.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1225,7 +1225,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_utility_plant_summary_ferc1": {
"out_ferc1__yearly_utility_plant_summary": {
"description": "Denormalized table that contains FERC utility plant summary information.",
"schema": {
"fields": [
Expand All @@ -1251,7 +1251,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_plants_steam_ferc1": {
"_out_ferc1__yearly_steam_plants": {
"description": "Denormalized table that contains steam plant information from FERC Form 1.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1319,7 +1319,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_plants_small_ferc1": {
"_out_ferc1__yearly_small_plants": {
"description": "Denormalized table that contains small plant information from FERC Form 1.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1354,7 +1354,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_plants_hydro_ferc1": {
"_out_ferc1__yearly_hydro_plants": {
"description": "Denormalized table that contains small plant information from FERC Form 1.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1409,7 +1409,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_plants_pumped_storage_ferc1": {
"_out_ferc1__yearly_pumped_storage_plants": {
"description": "Denormalized table that contains pumped storage plant information from FERC Form 1.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1468,7 +1468,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_fuel_ferc1": {
"out_ferc1__yearly_fuel": {
"description": "Denormalized table that contains fuel information from FERC Form 1.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1497,7 +1497,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_purchased_power_ferc1": {
"out_ferc1__yearly_purchased_power": {
"description": "Denormalized table of FERC Form 1 Purchased Power data.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1525,7 +1525,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_plant_in_service_ferc1": {
"out_ferc1__yearly_plant_in_service": {
"description": "Denormalized table of FERC Form 1 Electric Plant in Service data.",
"schema": {
"fields": [
Expand All @@ -1550,7 +1550,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_plants_all_ferc1": {
"out_ferc1__yearly_all_plants": {
"description": "Denormalized table combining the steam, small generators, hydro, and pumped storage tables from FERC Form 1.",
"schema": {
"fields": [
Expand Down Expand Up @@ -1639,7 +1639,7 @@
"etl_group": "outputs",
"field_namespace": "ferc1",
},
"denorm_fuel_by_plant_ferc1": {
"out_ferc1__yearly_fuel_by_plant": {
"description": "A table summarizing FERC fuel data by plant, using FERC Form 1 data.",
"schema": {
"fields": [
Expand Down
Loading

0 comments on commit 325fb52

Please sign in to comment.