Skip to content

Commit

Permalink
Merge branch 'master' into update_custom_financial
Browse files Browse the repository at this point in the history
  • Loading branch information
dguittet committed Aug 9, 2023
2 parents c7a47f1 + 9506a41 commit 1fd492c
Show file tree
Hide file tree
Showing 101 changed files with 76,916 additions and 1,115 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: Testing

on: [ push ]
on: [ push, pull_request ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8 ]
python-version: [ 3.7, 3.8 ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
run: |
pip install scikit-learn
sudo apt-get update && sudo apt-get install -y libglpk-dev glpk-utils coinor-cbc
python -m pip install --upgrade pip
pip install shapely==1.7.1
pip install -r requirements.txt
- name: Install package
run: |
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ examples/HOPP_examples/
HOPP_examples/
HOPP-demos/
# needed for h2 test inputs: tests/analysis/results/
WB_case_study/
examples/H2 Analysis/results/reopt_precomputes/

tests/hybrid/REoptResultsNoExportAboveLoad.json
Expand All @@ -20,10 +19,6 @@ examples/analysis/results/*.csv
resource_files/wind
resource_files/solar

resource_files/grid/tunisia_est_grid_prices.csv
resource_files/solar/Hazoua
resource_files/solar/Beni_Miha

# clean up after merge
examples/Powerflow Analysis
examples/analysis/Engie
Expand Down
74 changes: 0 additions & 74 deletions 2030_SETO_targets.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2019, Alliance for Sustainable Energy, LLC
Copyright (c) 2020, Alliance for Sustainable Energy, LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Hybrid Optimization and Performance Platform

![CI Tests](https://github.com/NREL/HOPP/actions/workflows/ci.yml/badge.svg)

As part of NREL's [Hybrid Energy Systems Research](https://www.nrel.gov/wind/hybrid-energy-systems-research.html), this
software assesses optimal designs for the deployment of utility-scale hybrid energy plants, particularly considering wind,
solar and storage.
Expand All @@ -23,10 +25,12 @@ solar and storage.

4. Install requirements:
```
conda install -c conda-forge glpk -y
conda install -c conda-forge coin-or-cbc -y
conda install -c conda-forge shapely==1.7.1 -y
pip install -r requirements.txt
```

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

5. Run install script:
```
Expand Down
9 changes: 9 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release Notes

## Version 1.0.0, Upcoming
* Add Wind + PV + Battery + PEM Electrolyzer analysis to examples in `H2_Analysis`
* Add default scenario inputs for hydrogen as end product with result files
* Add files for simulating, optimizing and plotting Wind + PV + Battery + PEM Electrolyzer hybrids
* Add a PEM electrolyzer model to hybrid (not integrated into HybridSimulation)
* Separate power and financial simulations for PowerSoures and HybridSimulation
* Fix multiprocessing issues
* Updates to integrate FLORIS v3

## Version 0.1.0.dev3, Mar. 11, 2022
* Include CBC package data for Windows

Expand Down
46 changes: 41 additions & 5 deletions alt_dev/optimization_driver_alt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import functools
import inspect
import time
import os
Expand Down Expand Up @@ -152,7 +151,44 @@ def run(self):

class OptimizationDriver():
"""
Object to interface the HOPP optimization problem with humpday optimizers
Object to interface the HOPP design analysis methods (i.e., sampling and optimization)
.. TODO: We might want to rename this to ProblemDriver? As it is required for non-optimization runs.
Parameters
----------
time_limit : initializer(float), optional
Total time limit in seconds
eval_limit : initializer(float), optional
Objective evaluation limit (counts new evaluations only)
obj_limit : initializer(float), optional
Lower bound of objective, exit if best objective is less than this
n_proc : initializer(int), optional
Maximum number of objective process workers
cach_dir : initializer(str), optional
Filename for the driver cache file
reconnect_cache : initializer(bool), optional
``True`` if the driver should reconnect to a previous result cache
write_csv : initializer(bool), optional
``True`` if the cached results should be written to csv format files
dataframe_file : initializer(str), optional
Filename for the driver cache dataframe file
csv_file : initializer(str), optional
filename for the driver cache csv file (if ``write_csv`` is ``True``)
scaled : initializer(bool), optional
``True`` if the sample/optimizer candidates need to be scaled to problem units
retry : initializer(bool), optional
``True`` if any evaluations ending in an exception should be retried on restart
"""
DEFAULT_KWARGS = dict(time_limit=np.inf, # total time limit in seconds
eval_limit=np.inf, # objective evaluation limit (counts new evaluations only)
Expand Down Expand Up @@ -348,9 +384,9 @@ def write_cache(self, pd_filename=None, csv_filename=None) -> None:
:param filename: Optional path of file to write out the cache to
:return: None
"""
if self.start_len == len(self.cache) - 1:
print(f"no new entries in cache ({len(self.cache) - 1} results), skipping write...")
return
# if self.start_len == len(self.cache) - 1:
# print(f"no new entries in cache ({len(self.cache) - 1} results), skipping write...")
# return

dt_string = datetime.now().strftime('%Y-%m-%d_%H.%M.%S')

Expand Down
12 changes: 8 additions & 4 deletions alt_dev/post_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,20 @@ def plot(x, y, color, type, symbol, log_x, log_y, scale_x, scale_y):
plot_data = pd.concat(data_list, axis=1, keys=keys)

if type == "box":
return px.box(plot_data, x=x, y=y, color=color, points=points, log_x=log_x, log_y=log_y, **kwargs)
return px.box(plot_data, x=x, y=y, color=color, points=points, log_x=log_x, log_y=log_y,
color_continuous_scale=px.colors.sequential.Turbo, **kwargs)

elif type == "bar":
return px.bar(plot_data, x=x, y=y, color=color, barmode=barmode, log_x=log_x, log_y=log_y, **kwargs)
return px.bar(plot_data, x=x, y=y, color=color, barmode=barmode, log_x=log_x, log_y=log_y,
color_continuous_scale=px.colors.sequential.Turbo, **kwargs)

elif type == "scatter":
return px.scatter(plot_data, x=x, y=y, color=color, symbol=symbol, log_x=log_x, log_y=log_y, **kwargs)
return px.scatter(plot_data, x=x, y=y, color=color, symbol=symbol, log_x=log_x, log_y=log_y,
color_continuous_scale=px.colors.sequential.Turbo, **kwargs)

elif type == "line":
return px.line(plot_data, x=x, y=y, color=color, symbol=symbol, log_x=log_x, log_y=log_y, **kwargs)
return px.line(plot_data, x=x, y=y, color=color, symbol=symbol, log_x=log_x, log_y=log_y,
color_continuous_scale=px.colors.sequential.Turbo, **kwargs)

return interact_row_wrap(plot, **switches).widget

Expand Down
10 changes: 4 additions & 6 deletions alt_dev/run_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import pyDOE2 as pyDOE
# import idaes.surrogate.pysmo.sampling as sampling
import numpy as np
import pandas as pd

# NREL dev API key, for weather and data files and site information
from pathlib import Path
Expand Down Expand Up @@ -78,7 +79,7 @@ def init_simulation_pv():
'dc_ac_ratio': 1.1},
'battery': {'system_capacity_kwh': battery_capacity_mwh * 1000,
'system_capacity_kw': battery_capacity_mw * 1000},
'grid': interconnection_size_mw * 1000}
'grid': {'interconnect_kw': interconnection_size_mw * 1000}}

# Create the hybrid plant simulation
# TODO: turn these off to run full year simulation
Expand All @@ -91,7 +92,6 @@ def init_simulation_pv():
# TODO: turn-on receiver and field optimization before... initial simulation
hybrid_plant = HybridSimulation(technologies,
site_info,
interconnect_kw=interconnection_size_mw * 1000,
dispatch_options=dispatch_options)

# Customize the hybrid plant assumptions here...
Expand Down Expand Up @@ -165,7 +165,7 @@ def init_simulation_csp():
'solar_multiple': 2.0,
'tes_hours': 12.0,
'optimize_field_before_sim': True}, # TODO: turn on
'grid': interconnection_size_mw * 1000}
'grid': {'interconnect_kw': interconnection_size_mw * 1000}}

# Create the hybrid plant simulation
# TODO: turn these off to run full year simulation
Expand All @@ -176,7 +176,6 @@ def init_simulation_csp():
# TODO: turn-on receiver and field optimization before... initial simulation
hybrid_plant = HybridSimulation(technologies,
site_info,
interconnect_kw=interconnection_size_mw * 1000,
dispatch_options=dispatch_options)

return hybrid_plant
Expand Down Expand Up @@ -251,7 +250,7 @@ def init_simulation_hybrid():
'optimize_field_before_sim': True}, # TODO: turn on
'battery': {'system_capacity_kwh': battery_capacity_mwh * 1000,
'system_capacity_kw': battery_capacity_mw * 1000},
'grid': interconnection_size_mw * 1000}
'grid': {'interconnect_kw': interconnection_size_mw * 1000}}

# Create the hybrid plant simulation
# TODO: turn these off to run full year simulation
Expand All @@ -264,7 +263,6 @@ def init_simulation_hybrid():
# TODO: turn-on receiver and field optimization before... initial simulation
hybrid_plant = HybridSimulation(technologies,
site_info,
interconnect_kw=interconnection_size_mw * 1000,
dispatch_options=dispatch_options)

# Customize the hybrid plant assumptions here...
Expand Down
7 changes: 7 additions & 0 deletions docs/citing_hopp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Hybrid Optimization Performance Platform (HOPP)
-----------------------------------------------
.. Software record or a report?
Tripp, Charles E., Guittet, Darice, Barker, Aaron, King, Jennifer, and Hamilton, Bill. Hybrid Optimization and
Performance Platform (HOPP). Computer software. November 14, 2019. https://github.com/NREL/HOPP.
https://doi.org/10.11578/dc.20210326.1.

Tripp, C., Guittet, D., King, J., and Barker, A.: A Simplified, Efficient Approach to Hybrid Wind and Solar Plant
Site Optimization, Wind Energ. Sci. Discuss. [preprint], https://doi.org/10.5194/wes-2021-54, in review, 2021.

Dispatch Optimization
---------------------
.. We can break it up based on different HOPP capabilities.
Expand Down
11 changes: 11 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

# -- Options for Latex pdf output --------------------------------------------

fh = open('latex_preamble.tex', 'r+')
PREAMBLE = fh.read()
fh.close()
latex_elements = {
# Additional stuff for the LaTeX preamble.
'preamble': PREAMBLE,
'extraclassoptions': 'openany,oneside'
}
Loading

0 comments on commit 1fd492c

Please sign in to comment.