示例#1
0
def test_no_null_cols_eia(pudl_out_eia, live_pudl_db, cols, df_name):
    """Verify that output DataFrames have no entirely NULL columns."""
    if not live_pudl_db:
        raise AssertionError("Data validation only works with a live PUDL DB.")
    pv.no_null_cols(pudl_out_eia.__getattribute__(df_name)(),
                    cols=cols,
                    df_name=df_name)
示例#2
0
def test_no_null_cols_ferc1(pudl_out_ferc1, live_dbs, cols, df_name):
    """Verify that output DataFrames have no entirely NULL columns."""
    if not live_dbs:
        pytest.skip("Data validation only works with a live PUDL DB.")
    pv.no_null_cols(pudl_out_ferc1.__getattribute__(df_name)(),
                    cols=cols,
                    df_name=df_name)
示例#3
0
def test_no_null_cols_mcoe(pudl_out_mcoe, live_dbs, df_name):
    """Verify that output DataFrames have no entirely NULL columns."""
    if not live_dbs:
        pytest.skip("Data validation only works with a live PUDL DB.")
    if pudl_out_mcoe.freq is None:
        pytest.skip()

    # These are columns that only exist in 2006 and older data, beyond the time
    # for which we can calculate the MCOE:
    deprecated_cols = [
        'distributed_generation', 'energy_source_1_transport_1',
        'energy_source_1_transport_2', 'energy_source_1_transport_3',
        'energy_source_2_transport_1', 'energy_source_2_transport_2',
        'energy_source_2_transport_3', 'owned_by_non_utility',
        'reactive_power_output_mvar', 'summer_capacity_estimate',
        'winter_capacity_estimate'
    ]
    df = pudl_out_mcoe.__getattribute__(df_name)()
    cols = [col for col in df.columns if col not in deprecated_cols]
    pv.no_null_cols(df, cols=cols, df_name=df_name)