package for ca_npa_howtopay
- Github repository: https://github.com/switchbox-data/npa-howtopay/
- Documentation https://switchbox-data.github.io/npa-howtopay/
npa-howtopay analyzes impact of targeted electrification projects on utilities and customers under different expense scenarios. It compares impacts across scenarios where NPA (Non-Pipeline Alternatives) costs are treated as capex or opex and allocated to gas utilities, electric utilities, or taxpayers.
Requires Python >= 3.9.
pip install git+https://github.com/switchbox-data/npa-howtopay.gitOptional: install a specific tag.
pip install git+https://github.com/switchbox-data/[email protected]from npa_howtopay.model import (
create_scenario_runs,
run_all_scenarios,
create_delta_df,
return_absolute_values_df,
)
from npa_howtopay.params import (
COMPARE_COLS,
load_scenario_from_yaml,
load_time_series_params_from_yaml,
)
run_name = "sample" # must match the YAML file name in npa_howtopay/data
scenario_runs = create_scenario_runs(2025, 2050, ["gas", "electric"], ["capex", "opex"])
input_params = load_scenario_from_yaml(run_name)
ts_params = load_time_series_params_from_yaml(run_name)
results_df_all = run_all_scenarios(scenario_runs, input_params, ts_params)
delta_df = create_delta_df(results_df_all, COMPARE_COLS)
absolute_df = return_absolute_values_df(results_df_all, COMPARE_COLS)| Scenario Name | Description |
|---|---|
| bau | Business-as-usual (BAU): No NPA projects, baseline utility costs and spending. |
| taxpayer | All NPA costs are paid by taxpayers, not by utility customers. |
| gas_capex | Gas utility pays for NPA projects as capital expenditures (added to gas ratebase). |
| gas_opex | Gas utility pays for NPA projects as operating expenses (expensed in year incurred). |
| electric_capex | Electric utility pays for NPA projects as capital expenditures (added to electric ratebase). |
| electric_opex | Electric utility pays for NPA projects as operating expenses (expensed in year incurred). |
| performance_incentive | Cost savings are NPV(BAU) - NPV(NPA); a share is recovered as capex over 10 years. |
- Scenario and time series inputs can be provided via YAML files located in
npa_howtopay/data. - For web app runs, time series can be built from user constants via:
load_time_series_params_from_web_paramsinnpa_howtopay.params
run_model: Run the model for a single scenariorun_all_scenarios: Run across scenarios and return a dict of resultscreate_delta_df: Compute BAU deltas for selected columnsreturn_absolute_values_df: Combine results into a single dataframe