Пример #1
0
def pudl_out_orig(live_pudl_db, pudl_engine):
    """Create an unaggregated PUDL output object for checking raw data."""
    if not live_pudl_db:
        raise AssertionError("Output tests only work with a live PUDL DB.")
    return PudlTabl(pudl_engine=pudl_engine,
                    start_date=START_DATE_EIA,
                    end_date=END_DATE_EIA)
Пример #2
0
def pudl_out_ferc1(live_pudl_db, pudl_engine, request):
    """Define parameterized PudlTabl output object fixture for FERC 1 tests."""
    if not live_pudl_db:
        raise AssertionError("Output tests only work with a live PUDL DB.")
    return PudlTabl(pudl_engine=pudl_engine,
                    start_date=START_DATE_FERC1,
                    end_date=END_DATE_FERC1,
                    freq=request.param)
Пример #3
0
def pudl_out_eia(live_dbs, pudl_engine, request):
    """Define parameterized PudlTabl output object fixture for EIA tests."""
    if not live_dbs:
        pytest.skip("Output tests only work with a live PUDL DB.")
    return PudlTabl(
        pudl_engine=pudl_engine,
        freq=request.param,
        fill_fuel_cost=True,
        roll_fuel_cost=True,
        fill_net_gen=False,
    )
Пример #4
0
def pudl_out_eia(live_pudl_db, pudl_engine, request):
    """Define parameterized PudlTabl output object fixture for EIA tests."""
    if not live_pudl_db:
        raise AssertionError("Output tests only work with a live PUDL DB.")
    return PudlTabl(
        pudl_engine=pudl_engine,
        start_date=START_DATE_EIA,
        end_date=END_DATE_EIA,
        freq=request.param,
        fill_fuel_cost=True,
        roll_fuel_cost_=True,
        fill_net_gen=True,
    )
Пример #5
0
def pudl_out_ferc1(live_dbs, pudl_engine, request):
    """Define parameterized PudlTabl output object fixture for FERC 1 tests."""
    if not live_dbs:
        pytest.skip("Output tests only work with a live PUDL DB.")
    return PudlTabl(pudl_engine=pudl_engine, freq=request.param)
Пример #6
0
def pudl_out_orig(live_dbs, pudl_engine):
    """Create an unaggregated PUDL output object for checking raw data."""
    if not live_dbs:
        pytest.skip("Output tests only work with a live PUDL DB.")
    return PudlTabl(pudl_engine=pudl_engine)
Пример #7
0
@pytest.fixture(scope='session')
def live_ferc_db(request):
    """Fixture that tells use which FERC DB to use (live vs. testing)."""
    return request.config.getoption("--live_ferc_db")


@pytest.fixture(scope='session')
def live_pudl_db(request):
    """Fixture that tells use which PUDL DB to use (live vs. testing)."""
    return request.config.getoption("--live_pudl_db")


@pytest.fixture(scope='session',
                params=[
                    PudlTabl(start_date=START_DATE_FERC1,
                             end_date=END_DATE_FERC1,
                             freq='AS',
                             testing=False),
                ],
                ids=['ferc1_annual'])
def pudl_out_ferc1(live_pudl_db, request):
    if not live_pudl_db:
        raise AssertionError("Output tests only work with a live PUDL DB.")
    return request.param


@pytest.fixture(scope='session',
                params=[
                    PudlTabl(start_date=START_DATE_EIA,
                             end_date=END_DATE_EIA,
                             freq='AS',
                             testing=False),
Пример #8
0
def output_byfreq(live_pudl_db, request):
    pudl_out = PudlTabl(
        freq=request.param, testing=(not live_pudl_db),
        start_date=START_DATE, end_date=END_DATE
    )
    return pudl_out