Skip to content

Commit aa329cf

Browse files
authored
Merge pull request #32 from NREL/develop
Merging develop into main for v0.1.1
2 parents 5a10c1e + cf50afc commit aa329cf

87 files changed

Lines changed: 2884 additions & 888 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## v0.1.1 [28 October 2024]
4+
5+
- Minor updates to examples for NAWEA workshop
6+
37
## v0.1 [16 October 2024]
48

59
- Project has been separated from HOPP and moved into GreenHEART, removing all HOPP infrastructure.

CONTRIBUTING.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,57 @@ King, J. and Hammond, S. "[Integrated Modeling, TEA, and Reference Design for Re
4848

4949
## Installing from Package Repositories
5050

51-
1. GreenHEART is available as a PyPi package:
51+
```bash
52+
pip install greenheart
53+
```
54+
55+
## Installing from Source
56+
57+
### Easiest approach (recommended)
58+
59+
1. Using Git, navigate to a local target directory and clone repository:
60+
61+
```bash
62+
git clone https://github.com/NREL/GreenHEART.git
63+
```
64+
65+
2. Navigate to `GreenHEART`
5266

5367
```bash
54-
pip install greenheart
68+
cd GreenHEART
5569
```
5670

57-
## Installing from Source
71+
3. Create a conda environment and install GreenHEART and all its dependencies
72+
73+
```bash
74+
conda env create -f environment.yml
75+
```
76+
77+
4. Install Cbc.
78+
1. If using a Unix machine (not Windows), install a final dependency
79+
80+
```bash
81+
conda install -y -c conda-forge coin-or-cbc=2.10.8
82+
```
83+
84+
2. Windows users will have to manually install Cbc: https://github.com/coin-or/Cbc
85+
86+
An additional step can be added if additional dependencies are required, or you plan to use this
87+
environment for development work.
88+
89+
- Pass `-e` for an editable developer install
90+
- Use one of the extra flags as needed:
91+
- `examples`: allows you to use the Jupyter Notebooks
92+
- `develop`: adds developer and documentation tools
93+
- `all` simplifies adding all the dependencies
94+
95+
This looks like the following for a developer installation:
96+
97+
```bash
98+
pip install -e ".[all]"
99+
```
100+
101+
### Customizable
58102

59103
1. Using Git, navigate to a local target directory and clone repository:
60104

@@ -68,7 +112,8 @@ King, J. and Hammond, S. "[Integrated Modeling, TEA, and Reference Design for Re
68112
cd GreenHEART
69113
```
70114

71-
3. Create a new virtual environment and change to it. Using Conda and naming it 'greenheart':
115+
3. Create a new virtual environment and change to it. Using Conda Python 3.11 (choose your favorite
116+
supported version) and naming it 'greenheart' (choose your desired name):
72117

73118
```bash
74119
conda create --name greenheart python=3.11 -y
@@ -78,12 +123,18 @@ King, J. and Hammond, S. "[Integrated Modeling, TEA, and Reference Design for Re
78123
4. Install GreenHEART and its dependencies:
79124

80125
```bash
81-
conda install -y -c conda-forge coin-or-cbc=2.10.8 glpk
126+
conda install -y -c conda-forge glpk
82127
pip install electrolyzer@git+https://github.com/jaredthomas68/electrolyzer.git@smoothing
83128
pip install ProFAST@git+https://github.com/NREL/ProFAST.git
84129
```
85130

86-
Note if you are on Windows, you will have to manually install Cbc: https://github.com/coin-or/Cbc.
131+
Note: Unix users should install Cbc via:
132+
133+
```bash
134+
conda install -y -c conda-forge coin-or-cbc=2.10.8
135+
```
136+
137+
Windows users will have to manually install Cbc: https://github.com/coin-or/Cbc.
87138

88139
- If you want to just use GreenHEART:
89140

@@ -109,11 +160,11 @@ King, J. and Hammond, S. "[Integrated Modeling, TEA, and Reference Design for Re
109160
pip install -e ".[all]"
110161
```
111162

112-
5. The functions which download resource data require an NREL API key. Obtain a key from:
163+
1. The functions which download resource data require an NREL API key. Obtain a key from:
113164

114165
[https://developer.nrel.gov/signup/](https://developer.nrel.gov/signup/)
115166

116-
6. To set up the `NREL_API_KEY` and `NREL_API_EMAIL` required for resource downloads, you can create
167+
2. To set up the `NREL_API_KEY` and `NREL_API_EMAIL` required for resource downloads, you can create
117168
Environment Variables called `NREL_API_KEY` and `NREL_API_EMAIL`. Otherwise, you can keep the key
118169
in a new file called ".env" in the root directory of this project.
119170

@@ -124,7 +175,7 @@ King, J. and Hammond, S. "[Integrated Modeling, TEA, and Reference Design for Re
124175
NREL_API_EMAIL=your.name@email.com
125176
```
126177

127-
7. Verify setup by running tests:
178+
3. Verify setup by running tests:
128179

