Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GreenHEART Simulation Examples #313

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bfabe2f
add greenheart simulation example
kbrunik Apr 26, 2024
dccc9d9
add data files and figures for greenheart example
kbrunik Apr 29, 2024
8bf9800
offshore greenheart example
kbrunik Apr 29, 2024
f5827c9
Merge remote-tracking branch 'upstream/greensteel-eco-sync' into gree…
kbrunik Apr 29, 2024
7bf03fe
update examples with optimization code setup
kbrunik Apr 29, 2024
18151a1
Merge remote-tracking branch 'upstream/greensteel-eco-sync' into gree…
kbrunik Jul 17, 2024
5d3995e
update greenheart examples
kbrunik Jul 17, 2024
da4e4c6
remove output files
kbrunik Jul 17, 2024
8f71a2d
bring core elements of floris update to HOPP develop
jaredthomas68 Oct 14, 2024
46f22bb
update requirements for FLORIS and shapely. add tests for running wit…
jaredthomas68 Oct 14, 2024
6b6fa60
update installation workflow for modern Python and upgrade to 3.9-3.1…
RHammond2 Oct 14, 2024
6e58b25
update workflows
RHammond2 Oct 14, 2024
2b10ebb
update Actions and RTD workflows for new installation method
RHammond2 Oct 15, 2024
0879ddb
update readme with new python compatibility and adjust formatting
RHammond2 Oct 15, 2024
33ccf3a
Merge pull request #359 from RHammond2/enhancement/python-management
johnjasa Oct 15, 2024
8d78f65
add tests for floris
jaredthomas68 Oct 16, 2024
5fd5d68
complete merge
jaredthomas68 Oct 16, 2024
3df4203
update floris and shapely versions. get floris tests passing
jaredthomas68 Oct 16, 2024
427c7fd
include floris config file
jaredthomas68 Oct 16, 2024
e26da4b
specify required version of floris and include floris config
jaredthomas68 Oct 16, 2024
2a878c3
complete merge from test-floris
jaredthomas68 Oct 16, 2024
b4dd5e7
update for shapely version
jaredthomas68 Oct 16, 2024
0643d6b
Merge remote-tracking branch 'upstream/dev/refactor' into greensteel-…
kbrunik Oct 16, 2024
a9c8b3f
Merge remote-tracking branch 'jared/updatefloris-hopp' into greenstee…
kbrunik Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand All @@ -22,21 +22,12 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y libglpk-dev glpk-utils coinor-cbc
python -m pip install --upgrade pip
pip install scikit-learn
pip install -r requirements.txt
- name: Install package
run: |
python setup.py install
pip install ".[develop]"
- name: Create env file
run: |
touch .env
# echo NREL_API_KEY=${{ secrets.NREL_API_KEY }} >> .env
# cat .env
- name: Install test dependencies
run: |
pip install pytest
pip install pytest-subtests
pip install responses
- name: Run tests
run: |
PYTHONPATH=. pytest tests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
name: Conda
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: 3.7
python-version: 3.9
- name: Build and upload conda package
shell: bash -l {0}
env:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -22,5 +22,6 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine check --strict dist/*
twine upload dist/*
10 changes: 6 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
Expand All @@ -26,6 +26,8 @@ sphinx:

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements.txt
- requirements: requirements-dev.txt
install:
- method: pip
path: .
extra_requirements:
- develop
77 changes: 47 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,73 +14,90 @@ Hybrid project power-to-x component-level system performance and financial model
`greenheart` will install alongside `hopp` by following the instructions for installing HOPP from source.

## Software requirements
- Python version 3.8, 3.9, 3.10 64-bit
- Other versions may still work, but have not been extensively tested at this time

- Python version 3.9, 3.10, and 3.11 only (PySAM 4.2 is incompatible with 3.12)

## Installing from Package Repositories

1. HOPP is available as a PyPi package:

```
```bash
pip install HOPP
```

## Installing from Source
## Installing from Source

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

```bash
git clone https://github.com/NREL/HOPP.git
```

2. Navigate to `HOPP`
```

```bash
cd HOPP
```

3. Create a new virtual environment and change to it. Using Conda and naming it 'hopp':
```

```bash
conda create --name hopp python=3.8 -y
conda activate hopp
```

4. Install dependencies:
```
conda install -c conda-forge coin-or-cbc=2.10.8 -y
conda install -c conda-forge glpk -y
pip install -r requirements.txt
```
4. Install HOPP and its dependencies:

Note if you are on Windows, you will have to manually install Cbc: https://github.com/coin-or/Cbc

If you also want development dependencies for running tests and building docs:

```
pip install -r requirements-dev.txt
```

5. Install HOPP:
```
pip install -e .
```bash
conda install -y -c conda-forge coin-or-cbc=2.10.8 glpk
```

6. The functions which download resource data require an NREL API key. Obtain a key from:
Note if you are on Windows, you will have to manually install Cbc: https://github.com/coin-or/Cbc.

[https://developer.nrel.gov/signup/](https://developer.nrel.gov/signup/)
- If you want to just use HOPP:

```bash
pip install .
```

- If you want to work with the examples:

```bash
pip install ".[examples]"
```

- If you also want development dependencies for running tests and building docs:

```bash
pip install -e ".[develop]"
```

5. The functions which download resource data require an NREL API key. Obtain a key from:

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

7. To set up the `NREL_API_KEY` and `NREL_API_EMAIL` required for resource downloads, you can create Environment Variables called `NREL_API_KEY` and `NREL_API_EMAIL`. Otherwise, you can keep the key in a new file called ".env" in the root directory of this project.
6. To set up the `NREL_API_KEY` and `NREL_API_EMAIL` required for resource downloads, you can create Environment Variables called `NREL_API_KEY` and `NREL_API_EMAIL`. Otherwise, you can keep the key in a new file called ".env" in the root directory of this project.

Create a file ".env" that contains the single line:
```

```bash
NREL_API_KEY=key
[email protected]
```

<<<<<<< HEAD
8. Verify setup by running tests:
```
pytest
=======
7. Verify setup by running tests:

```bash
pytest tests/hopp
>>>>>>> jared/updatefloris-hopp
```


2. To set up `NREL_API_KEY` for resource downloads, first refer to section 7 and 8 above. But for the `.env` file method,
8. To set up `NREL_API_KEY` for resource downloads, first refer to section 6 and 7 above. But for the `.env` file method,
the file should go in the working directory of your Python project, e.g. directory from where you run `python`.

## Parallel Processing for GreenHEART finite differences and design of experiments
Expand Down
Loading