Skip to content

Commit 9423c56

Browse files
dguittetsjanzoubrtietzcpaulgilman
authored
PySAM v4.0.0 (#129)
* files for pysam 2.2.4 * update build_manylinux.sh * update tests and conda build * update SAM_api files * closes #89 certifi certificates in fetchresource * fixes #94 * start v 2.3.0 * fix #69 * changes from 2021.12.2 release * add VersionChanges.rst * add version_differ.py * add more release info * update version_differ.py doc str * correct version_differ.py with PySSC * add python 3.10 * fix getting env variables during build and remove pandas dependency * fix test_ResouceTools.py * switch to manylinux2010 for Python 3.10 support * update pysam files * update PySAM files * Update docs for Version 3.0.1 * close #109 * remove stubs package dependency * removal of stubs package * Apple Silicon and Intel Wheel pip3 install --extra-index-url https://test.pypi.org/simple/ NREL_PySAM * update files and test * Add utility rate forecast example for new stateful cmod (#119) * Add utility rate forecast example for new stateful cmod * Update failing test_Reopt_sizing.py Add sys.SolarResource.wf_use_albedo = 0 * some stubs changes from develop. Additional documentation for utility rate forecast script * Additional subs files from comd_utilityrateforcast sam branches and develop * Correct energy charge schedule fields to match number of periods in energy charge fields * add tests and improve comments in example Co-authored-by: sjanzou <[email protected]> * PySAM documentation revisions * update setup and tests * update files * update versions.rst * update rsts * updates for v3.0.2 * update build_manylinux.sh * update comments * Modifications to PySSC to handle the conventions form ssc PR 907, plus module and docs updates to match * Pysam 116 urdb version 8 (#126) * Add resourcetools processing for urdbv8, update examples. currently fails on ur_yearzero_usage_peaks * Add new loadtools function to convert hourly data into monthly peaks * Mark urdb version as depricated. Move urdbv8 to new utility rate tools library. Update examples and tests * Fix #128 - correctly apply urdb flatdemandmonths to determine tiers * pysam v4.0.0 * update test * add error check to build_win.bat * fix docs * update cmake version Co-authored-by: sjanzou <[email protected]> Co-authored-by: sjanzou <[email protected]> Co-authored-by: Brian Mirletz <[email protected]> Co-authored-by: Paul Gilman <[email protected]>
1 parent 6c0f33e commit 9423c56

File tree

127 files changed

+44022
-10622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+44022
-10622
lines changed

Examples/BatteryStateful.ipynb

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

Examples/BatteryWithCustomDispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Additional financial models, inputs, and outputs can be found at https://nrel-pysam.readthedocs.io/en/master/modules/Battery.html
66
7-
Most recently tested against PySAM 3.0.2
7+
Most recently tested against PySAM 4.0.0
88
99
@author: brtietz
1010
"""

Examples/FetchResourceFileExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
To use the `FetchResourceFile` function, register an email address to receive a
1111
free API key at at https://developer.nrel.gov/signup/.
1212
13-
Most recently tested against PySAM 3.0.2
13+
Most recently tested against PySAM 4.0.0
1414
1515
@authors: skoeb, cpaulgilman
1616
'''

Examples/GenericSystemSingleOwnerExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
Created on Wed Mar 4 13:47:58 2020
55
6-
Most recently tested against PySAM 3.0.2
6+
Most recently tested against PySAM 4.0.0
77
88
@author: frohro
99
"""

Examples/LEAC_plot_iter.py

Lines changed: 0 additions & 438 deletions
This file was deleted.

Examples/LoadToolsExample.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pandas as pd
2+
3+
from pathlib import Path
4+
5+
from PySAM.LoadTools import get_monthly_peaks
6+
7+
"""
8+
A usage example for LoadTools.get_monthly peaks with hourly annual data
9+
Requires PySAM 4.0.0 or greater
10+
"""
11+
if __name__ == "__main__":
12+
df = pd.read_csv(str(Path(__file__).parent / "sample_load.csv"), dtype=float)
13+
load = pd.to_numeric(df.iloc[:, 0]).values # Consider checking length of array in case of subhourly data
14+
15+
peaks = get_monthly_peaks(load, 1)
16+
17+
print(peaks)

Examples/Marine energy examples/WaveFileReader_example.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"name": "stdout",
2020
"output_type": "stream",
2121
"text": [
22-
"3.0.2\n"
22+
"4.0.0\n"
2323
]
2424
}
2525
],
@@ -147,7 +147,7 @@
147147
],
148148
"metadata": {
149149
"kernelspec": {
150-
"display_name": "Python 3.7.12 ('hybrid')",
150+
"display_name": "pysam_build_3.6",
151151
"language": "python",
152152
"name": "python3"
153153
},
@@ -161,11 +161,11 @@
161161
"name": "python",
162162
"nbconvert_exporter": "python",
163163
"pygments_lexer": "ipython3",
164-
"version": "3.7.12"
164+
"version": "3.6.13"
165165
},
166166
"vscode": {
167167
"interpreter": {
168-
"hash": "be2cbe8f104d9ac6d9fabf42fbeb31737fdd025c22f444174f4d7205615d859d"
168+
"hash": "9bb078d9482d46b8624f7a67f4d21bd9eb38583ce4681db84ead483490cabb74"
169169
}
170170
}
171171
},

