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

Refactored classes + examples #241

Merged
merged 53 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c1c00d8
Changes to use the TAP API as an alternative option to WTK
jruzekowicz Aug 29, 2023
2d8dde8
Merge branch 'dev/refactor' into dev/refactor
jruzekowicz Aug 31, 2023
d1ad23a
Refactor PVPlant
camirmas Aug 29, 2023
8774540
Refactor DetailedPVPlant
camirmas Sep 8, 2023
d8a96d7
Add pytest-subtests
camirmas Sep 8, 2023
bc4069b
Update documentation
camirmas Sep 8, 2023
237a081
Update tests
camirmas Sep 8, 2023
23e35d7
Update tests
camirmas Sep 19, 2023
e69d44d
Update wind_resource.py to correct automatically setting success vari…
jruzekowicz Sep 20, 2023
f18195c
Update setup
camirmas Sep 20, 2023
b3ec13e
Merge branch 'dev/refactor' of https://github.com/NREL/HOPP into dev/…
camirmas Sep 21, 2023
a1ed8c0
Update PV Config interface
camirmas Sep 26, 2023
702870d
Refactor Grid class
camirmas Sep 14, 2023
d139a70
Add Grid tests
camirmas Sep 19, 2023
3578b18
Update docs to include GridConfig
camirmas Sep 21, 2023
eb4f385
updated doc string in site info.
kbrunik Sep 28, 2023
2282bdd
example Jupyter notebooks.
kbrunik Sep 28, 2023
f1e741a
Refactor Battery
camirmas Sep 28, 2023
ed76f57
Refactor BatteryStateless
camirmas Sep 28, 2023
5fe91ee
Update Battery/BatteryStateless docs
camirmas Sep 28, 2023
d46d203
Update tests
camirmas Sep 29, 2023
f572b7e
Refactor CSP classes
camirmas Oct 2, 2023
27f6b90
add battery spec to technology model
kbrunik Oct 4, 2023
e7e189c
Merge branch 'dev/refactor' of github.com:jruzekowicz/HOPP into tap-i…
camirmas Oct 5, 2023
1905329
Remove redundant resource files
camirmas Oct 5, 2023
56fde60
Add TAP test; allow users to specify API call
camirmas Oct 5, 2023
6d5460c
remove examples from setup.py
kbrunik Oct 6, 2023
8f2f632
update floris examples with visuals
kbrunik Oct 6, 2023
1e4b1d4
Refactor wave model
camirmas Oct 10, 2023
84ce910
Update Wave docs
camirmas Oct 10, 2023
f33b65e
updated floris visualization.
kbrunik Oct 11, 2023
b24d98f
start of example
kbrunik Oct 12, 2023
a057e65
Refactor WindPlant
camirmas Oct 17, 2023
252e92d
Update to convert nested dicts
camirmas Oct 11, 2023
fbe9f4a
Update tests
camirmas Oct 17, 2023
dfcfde3
Update config structure and tests
camirmas Oct 17, 2023
f3a5c1d
Update WindPlant docs
camirmas Oct 18, 2023
aab839d
Rework configs and set up wind plant for pysam input
camirmas Oct 20, 2023
d96c74d
WIP allow PySAM wind system input file
camirmas Oct 20, 2023
116906f
Merge branch 'dev/refactor-kb' of https://github.com/kbrunik/HOPP int…
camirmas Oct 20, 2023
05e47d4
WIP update examples
camirmas Oct 20, 2023
54d8c86
Add ppa_price and dc_degradation configs
camirmas Oct 23, 2023
7e2ceaf
Move hopp_interface.py
camirmas Oct 23, 2023
c096150
Fix Floris financial issue in WindPlant
camirmas Oct 23, 2023
2fbb34b
Update dev environment details
camirmas Oct 23, 2023
2f4a527
WIP update examples
camirmas Oct 23, 2023
3c11686
added electrolyzer example
elenya-grant Oct 24, 2023
80fbdc9
Merge pull request #31 from elenya-grant/dev/refactor_wrkshp
kbrunik Oct 24, 2023
9ca90c1
Merge pull request #32 from kbrunik/dev/refactor-kb
kbrunik Oct 24, 2023
a67ac55
Merge branch 'dev/refactor' of https://github.com/NREL/HOPP into refa…
kbrunik Oct 24, 2023
bfc0d3c
updated examples documentation
kbrunik Oct 25, 2023
8a9e877
modified wave costs class instance
kbrunik Oct 25, 2023
0cd0f74
updated example 06 config
kbrunik Oct 25, 2023
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ solar and storage.
4. Install requirements:
```
conda install -c conda-forge coin-or-cbc -y
conda install -c conda-forge shapely -y
pip install -r requirements.txt
```

Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
PREAMBLE = fh.read()
fh.close()
latex_elements = {
# Additional stuff for the LaTeX preamble.
'preamble': PREAMBLE,
'extraclassoptions': 'openany,oneside'
# Additional stuff for the LaTeX preamble.
'preamble': PREAMBLE,
'extraclassoptions': 'openany,oneside'
}
3 changes: 3 additions & 0 deletions docs/hopp/simulation/technologies/battery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ Battery Storage class based on PySAM's BatteryStateful Model
.. autoclass:: hopp.simulation.technologies.battery.Battery
:members:

