Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/pudl/extract/ferc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@
"dbf": "f1_dacs_epda",
"xbrl": "summary_of_depreciation_and_amortization_charges_section_a_336",
},
"core_ferc1__yearly_depreciation_changes_sched336": {
"dbf": "f1_edcfu_epda",
"xbrl": "factors_used_in_estimating_depreciation_charges_section_c_336",
},
"core_ferc1__yearly_depreciation_changes_sched219": {
"dbf": "f1_accumdepr_prvsn",
"xbrl": "accumulated_provision_for_depreciation_of_electric_utility_plant_changes_section_a_219",
Expand Down
16 changes: 12 additions & 4 deletions src/pudl/transform/ferc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ class TableIdFerc1(enum.Enum):
OPERATING_EXPENSES = "core_ferc1__yearly_operating_expenses_sched320"
BALANCE_SHEET_LIABILITIES = "core_ferc1__yearly_balance_sheet_liabilities_sched110"
DEPRECIATION_SUMMARY = "core_ferc1__yearly_depreciation_summary_sched336"
DEPRECIATION_CHANGES = "core_ferc1__yearly_depreciation_changes_sched336"
BALANCE_SHEET_ASSETS = "core_ferc1__yearly_balance_sheet_assets_sched110"
RETAINED_EARNINGS = "core_ferc1__yearly_retained_earnings_sched118"
INCOME_STATEMENTS = "core_ferc1__yearly_income_statements_sched114"
DEPRECIATION_CHANGES = "core_ferc1__yearly_depreciation_changes_sched219"
ACCUMULATED_DEPRECIATION = "core_ferc1__yearly_depreciation_changes_sched219"
Comment on lines +150 to +154
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i lightly wanna rename the 219 to accumulated depreciation bc well thats what ferc calls it. but bc we have the sched### at the end we could have two changes without renaming tables willy nilly ( which ya know no one really likes )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh noooooo

so we called sched 219 "yearly depreciation changes"

but now we want to add sched 336 which is actually called "depreciation changes" by ferc?

so the choices are

  • have two tables with "depreciation changes", one for sched 219 and one for sched 336
  • rename the old table so the names are less confusing for new users, but existing users have to change their code
  • leave 219 alone and call 336 something else

i think you're right that the third one is definitely bad

but i would actually go with option 2 here? we can mea culpa the old bad naming decision in the release notes, and then we'd hew more closely to ferc terminology, which is something that comes up occasionally in the ecosystem survey as something we should fix anyway

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agree.. In an ideal world we would have a deprecation warning for core_ferc1__yearly_depreciation_changes_sched219 and change this to core_ferc1__yearly_accumulated_depreciation_sched219 (bc the table is called: ACCUMULATED PROVISION FOR DEPRECIATION OF ELECTRIC UTILITY PLANT (Account 108))

OPERATING_REVENUES = "core_ferc1__yearly_operating_revenues_sched300"
DEPRECIATION_BY_FUNCTION = "core_ferc1__yearly_depreciation_by_function_sched219"
CASH_FLOWS = "core_ferc1__yearly_cash_flows_sched120"
Expand Down Expand Up @@ -5564,12 +5565,19 @@ def process_xbrl_metadata(
return meta


class DepreciationChangesTableTransformer(Ferc1AbstractTableTransformer):
"""Transformer class for :ref:`core_ferc1__yearly_depreciation_changes_sched219` table."""
class DepreciationChangesTransformer(Ferc1AbstractTableTransformer):
"""Transformer class for :ref:`core_ferc1__yearly_depreciation_changes_sched336` table."""

table_id: TableIdFerc1 = TableIdFerc1.DEPRECIATION_CHANGES
has_unique_record_ids: bool = False


class AccumulatedDepreciationTableTransformer(Ferc1AbstractTableTransformer):
"""Transformer class for :ref:`core_ferc1__yearly_depreciation_changes_sched219` table."""

table_id: TableIdFerc1 = TableIdFerc1.ACCUMULATED_DEPRECIATION
has_unique_record_ids: bool = False

def convert_xbrl_metadata_json_to_df(
self: Self, xbrl_metadata_json
) -> pd.DataFrame:
Expand Down Expand Up @@ -6107,7 +6115,7 @@ class OtherRegulatoryLiabilitiesTableTransformer(Ferc1AbstractTableTransformer):
"core_ferc1__yearly_depreciation_summary_sched336": DepreciationSummaryTableTransformer,
"core_ferc1__yearly_balance_sheet_assets_sched110": BalanceSheetAssetsTableTransformer,
"core_ferc1__yearly_income_statements_sched114": IncomeStatementsTableTransformer,
"core_ferc1__yearly_depreciation_changes_sched219": DepreciationChangesTableTransformer,
"core_ferc1__yearly_depreciation_changes_sched219": AccumulatedDepreciationTableTransformer,
"core_ferc1__yearly_depreciation_by_function_sched219": DepreciationByFunctionTableTransformer,
"core_ferc1__yearly_retained_earnings_sched118": RetainedEarningsTableTransformer,
"core_ferc1__yearly_operating_revenues_sched300": OperatingRevenuesTableTransformer,
Expand Down
42 changes: 42 additions & 0 deletions src/pudl/transform/params/ferc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,48 @@
},
},
},
"core_ferc1__yearly_depreciation_changes_sched336": {
"rename_columns_ferc1": {
"dbf": {
"columns": {
"respondent_id": "utility_id_ferc1_dbf",
"report_year": "report_year",
"spplmnt_num": "spplmnt_num",
"row_number": "row_number",
"row_seq": "row_seq",
"row_prvlg": "row_prvlg",
"depr_plnt_base": "depreciable_plant_base", # $1000s
"est_avg_srvce_lf": "service_life_avg", # est
"net_salvage": "net_salvage", # pct
"apply_depr_rate": "applied_depreciation_rates", # pct
"mrtlty_crv_typ": "mortality_curve_type",
"avg_remaining_lf": "remaining_life_avg",
"acct_num": "account_num",
"report_prd": "report_prd",
}
},
"xbrl": {
"columns": {
"entity_id": "utility_id_ferc1_xbrl",
"report_year": "report_year",
"estimated_depreciation_charges_factors_axis": "depreciation_charges",
"utility_plant_applied_depreciation_rate": "applied_depreciation_rates",
"utility_plant_estimated_average_service_life": "service_life_avg",
"utility_plant_weighted_average_remaining_life": "remaining_life_avg",
"order_number": "order_number",
"mortality_curve_type": "mortality_curve_type",
"account_number_factors_used_in_estimating_depreciation_charges": "account_num",
"depreciable_plant_base": "depreciable_plant_base",
"utility_plant_net_salvage_value_percentage": "net_salvage",
}
},
},
"normalize_strings": {
"account_num": FERC1_STRING_NORM,
"service_life_avg": FERC1_STRING_NORM,
"remaining_life_avg": FERC1_STRING_NORM,
},
},
"core_ferc1__yearly_operating_revenues_sched300": {
"rename_columns_ferc1": {
"duration_xbrl": {
Expand Down
Loading