Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dguittet committed Jan 29, 2024
2 parents 72f502d + e14413e commit afca255
Show file tree
Hide file tree
Showing 239 changed files with 54,056 additions and 13,494 deletions.
13 changes: 5 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ version: 2
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: []
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
3 changes: 1 addition & 2 deletions Examples/100kW_PVWatts.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Examples/BatteryStateful.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Examples/BatteryWithCustomDispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Additional financial models, inputs, and outputs can be found at https://nrel-pysam.readthedocs.io/en/master/modules/Battery.html
Most recently tested against PySAM 4.1.0
Most recently tested against PySAM 5.0.0
@author: brtietz
"""
Expand Down
2 changes: 1 addition & 1 deletion Examples/FetchResourceFileExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
To use the `FetchResourceFile` function, register an email address to receive a
free API key at at https://developer.nrel.gov/signup/.
Most recently tested against PySAM 4.0.0
Most recently tested against PySAM 5.0.0
@authors: skoeb, cpaulgilman
'''
Expand Down
2 changes: 1 addition & 1 deletion Examples/GenericSystemSingleOwnerExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Created on Wed Mar 4 13:47:58 2020
Most recently tested against PySAM 4.1.0
Most recently tested against PySAM 5.0.0
@author: frohro
"""
Expand Down
3 changes: 2 additions & 1 deletion Examples/LoadToolsExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