Examples/NonAnnualSimulation.ipynb

Lines changed: 5 additions & 12 deletions
Large diffs are not rendered by default.

Examples/PySAMWorkshop.ipynb

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
@@ -12,7 +13,7 @@
1213
"\n",
1314
"https://sam.nrel.gov/software-development-kit-sdk/pysam.html\n",
1415
"\n",
15-
"Most recently tested with Version 3.0.2"
16+
"Edit: Most recently tested with Version 4.0.0"
1617
]
1718
},
1819
{
@@ -191,7 +192,19 @@
191192
{
192193
"data": {
193194
"text/plain": [
194-
"{'SolarResource': {'albedo': (0.2,), 'use_wf_albedo': 1.0},\n",
195+
"{'SolarResource': {'albedo': (0.2,\n",
196+
" 0.2,\n",
197+
" 0.2,\n",
198+
" 0.2,\n",
199+
" 0.2,\n",
200+
" 0.2,\n",
201+
" 0.2,\n",
202+
" 0.2,\n",
203+
" 0.2,\n",
204+
" 0.2,\n",
205+
" 0.2,\n",
206+
" 0.2),\n",
207+
" 'use_wf_albedo': 1.0},\n",
195208
" 'Lifetime': {'analysis_period': 25.0,\n",
196209
" 'dc_degradation': (0.5,),\n",
197210
" 'system_use_lifetime_output': 1.0},\n",
@@ -344,10 +357,10 @@
344357
"output_type": "stream",
345358
"text": [
346359
"gen\n",
347-
" (0.0, 0.0, 0.0, 0.0, 0.0, -0.0, 7.243809888078225, 38.64937311078513, 67.6320391375611, 93.34301588210438)\n",
360+
" (0.0, 0.0, 0.0, 0.0, 0.0, -0.0, 6.389046797900428, 37.94398351785478, 67.06449907636099, 92.89776429848214)\n",
348361
"\n",
349362
"annual energy value\n",
350-
" (0.0, 19769.35269577205, 20173.14626497552, 20584.773667204307, 21004.37422312893, 21432.08932330776, 21868.06244460609, 22312.439166142292, 22765.367184727373, 23226.9963297629, 23697.47857755975, 24176.96806504032, 24665.621102783985, 25162.81452408534, 25669.06795743532, 26184.907303375207, 26710.49544913871, 27245.9974351258, 27791.580460756482, 28347.247335797612, 28912.224065489412)\n"
363+
" (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"
351364
]
352365
}
353366
],
@@ -419,7 +432,7 @@
419432
"name": "stdout",
420433
"output_type": "stream",
421434
"text": [
422-
"3.0.2\n"
435+
"4.0.0\n"
423436
]
424437
}
425438
],
@@ -483,15 +496,15 @@
483496
"output_type": "stream",
484497
"text": [
485498
"batt_kw\tbatt_kwh\tavg_npv\n",
486-
"10\t40\t-154353.26606867867\n",
487-
"20\t80\t-151244.90880068636\n",
488-
"30\t120\t-148706.81120574806\n",
489-
"40\t160\t-146575.43792525906\n",
490-
"50\t200\t-144937.62361062184\n",
491-
"60\t240\t-143763.20766567587\n",
492-
"70\t280\t-142771.29847063648\n",
493-
"80\t320\t-141931.5901346006\n",
494-
"90\t360\t-141218.5235190545\n"
499+
"10\t40\t-131785.9623201237\n",
500+
"20\t80\t-128677.60802359802\n",
501+
"30\t120\t-126139.5470983437\n",
502+
"40\t160\t-124008.21375974927\n",
503+
"50\t200\t-122370.41286229316\n",
504+
"60\t240\t-121195.8741064144\n",
505+
"70\t280\t-120204.21945391552\n",
506+
"80\t320\t-119364.5472159505\n",
507+
"90\t360\t-118652.03934307654\n"
495508
]
496509
}
497510
],
@@ -526,7 +539,7 @@
526539
],
527540
"metadata": {
528541
"kernelspec": {
529-
"display_name": "Python 3.7.12 ('hybrid')",
542+
"display_name": "pysam_build_3.6",
530543
"language": "python",
531544
"name": "python3"
532545
},
@@ -540,11 +553,11 @@
540553
"name": "python",
541554
"nbconvert_exporter": "python",
542555
"pygments_lexer": "ipython3",
543-
"version": "3.7.12"
556+
"version": "3.6.13"
544557
},
545558
"vscode": {
546559
"interpreter": {
547-
"hash": "be2cbe8f104d9ac6d9fabf42fbeb31737fdd025c22f444174f4d7205615d859d"
560+
"hash": "9bb078d9482d46b8624f7a67f4d21bd9eb38583ce4681db84ead483490cabb74"
548561
}
549562
}
550563
},

Examples/ResidentialPVBatteryWithCustomDispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* PV: https://nrel-pysam.readthedocs.io/en/master/modules/Pvsamv1.html
99
* Battery: https://nrel-pysam.readthedocs.io/en/master/modules/Battery.html
1010
11-
Most recently tested against PySAM 3.0.2
11+
Most recently tested against PySAM 4.0.0
1212
1313
@author: brtietz
1414
"""

0 commit comments

Comments
 (0)