.. autoclass:: hopp.simulation.technologies.battery.BatteryConfig
:members:

.. autoclass:: hopp.simulation.technologies.battery.BatteryOutputs
:members:
17 changes: 17 additions & 0 deletions docs/hopp/simulation/technologies/battery_stateless.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _BatteryStorageStateless:


Battery Storage (Stateless)
================================

Battery Storage class with no system model for tracking the state of the battery.


.. autoclass:: hopp.simulation.technologies.battery_stateless.BatteryStateless
:members:

.. autoclass:: hopp.simulation.technologies.battery_stateless.BatteryStatelessConfig
:members:

.. autoclass:: hopp.simulation.technologies.battery_stateless.BatteryStatelessOutputs
:members:
3 changes: 3 additions & 0 deletions docs/hopp/simulation/technologies/csp_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Abstract base class for CSP generation technologies that contains shared methods
.. autoclass:: hopp.simulation.technologies.csp_source.CspPlant
:members:

.. autoclass:: hopp.simulation.technologies.csp_source.CspConfig
:members:

.. autoclass:: hopp.simulation.technologies.csp_source.CspOutputs
:members:
:undoc-members:
17 changes: 17 additions & 0 deletions docs/hopp/simulation/technologies/detailed_pv_plant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _DetailedPVPlant:


Detailed PV Plant
================================

PV Generator class based on PySAM's PVWatts and Pvsam Models. Allows more
detailed configuration than `PVPlant`.

.. autoclass:: hopp.simulation.technologies.detailed_pv_plant.DetailedPVPlant
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.detailed_pv_plant.DetailedPVConfig
:members:
:undoc-members:

5 changes: 5 additions & 0 deletions docs/hopp/simulation/technologies/grid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ based on PySAM's Grid module

.. autoclass:: hopp.simulation.technologies.grid.Grid
:members:


.. autoclass:: hopp.simulation.technologies.grid.GridConfig
:members:
:undoc-members:
12 changes: 12 additions & 0 deletions docs/hopp/simulation/technologies/mhk_wave_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ MHK Wave Generator class
.. autoclass:: hopp.simulation.technologies.mhk_wave_source.MHKWavePlant
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.mhk_wave_source.MHKConfig
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.financial.mhk_cost_model.MHKCosts
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.financial.mhk_cost_model.MHKCostModelInputs
:members:
:undoc-members:
16 changes: 4 additions & 12 deletions docs/hopp/simulation/technologies/power_source.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
.. _PowerSource:

Power Sources and Storage Technologies
=======================================
Power Source
================================

Base class for energy generators:

