Skip to content

Commit 48cb531

Browse files
authored
Revise README for clarity and organization
Updated README to improve project overview and installation instructions.
1 parent 6c9333c commit 48cb531

File tree

1 file changed

+57
-51
lines changed

1 file changed

+57
-51
lines changed

README.md

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,64 +13,70 @@ package for ca_npa_howtopay
1313
- **Github repository**: <https://github.com/switchbox-data/npa-howtopay/>
1414
- **Documentation** <https://switchbox-data.github.io/npa-howtopay/>
1515

16-
## Getting started with your project
16+
## Overview
17+
`npa-howtopay` analyzes impact of targeted electrification projects on utilities and customers under different expense scenarios. It compares utility and taxpayer impacts across scenarios where NPA (Non-Pipeline Alternatives) costs are treated as capex or opex and allocated to gas, electric, or taxpayers.
1718

18-
### 1. Create a New Repository
19-
20-
First, create a repository on GitHub with the same name as this project, and then run the following commands:
19+
## Installation (GitHub)
20+
Requires Python >= 3.9.
2121

2222
```bash
23-
git init -b main
24-
git add .
25-
git commit -m "init commit"
26-
git remote add origin git@github.com:switchbox-data/npa-howtopay.git
27-
git push -u origin main
23+
pip install git+https://github.com/switchbox-data/npa-howtopay.git
2824
```
2925

30-
### 2. Set Up Your Development Environment
31-
32-
Then, install the environment and the pre-commit hooks with
33-
34-
```bash
35-
make install
36-
```
37-
38-
This will also generate your `uv.lock` file
39-
40-
### 3. Run the pre-commit hooks
41-
42-
Initially, the CI/CD pipeline might be failing due to formatting issues. To resolve those run:
43-
26+
Optional: install a specific tag.
4427
```bash
45-
uv run pre-commit run -a
28+
pip install git+https://github.com/switchbox-data/npa-howtopay.git@v0.0.1
4629
```
4730

48-
### 4. Commit the changes
49-
50-
Lastly, commit the changes made by the two steps above to your repository.
51-
52-
```bash
53-
git add .
54-
git commit -m 'Fix formatting issues'
55-
git push origin main
31+
## Quickstart (local run)
32+
```python
33+
from npa_howtopay.model import (
34+
create_scenario_runs,
35+
run_all_scenarios,
36+
create_delta_df,
37+
return_absolute_values_df,
38+
)
39+
from npa_howtopay.params import (
40+
COMPARE_COLS,
41+
load_scenario_from_yaml,
42+
load_time_series_params_from_yaml,
43+
)
44+
45+
run_name = "sample" # must match the YAML file name in npa_howtopay/data
46+
scenario_runs = create_scenario_runs(2025, 2050, ["gas", "electric"], ["capex", "opex"])
47+
48+
input_params = load_scenario_from_yaml(run_name)
49+
ts_params = load_time_series_params_from_yaml(run_name)
50+
51+
results_df_all = run_all_scenarios(scenario_runs, input_params, ts_params)
52+
53+
delta_df = create_delta_df(results_df_all, COMPARE_COLS)
54+
absolute_df = return_absolute_values_df(results_df_all, COMPARE_COLS)
5655
```
5756

58-
You are now ready to start development on your project!
59-
The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.
60-
61-
To finalize the set-up for publishing to PyPI, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/publishing/#set-up-for-pypi).
62-
For activating the automatic documentation with MkDocs, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/mkdocs/#enabling-the-documentation-on-github).
63-
To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/codecov/).
64-
65-
## Releasing a new version
66-
67-
- Create an API Token on [PyPI](https://pypi.org/).
68-
- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting [this page](https://github.com/switchbox-data/npa-howtopay/settings/secrets/actions/new).
69-
- Create a [new release](https://github.com/switchbox-data/npa-howtopay/releases/new) on Github.
70-
- Create a new tag in the form `*.*.*`.
71-
72-
For more details, see [here](https://fpgmaas.github.io/cookiecutter-uv/features/cicd/#how-to-trigger-a-release).
73-
74-
---
75-
76-
Repository initiated with [fpgmaas/cookiecutter-uv](https://github.com/fpgmaas/cookiecutter-uv).
57+
## Scenario Definitions
58+
| Scenario Name | Description |
59+
|------------------------|--------------------------------------------------------------------------------------------------|
60+
| bau | Business-as-usual (BAU): No NPA projects, baseline utility costs and spending. |
61+
| taxpayer | All NPA costs are paid by taxpayers, not by utility customers. |
62+
| gas_capex | Gas utility pays for NPA projects as capital expenditures (added to gas ratebase). |
63+
| gas_opex | Gas utility pays for NPA projects as operating expenses (expensed in year incurred). |
64+
| electric_capex | Electric utility pays for NPA projects as capital expenditures (added to electric ratebase). |
65+
| electric_opex | Electric utility pays for NPA projects as operating expenses (expensed in year incurred). |
66+
| performance_incentive | Cost savings are NPV(BAU) - NPV(NPA); a share is recovered as capex over 10 years. |
67+
68+
## Data Inputs
69+
- Scenario and time series inputs can be provided via YAML files located in `npa_howtopay/data`.
70+
- For web app runs, time series can be built from user constants via:
71+
- `load_time_series_params_from_web_params` in `npa_howtopay.params`
72+
73+
## API Highlights
74+
- `run_model`: Run the model for a single scenario
75+
- `run_all_scenarios`: Run across scenarios and return a dict of results
76+
- `create_delta_df`: Compute BAU deltas for selected columns
77+
- `return_absolute_values_df`: Combine results into a single dataframe
78+
79+
## Links
80+
- Repository: https://github.com/switchbox-data/npa-howtopay
81+
- Documentation: https://switchbox-data.github.io/npa-howtopay/
82+
- App: https://switchbox.shinyapps.io/npa_how_to_pay_app/

0 commit comments

Comments
 (0)