129180
```bash
130181
pytest
@@ -163,4 +214,5 @@ forthcoming.
163214
164215
## Contributing
165216
166-
Interested in improving GreenHEART? Please see the [Contributing](./CONTRIBUTING.md) section for more information.
217+
Interested in improving GreenHEART? Please see the [Contributor's Guide](./docs/CONTRIBUTING.md)
218+
section for more information.

docs/CONTRIBUTING.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Contributing
2+
3+
We welcome contributions in the form of bug reports, bug fixes, improvements to the documentation,
4+
ideas for enhancements (or the enhancements themselves!).
5+
6+
You can find a [list of current issues](https://github.com/NREL/GreenHEART/issues) in the project's
7+
GitHub repo. Feel free to tackle any existing bugs or enhancement ideas by submitting a
8+
[pull request](https://github.com/NREL/GreenHEART/pulls).
9+
10+
## Bug Reports
11+
12+
* Please include a short (but detailed) Python snippet or explanation for reproducing the problem.
13+
Attach or include a link to any input files that will be needed to reproduce the error.
14+
* Explain the behavior you expected, and how what you got differed.
15+
16+
## Pull Requests
17+
18+
* Please reference relevant GitHub issues in your commit message using `GH123` or `#123`.
19+
* Changes should be [PEP8](http://www.python.org/dev/peps/pep-0008/) compatible.
20+
* Keep style fixes to a separate commit to make your pull request more readable.
21+
* Docstrings are required and should follow the
22+
[Google style](https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html).
23+
* When you start working on a pull request, start by creating a new branch pointing at the latest
24+
commit on [main](https://github.com/NREL/GreenHEART).
25+
* The GreenHEART copyright policy is detailed in the [`LICENSE`](https://github.com/NREL/GreenHEART/blob/main/LICENSE).
26+
27+
## Documentation
28+
29+
When contributing new features, or fixing existing capabilities, be sure to add and/or update the
30+
docstrings as needed to ensure the documentation site stays up to date with the latest changes.
31+
32+
To build the documentation locally, the following command can be run in your terminal in the main
33+
directory of the repository.
34+
35+
```bash
36+
jupyter-book build docs/
37+
```
38+
39+
In addition to generating the documentation, be sure to check the results by opening the following
40+
path in your browser: `file:///<path-to-greenheart>/GreenHEART/docs/_build/html/index.html`.
41+
42+
```{note}
43+
If the browser appears to be out of date from what you expected to built, please try the following:
44+
1. Reload the page
45+
2. Clear your browser's cache and open the page again.
46+
```
47+
48+
## Tests
49+
50+
The test suite can be run using `pytest tests/greenheart`. Individual test files can be run by specifying them:
51+
52+
```bash
53+
pytest tests/greenheart/test_hybrid.py
54+
```
55+
56+
and individual tests can be run within those files
57+
58+
```bash
59+
pytest tests/greenheart/test_hybrid.py::test_greenheart_system
60+
```
61+
62+
When you push to your fork, or open a PR, your tests will be run against the
63+
[Continuous Integration (CI)](https://github.com/NREL/HOPP/actions) suite. This will start a build
64+
that runs all tests on your branch against multiple Python versions, and will also test
65+
documentation builds.
66+
67+
## Release Process
68+
69+
### Standard
70+
71+
Most contributions will be into the `develop` branch, and once the threshold for a release has been
72+
met the following steps should be taken to create a new release
73+
74+
1. On `develop`, bump the version appropriately, see the
75+
[semantic versioning guidelines](https://semver.org/) for details.
76+
2. Open a pull request from `develop` into `main`.
77+
3. When all CI tests pass, and the PR has been approved, merge the PR into main.
78+
4. Pull the latest changes from GitHub into the local copy of the main branch.
79+
5. Tag the latest commit to match the version bump in step 1 (replace "v0.1" in all instances below),
80+
and push it to the repository.
81+
82+
```bash
83+
git tag -a v0.1 -m "v0.1 release"
84+
git push --orign v0.1
85+
```
86+
87+
6. Check that the
88+
[Test PyPI GitHub Action](https://github.com/NREL/GreenHEART/actions/workflows/publish_to_test_pypi.yml)
89+
has run successfully.
90+
1. If the action failed, identify and fix the issue, then
91+
2. delete the local and remote tag using the following (replace "v0.1" in all instances just like
92+
in step 5):
93+
94+
```bash
95+
git tag -d v0.1
96+
git push --delete origin v0.1
97+
```
98+
99+
3. Start back at step 1.
100+
7. When the Test PyPI Action has successfully run,
101+
[create a new release](https://github.com/NREL/GreenHEART/releases/new) using the tag created in
102+
step 5.
103+
104+
### Patches
105+
106+
Any pull requests directly into the main branch that alter the GreenHEART model (excludes anything
107+
in `docs/`, or outside of `greenheart/` and `tests/`), should be sure to follow the instructions
108+
below:
109+
110+
1. All CI tests pass and the patch version has been bumped according to the
111+
[semantic versioning guidelines](https://semver.org/).
112+
2. Follow steps 4 through 7 above.
113+
3. Merge the NREL main branch back into the develop branch and push the changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
greenheart.simulation.greenheart\_simulation
2+
============================================
3+
4+
.. automodule:: greenheart.simulation.greenheart_simulation
5+
6+
7+
8+
9+
10+
11+
12+
.. rubric:: Functions
13+
14+
.. autosummary::
15+
16+
run_design_options
17+
run_policy_options_storage_types
18+
run_policy_storage_design_options
19+
run_simulation
20+
run_storage_options
21+
run_sweeps
22+
setup_greenheart_simulation
23+
24+
25+
26+
27+
28+
.. rubric:: Classes
29+
30+
.. autosummary::
31+
32+
GreenHeartSimulationConfig
33+
GreenHeartSimulationOutput
34+
35+
36+
37+
38+
39+
40+
41+
42+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
greenheart.simulation
2+
=====================
3+
4+
.. automodule:: greenheart.simulation
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
.. rubric:: Modules
25+
26+
.. autosummary::
27+
:toctree:
28+
:recursive:
29+
30+
greenheart.simulation.greenheart_simulation
31+
greenheart.simulation.technologies
32+

0 commit comments

Comments
 (0)