"""
A usage example for LoadTools.get_monthly peaks with hourly annual data
Requires PySAM 4.1.0 or greater
Requires PySAM 4.2.0 or greater
Recently tested with 5.0.0
"""
if __name__ == "__main__":
df = pd.read_csv(str(Path(__file__).parent / "sample_load.csv"), dtype=float)
Expand Down
5 changes: 3 additions & 2 deletions Examples/Marine energy examples/WaveFileReader_example.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -19,7 +20,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"4.1.0\n"
"5.0.0\n"
]
}
],
Expand Down Expand Up @@ -161,7 +162,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.8.17"
},
"vscode": {
"interpreter": {
Expand Down
16 changes: 12 additions & 4 deletions Examples/NonAnnualSimulation.ipynb

Large diffs are not rendered by default.

66 changes: 51 additions & 15 deletions Examples/PySAMWorkshop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"\n",
"https://sam.nrel.gov/software-development-kit-sdk/pysam.html\n",
"\n",
"Edit: Most recently tested with Version 4.1.0"
"Edit: Most recently tested with Version 5.0.0"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -36,6 +37,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -68,6 +70,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -94,6 +97,7 @@
"{'SolarResource': {},\n",
" 'Lifetime': {},\n",
" 'SystemDesign': {},\n",
" 'Shading': {},\n",
" 'AdjustmentFactors': {},\n",
" 'Outputs': {}}"
]
Expand All @@ -110,6 +114,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -140,6 +145,10 @@
" \n",
" - *\"FuelCellSingleOwner\"*\n",
" \n",
" - *\"GenericPVWattsWindFuelCellBatteryHybridHostDeveloper\"*\n",
" \n",
" - *\"GenericPVWattsWindFuelCellBatteryHybridSingleOwner\"*\n",
" \n",
" - *\"PVWattsBatteryCommercial\"*\n",
" \n",
" - *\"PVWattsBatteryHostDeveloper\"*\n",
Expand All @@ -148,6 +157,14 @@
" \n",
" - *\"PVWattsBatteryThirdParty\"*\n",
" \n",
" - *\"PVWattsWindBatteryHybridHostDeveloper\"*\n",
" \n",
" - *\"PVWattsWindBatteryHybridSingleOwner\"*\n",
" \n",
" - *\"PVWattsWindFuelCellBatteryHybridHostDeveloper\"*\n",
" \n",
" - *\"PVWattsWindFuelCellBatteryHybridSingleOwner\"*\n",
" \n",
" - *\"PVWattsAllEquityPartnershipFlip\"*\n",
" \n",
" - *\"PVWattsCommercial\"*\n",
Expand Down Expand Up @@ -221,7 +238,17 @@
" 'soiling': (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0),\n",
" 'system_capacity': 215.0,\n",
" 'tilt': 20.0},\n",
" 'AdjustmentFactors': {'constant': 0.0},\n",
" 'Shading': {'shading_azal': ((0.0,),),\n",
" 'shading_diff': 0.0,\n",
" 'shading_en_azal': 0.0,\n",
" 'shading_en_diff': 0.0,\n",
" 'shading_en_mxh': 0.0,\n",
" 'shading_en_string_option': 0.0,\n",
" 'shading_en_timestep': 0.0,\n",
" 'shading_mxh': ((0.0,),),\n",
" 'shading_string_option': 0.0,\n",
" 'shading_timestep': ((0.0,),)},\n",
" 'AdjustmentFactors': {},\n",
" 'Outputs': {}}"
]
},
Expand All @@ -236,6 +263,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -294,6 +322,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -349,24 +378,24 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"gen\n",
" (0.0, 0.0, 0.0, 0.0, 0.0, -0.0, 6.389046797900428, 37.94398351785478, 67.06449907636099, 92.89776429848214)\n",
" (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 15.957267664043416, 46.359814033282966, 79.21016610727209)\n",
"\n",
"annual energy value\n",
" (0.0, 19406.19405690556, 19800.52382533316, 20202.44148167006, 20612.079886380227, 21029.57424662404, 21455.061069906493, 21888.678750448922, 22330.56790184979, 22780.871493923893, 23239.73432549519, 23707.302537008927, 24183.72454046737, 24669.151054164817, 25162.80184412058, 25665.452721768244, 26177.509583152998, 26699.12880537708, 27230.46804522286, 27771.6872915576, 28322.60044366972)\n"
" (0.0, 31185.166327531133, 31826.471693815998, 32480.351606056192, 33147.03432502806, 33826.75096019472, 34519.73674809185, 35226.23060963128, 35946.40851883473, 36679.799902242536, 37427.394937218596, 38189.44523102771, 38966.20651701934, 39757.93772713312, 40564.90191657865, 41387.365633383946, 42225.59961194162, 43079.05838829027, 43948.38185076402, 44834.2470796484, 45736.93783132027)\n"
]
}
],
"source": [
"# execute PV then utility rate calculations\n",
"default_model.SolarResource.solar_resource_file = \"/Users/dguittet/SAM Downloaded Weather Files/weather.csv\"\n",
"default_model.SolarResource.solar_resource_file = \"../tests/blythe_ca_33.617773_-114.588261_nasa_60_tmy.csv\"\n",
"default_model.execute(0)\n",
"print('gen\\n', default_model.Outputs.gen[0:10])\n",
"\n",
Expand All @@ -375,6 +404,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -387,7 +417,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -417,6 +447,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -425,7 +456,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -448,7 +479,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -488,18 +519,23 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"batt_kw\tbatt_kwh\tavg_npv\n",
"10\t40\t-131785.9623201237\n",
"20\t80\t-128677.60802359802\n",
"30\t120\t-126139.5470983437\n",
"40\t160\t-124008.21375974927\n"
"10\t40\t-131785.96232012415\n",
"20\t80\t-128677.60802319663\n",
"30\t120\t-126139.54922129444\n",
"40\t160\t-124008.20675169432\n",
"50\t200\t-122370.41001778266\n",
"60\t240\t-121195.93805275756\n",
"70\t280\t-120204.21032777404\n",
"80\t320\t-119364.54637950887\n",
"90\t360\t-118652.09661186521\n"
]
}
],
Expand Down Expand Up @@ -548,7 +584,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.8.17"
},
"vscode": {
"interpreter": {
Expand Down
8 changes: 6 additions & 2 deletions Examples/ResidentialPVBatteryWithCustomDispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
* PV: https://nrel-pysam.readthedocs.io/en/master/modules/Pvsamv1.html
* Battery: https://nrel-pysam.readthedocs.io/en/master/modules/Battery.html
Most recently tested against PySAM 4.1.0
Most recently tested against PySAM 5.0.0
@author: brtietz
"""

import PySAM.Battery as battery_model
import PySAM.Pvsamv1 as pvsam
from PySAM.PySSC import *
from pathlib import Path

weather_file = sys.argv[1] # .csv weather file with tmy format
if len(sys.argv) > 1:
weather_file = sys.argv[1] # .csv weather file with tmy format
else:
weather_file = str(Path(__file__).parent.parent / "tests" / "blythe_ca_33.617773_-114.588261_nasa_60_tmy.csv")

analysis_period = 1 # years
days_in_year = 365
Expand Down
6 changes: 5 additions & 1 deletion Examples/SAMsimPVWattsCommercialExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
Run the simulations.
Print the results.
Most recently tested against PySAM 4.1.0
Most recently tested against PySAM 5.0.0
@author: frohro
"""

import json
from pathlib import Path
import PySAM.Pvwattsv8 as PVWatts
import PySAM.Grid as Grid
import PySAM.Utilityrate5 as UtilityRate
Expand Down Expand Up @@ -54,6 +55,9 @@
ur.assign(UtilityRate.wrap(ur_dat).export())
cl.assign(Cashloan.wrap(cl_dat).export())

weather_file = str(Path(__file__).parent.parent / "tests" / "blythe_ca_33.617773_-114.588261_nasa_60_tmy.csv")
pv.SolarResource.solar_resource_file = weather_file

# The models are executed in order. Note that the outputs from the first
# simulation are automatically available for the next one, and so on. :-)
pv.execute()
Expand Down
Loading

0 comments on commit afca255

Please sign in to comment.