.. toctree::
pv_source.rst
wind_source.rst
csp_source.rst
battery.rst
grid.rst
mhk_wave_source.rst
Base class for power generation technologies.

.. autoclass:: hopp.simulation.technologies.power_source.PowerSource
:members:
:exclude-members: copy, plot
:exclude-members: copy, plot
6 changes: 5 additions & 1 deletion docs/hopp/simulation/technologies/pv_source.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _PVSource:
.. _PVPlant:


PV Plant
Expand All @@ -9,3 +9,7 @@ PV Generator class based on PySAM's PVWatts and Pvsam Models
.. autoclass:: hopp.simulation.technologies.pv_source.PVPlant
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.pv_source.PVConfig
:members:
:undoc-members:
16 changes: 16 additions & 0 deletions docs/hopp/simulation/technologies/technologies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _Technologies:

Power Sources and Storage Technologies
=======================================

.. toctree::
pv_source.rst
detailed_pv_plant.rst
wind_source.rst
csp_source.rst
battery.rst
battery_stateless.rst
grid.rst
power_source.rst
mhk_wave_source.rst

4 changes: 4 additions & 0 deletions docs/hopp/simulation/technologies/tower_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ Molten Salt Power Tower Plant
Tower concentrating solar power class based on SSC's MSPT (molten salt power tower) model

.. autoclass:: hopp.simulation.technologies.tower_source.TowerPlant
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.tower_source.TowerConfig
:members:
:undoc-members:
4 changes: 4 additions & 0 deletions docs/hopp/simulation/technologies/trough_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Parabolic trough concentrating solar power class based on SSC's Parabolic trough
.. autoclass:: hopp.simulation.technologies.trough_source.TroughPlant
:members:
:undoc-members:

.. autoclass:: hopp.simulation.technologies.trough_source.TroughConfig
:members:
:undoc-members:
4 changes: 4 additions & 0 deletions docs/hopp/simulation/technologies/wind_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ Wind Generation class based on PySAM's Windpower module

.. autoclass:: hopp.simulation.technologies.wind_source.WindPlant
:members:


.. autoclass:: hopp.simulation.technologies.wind_source.WindConfig
:members:
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Welcome to HOPP's documentation!
================================

.. toctree::
:maxdepth: 3
:maxdepth: 2
:caption: Contents:

installation.rst
citing_hopp.rst

