-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #359 from RHammond2/enhancement/python-management
Enhancement: Upgrade Python Infrastrucutre and Compatibility
- Loading branch information
Showing
11 changed files
with
203 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,73 +7,84 @@ software assesses optimal designs for the deployment of utility-scale hybrid ene | |
solar and storage. | ||
|
||
## 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 | ||
|
||
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 | ||
```bash | ||
conda install -y -c conda-forge coin-or-cbc=2.10.8 glpk | ||
``` | ||
|
||
5. Install HOPP: | ||
``` | ||
pip install -e . | ||
``` | ||
|
||
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] | ||
``` | ||
|
||
8. Verify setup by running tests: | ||
``` | ||
7. Verify setup by running tests: | ||
|
||
```bash | ||
pytest tests/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`. | ||
|
||
## Getting Started | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
[build-system] | ||
requires = ["setuptools", "setuptools-scm"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "HOPP" | ||
dynamic = ["version"] | ||
authors = [{name = "NREL", email = "[email protected]"}] | ||
readme = {file = "README.md", content-type = "text/markdown"} | ||
description = "Hybrid Systems Optimization and Performance Platform." | ||
requires-python = ">=3.9, <3.12" | ||
license = {file = "LICENSE"} | ||
dependencies = [ | ||
"Cython", | ||
"NREL-PySAM==4.2.0", | ||
"Pillow", | ||
"Pyomo>=6.1.2", | ||
"diskcache", | ||
"fastkml", | ||
"floris", | ||
"future", | ||
"global_land_mask", | ||
"humpday", | ||
"hybridbosse", | ||
"lcoe", | ||
"lxml", | ||
"matplotlib", | ||
"multiprocessing-on-dill", | ||
"nevergrad", | ||
"numpy", | ||
"numpy-financial", | ||
"optuna", | ||
"pandas>=2.0.3", | ||
"pint", | ||
"pvmismatch", | ||
"pyDOE2", | ||
"pymoo", | ||
"pyproj", | ||
"pysolar", | ||
"pysot", | ||
"python-dotenv", | ||
"python-rapidjson", | ||
"pytz", | ||
"rainflow", | ||
"requests", | ||
"scikit-learn", | ||
"scikit-optimize", | ||
"scipy", | ||
"shapely>=1.8.5,<2.0.0", | ||
"setuptools", | ||
"timezonefinder", | ||
"urllib3", | ||
"openpyxl", | ||
"CoolProp", | ||
"attrs", | ||
"utm", | ||
"pyyaml-include", | ||
] | ||
keywords = [ | ||
"python3", | ||
"wind-energy", | ||
"operations", | ||
"operational-analysis", | ||
"operational-assessement", | ||
"turbine-performance", | ||
"wind-plant-performance", | ||
] | ||
classifiers = [ # https://pypi.org/classifiers/ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Other Audience", | ||
"License :: OSI Approved :: BSD License", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
|
||
[project.urls] | ||
source = "https://github.com/NREL/HOPP" | ||
documentation = "https://hopp.readthedocs.io/" | ||
issues = "https://github.com/NREL/HOPP/issues" | ||
changelog = "https://github.com/NREL/HOPP/blob/main/RELEASE.md" | ||
|
||
[project.optional-dependencies] | ||
develop = [ | ||
"pytest", | ||
"pytest-subtests", | ||
"responses", | ||
"sphinx", | ||
"sphinx-rtd-theme", | ||
"sphinx-copybutton", | ||
] | ||
examples = ["jupyterlab"] | ||
all = ["openoa[develop,examples]"] | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
include = [ | ||
"hopp/hydrogen/h2_storage/pressure_vessel/compressed_gas_storage_model_20221021/Tankinator.xlsx", | ||
"hydrogen/h2_transport/data_tables/*.csv", | ||
"tools/analysis/bos/BOSLookup.csv", | ||
"simulation/technologies/layout/flicker_data/*shadow.txt", | ||
"simulation/technologies/layout/flicker_data/*flicker.txt", | ||
"simulation/technologies/csp/pySSC_daotk/libs/*", | ||
"simulation/technologies/csp/pySSC_daotk/tower_data/*", | ||
"simulation/technologies/csp/pySSC_daotk/trough_data/*", | ||
"simulation/technologies/dispatch/cbc_solver/cbc-win64/*", | ||
"simulation/resource_files/*", | ||
"simulation/resource_files/*/*", | ||
] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "hopp.__version__"} | ||
|
||
[tool.coverage.report] | ||
exclude_lines = ["# pragma: no cover"] | ||
|
||
[tool.coverage.run] | ||
# Coverage.py configuration file | ||
# https://coverage.readthedocs.io/en/latest/config.html | ||
branch = true | ||
source = ["hopp/*"] | ||
omit = [ | ||
"setup.py", | ||
"tests/*" | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
python_files = [ | ||
"tests/*.py", | ||
] | ||
testpaths = [ | ||
"test/hopp/*.py", | ||
"test/greenheart/*.py", | ||
] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.