bf7f740f3d6e2d419567109e2fdb0e264e3ad913,src/pudl/transform/ferc1.py,,_plants_steam_clean,#Any#,324

Before Change


        // Take the messy free-form construction_type and plant_kind fields, and
        // do our best to map them to some canonical categories... this is
        // necessarily imperfect:
        pipe(pudl.helpers.cleanstrings, ["type_const", "plant_kind"],
             [pc.ferc1_const_type_strings, pc.ferc1_plant_kind_strings],
             unmapped="")
    )

    // Force the construction and installation years to be numeric values, and
    // set them to NA if they can"t be converted. (table has some junk values)
    ferc1_steam_df["yr_const"] = pd.to_numeric(
        ferc1_steam_df["yr_const"], errors="coerce")
    ferc1_steam_df["yr_installed"] = pd.to_numeric(
        ferc1_steam_df["yr_installed"], errors="coerce")
    // There are also a few zeroes... which are not valid years for us:
    ferc1_steam_df = ferc1_steam_df.replace(
        {"yr_const": 0, "yr_installed": 0}, np.nan)

    // Converting everything to per MW and MWh units...
    ferc1_steam_df["cost_per_mw"] = 1000 * ferc1_steam_df["cost_per_kw"]
    ferc1_steam_df.drop("cost_per_kw", axis=1, inplace=True)
    ferc1_steam_df["net_generation_mwh"] = ferc1_steam_df["net_generation"] / 1000
    ferc1_steam_df.drop("net_generation", axis=1, inplace=True)
    ferc1_steam_df["expns_per_mwh"] = 1000 * ferc1_steam_df["expns_kwh"]

After Change



def _plants_steam_clean(ferc1_steam_df):
    ferc1_steam_df = (
        ferc1_steam_df.rename(columns={
            "plant_name": "plant_name_ferc1",
            "yr_const": "construction_year",
            "plant_kind": "plant_type",
            "type_const": "construction_type",
            "asset_retire_cost": "asset_retirement_cost",
            "yr_installed": "installation_year",
            "tot_capacity": "capacity_mw",
            "peak_demand": "peak_demand_mw",
            "plant_hours": "plant_hours_connected_while_generating",
            "plnt_capability": "plant_capability_mw",
            "when_limited": "water_limited_capacity_mw",
            "when_not_limited": "not_water_limited_capacity_mw",
            "avg_num_of_emp": "avg_num_employees",
            "net_generation": "net_generation_kwh",
            "cost_land": "capex_land",
            "cost_structure": "capex_structures",
            "cost_equipment": "capex_equipment",
            "cost_of_plant_to": "capex_total",
            "cost_per_kw": "capex_per_kw",
            "expns_operations": "opex_operations",
            "expns_fuel": "opex_fuel",
            "expns_coolants": "opex_coolants",
            "expns_steam": "opex_steam",
            "expns_steam_othr": "opex_steam_other",
            "expns_transfer": "opex_transfer",
            "expns_electric": "opex_electric",
            "expns_misc_power": "opex_misc_power",
            "expns_rents": "opex_rents",
            "expns_allowances": "opex_allowances",
            "expns_engnr": "opex_engineering",
            "expns_structures": "opex_structures",
            "expns_boiler": "opex_boiler",
            "expns_plants": "opex_plants",
            "expns_misc_steam": "opex_misc_steam",
            "tot_prdctn_expns": "opex_production_total",
            "expns_kwh": "opex_per_kwh"})
        .pipe(_clean_cols, "f1_steam")
        .pipe(pudl.helpers.strip_lower, ["plant_name"])
        .pipe(pudl.helpers.cleanstrings,
              ["construction_type", "plant_type"],
              [pc.ferc1_const_type_strings, pc.ferc1_plant_kind_strings],
              unmapped="")
        .pipe(oob_to_nan, cols=["construction_year", "installation_year"],
              lb=1850, ub=max(pc.working_years["ferc1"]) + 1)
        .assign(
            capex_per_mw=lambda x: 1000.0 * x.capex_per_kw,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: catalyst-cooperative/pudl
Commit Name: bf7f740f3d6e2d419567109e2fdb0e264e3ad913
Time: 2019-11-16
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/ferc1.py
Class Name:
Method Name: _plants_steam_clean


Project Name: catalyst-cooperative/pudl
Commit Name: 5b9a65c9301ca033f24da90f047c20c6d63533c4
Time: 2020-06-08
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/eia861.py
Class Name:
Method Name: sales


Project Name: catalyst-cooperative/pudl
Commit Name: fbd16b4f301f09b8868b60a4762700f3251e2cdc
Time: 2019-12-05
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/ferc1.py
Class Name:
Method Name: plant_in_service


Project Name: catalyst-cooperative/pudl
Commit Name: 27939af84f8bd78f8d15cc8719a3dec45b8c1284
Time: 2020-10-20
Author: cgosnell@catalyst.coop
File Name: src/pudl/analysis/allocate_net_gen.py
Class Name:
Method Name: allocate_gen_fuel_by_gen_pm_fuel