hopp/simulation/technologies/sites/site_info.rst
hopp/simulation/hybrid_simulation.rst
hopp/simulation/technologies/power_source.rst
hopp/simulation/technologies/technologies.rst
hopp/simulation/technologies/dispatch/power_source_dispatch.rst
hopp/simulation/technologies/layout/flicker.rst
hopp/using_mybinder.rst
Expand Down
115 changes: 21 additions & 94 deletions examples/workshop/01-wind-solar.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,107 +26,33 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/Users/kbrunik/github/forked/HOPP/examples/workshop/log/hybrid_systems_2023-09-28T09.33.37.529683.log\n"
"/Users/cirmas/workspace/HOPP/examples/workshop/log/hybrid_systems_2023-10-23T12.26.42.533329.log\n"
]
}
],
"source": [
"from hopp.simulation.hybrid_simulation import HybridSimulation"
"from hopp.simulation import HoppInterface"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Set Site Information\n",
"Set wind and solar resource data at plant location. In this example, we use the Flatirons site as an example location."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from hopp import ROOT_DIR\n",
"from hopp.simulation.technologies.sites import SiteInfo, flatirons_site\n",
"\n",
"DEFAULT_SOLAR_RESOURCE_FILE = ROOT_DIR.parent / \"resource_files\" / \"solar\" / \"35.2018863_-101.945027_psmv3_60_2012.csv\"\n",
"DEFAULT_WIND_RESOURCE_FILE = ROOT_DIR.parent / \"resource_files\" / \"wind\" / \"35.2018863_-101.945027_windtoolkit_2012_60min_80m_100m.srw\"\n",
"### Create the HOPP Model\n",
"To generate the HOPP Model, instantiate the `HoppInterface` class and supply the required YAML configuration.\n",
"\n",
"Within the YAML configuration, you have the flexibility to define the plant's location details and configure the associated technologies, in this case wind and solar pv.\n",
"\n",
"site = SiteInfo(\n",
" flatirons_site,\n",
" solar_resource_file=DEFAULT_SOLAR_RESOURCE_FILE,\n",
" wind_resource_file=DEFAULT_WIND_RESOURCE_FILE,\n",
" solar=True,\n",
" wind=True,\n",
" wave=False\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Define System Capacities\n",
"Specify the capacities of the solar, wind, and interconnection components of the hybrid system in megawatts (MW)."
"In this example, we use the Flatirons site as a sample location and configure the wind and solar data for this particular site using pre-existing data files."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"solar_size_mw = 50\n",
"wind_size_mw = 50\n",
"interconnection_size_mw = 50"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Define Technologies Configuration\n",
"Configure the characteristics of each technology in the system, including PV (solar), wind, and grid interconnection."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"technologies = {\n",
" 'pv': {\n",
" 'system_capacity_kw': solar_size_mw * 1000\n",
" },\n",
" 'wind': {\n",
" 'num_turbines': 10,\n",
" 'turbine_rating_kw': 5000\n",
" },\n",
" 'grid': {\n",
" 'interconnect_kw': interconnection_size_mw * 1000\n",
" }\n",
"}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create the Hybrid Simulation Model\n",
"Create an instance of the `HybridSimulation` class by providing the technology configuration and site information."
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"hybrid_plant = HybridSimulation(technologies, site)"
"hi = HoppInterface(\"./inputs/01-wind-solar.yaml\")"
]
},
{
Expand All @@ -139,11 +65,11 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"hybrid_plant.simulate(25)"
"hi.simulate(25)"
]
},
{
Expand All @@ -156,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -166,16 +92,18 @@
"Wind Installed Cost: 72700000.0\n",
"Solar Installed Cost: 48000000.0\n",
"Hybrid Installed Cost: 120700000.0\n",
"Wind NPV: -59123006.66289619\n",
"Wind NPV: -58492882.36461778\n",
"Solar NPV: -35042037.04939877\n",
"Hybrid NPV: -95616818.72323646\n",
"{\"pv\": 104053614.17593749, \"wind\": 156936144.3525466, \"hybrid\": 250319641.2168857}\n",
"{\"pv\": 23.75653291688071, \"wind\": 35.83016994350379, \"hybrid\": 29.793351430192253}\n",
"{\"pv\": -35042037.04939877, \"wind\": -59123006.66289619, \"hybrid\": -95616818.72323646}\n"
"Hybrid NPV: -95120916.57322481\n",
"{\"pv\": 104053614.17593749, \"wind\": 162478037.0463255, \"hybrid\": 254922552.1307209}\n",
"{\"pv\": 23.75653291688071, \"wind\": 37.09544224801952, \"hybrid\": 30.425987582450112}\n",
"{\"pv\": -35042037.04939877, \"wind\": -58492882.36461778, \"hybrid\": -95120916.57322481}\n"
]
}
],
"source": [
"hybrid_plant = hi.system\n",
"\n",
"annual_energies = hybrid_plant.annual_energies\n",
"npvs = hybrid_plant.net_present_values\n",
"cf = hybrid_plant.capacity_factors\n",
Expand Down Expand Up @@ -203,7 +131,7 @@
"hash": "c4181dcdfcea4d6481020f2ce48a9cbe5cdfeb7af5e211e5dfd3ac596bfed8bd"
},
"kernelspec": {
"display_name": "Python 3.8.17 ('storage')",
"display_name": "hopp-dev-refactor",
"language": "python",
"name": "python3"
},
Expand All @@ -218,9 +146,8 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.17"
},
"orig_nbformat": 4
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading