def test_coal_heat_rate_by_unit(pudl_out_mcoe, live_dbs): """Validate Coal Capacity Factors are within reasonable limits.""" if not live_dbs: pytest.skip("Data validation only works with a live PUDL DB.") if pudl_out_mcoe.freq is None: pytest.skip() for args in pv.mcoe_coal_heat_rate: pv.vs_bounds(pudl_out_mcoe.mcoe(), **args)
def test_coal_capacity_factor(pudl_out_mcoe, live_pudl_db): """Validate Coal Capacity Factors are within reasonable limits.""" if not live_pudl_db: raise AssertionError("Data validation only works with a live PUDL DB.") if pudl_out_mcoe.freq is None: pytest.skip() for args in pv.mcoe_coal_capacity_factor: pv.vs_bounds(pudl_out_mcoe.mcoe(), **args)
def test_fuel_cost_per_mmbtu(pudl_out_mcoe, live_dbs): """Verify that fuel costs per mmbtu are reasonable for coal & gas.""" if not live_dbs: pytest.skip("Data validation only works with a live PUDL DB.") # The annual numbers for MCOE costs have too many NA values: if pudl_out_mcoe.freq != "MS": pytest.skip() for args in pv.mcoe_self_fuel_cost_per_mmbtu: pv.vs_self(pudl_out_mcoe.mcoe(), **args) for args in pv.mcoe_fuel_cost_per_mmbtu: pv.vs_bounds(pudl_out_mcoe.mcoe(), **args)
def test_vs_bounds(pudl_out_ferc1, live_pudl_db, cases): """Test distributions of calculated fuel by plant values.""" if not live_pudl_db: raise AssertionError("Data validation only works with a live PUDL DB.") fbp_ferc1 = pudl_out_ferc1.fbp_ferc1() for f in ["gas", "oil", "coal", "waste", "nuclear", "other"]: fbp_ferc1[f"{f}_cost_per_mmbtu"] = ( (fbp_ferc1[f"{f}_fraction_cost"] * fbp_ferc1["fuel_cost"]) / (fbp_ferc1[f"{f}_fraction_mmbtu"] * fbp_ferc1["fuel_mmbtu"])) for case in cases: pv.vs_bounds(fbp_ferc1, **case)
def test_vs_bounds(pudl_out_ferc1, live_dbs, cases): """Test distributions of reported plants_steam_ferc1 columns.""" if not live_dbs: pytest.skip("Data validation only works with a live PUDL DB.") for case in cases: pv.vs_bounds(pudl_out_ferc1.fuel_ferc1(), **case)