Skip to content

Commit

Permalink
PySAM v4.0.0 (#129)
Browse files Browse the repository at this point in the history
* 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 <sjanzou@gmail.com>

* 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 <sjanzou@gmail.com>
Co-authored-by: sjanzou <steven@janzouconsulting.com>
Co-authored-by: Brian Mirletz <brian.mirletz@nrel.gov>
Co-authored-by: Paul Gilman <cpaulgilman@gmail.com>
  • Loading branch information
5 people authored Dec 10, 2022
1 parent 6c0f33e commit 9423c56
Show file tree
Hide file tree
Showing 127 changed files with 44,022 additions and 10,622 deletions.
16 changes: 8 additions & 8 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 3.0.2
Most recently tested against PySAM 4.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 3.0.2
Most recently tested against PySAM 4.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 3.0.2
Most recently tested against PySAM 4.0.0
@author: frohro
"""
Expand Down
438 changes: 0 additions & 438 deletions Examples/LEAC_plot_iter.py

This file was deleted.

17 changes: 17 additions & 0 deletions Examples/LoadToolsExample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pandas as pd

from pathlib import Path

from PySAM.LoadTools import get_monthly_peaks

"""
A usage example for LoadTools.get_monthly peaks with hourly annual data
Requires PySAM 4.0.0 or greater
"""
if __name__ == "__main__":
df = pd.read_csv(str(Path(__file__).parent / "sample_load.csv"), dtype=float)
load = pd.to_numeric(df.iloc[:, 0]).values # Consider checking length of array in case of subhourly data

peaks = get_monthly_peaks(load, 1)

print(peaks)
8 changes: 4 additions & 4 deletions Examples/Marine energy examples/WaveFileReader_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"3.0.2\n"
"4.0.0\n"
]
}
],
Expand Down Expand Up @@ -147,7 +147,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.7.12 ('hybrid')",
"display_name": "pysam_build_3.6",
"language": "python",
"name": "python3"
},
Expand All @@ -161,11 +161,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
"version": "3.6.13"
},
"vscode": {
"interpreter": {
"hash": "be2cbe8f104d9ac6d9fabf42fbeb31737fdd025c22f444174f4d7205615d859d"
"hash": "9bb078d9482d46b8624f7a67f4d21bd9eb38583ce4681db84ead483490cabb74"
}
}
},
Expand Down
17 changes: 5 additions & 12 deletions Examples/NonAnnualSimulation.ipynb

Large diffs are not rendered by default.

47 changes: 30 additions & 17 deletions Examples/PySAMWorkshop.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -12,7 +13,7 @@
"\n",
"https://sam.nrel.gov/software-development-kit-sdk/pysam.html\n",
"\n",
"Most recently tested with Version 3.0.2"
"Edit: Most recently tested with Version 4.0.0"
]
},
{
Expand Down Expand Up @@ -191,7 +192,19 @@
{
"data": {
"text/plain": [
"{'SolarResource': {'albedo': (0.2,), 'use_wf_albedo': 1.0},\n",
"{'SolarResource': {'albedo': (0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2,\n",
" 0.2),\n",
" 'use_wf_albedo': 1.0},\n",
" 'Lifetime': {'analysis_period': 25.0,\n",
" 'dc_degradation': (0.5,),\n",
" 'system_use_lifetime_output': 1.0},\n",
Expand Down Expand Up @@ -344,10 +357,10 @@
"output_type": "stream",
"text": [
"gen\n",
" (0.0, 0.0, 0.0, 0.0, 0.0, -0.0, 7.243809888078225, 38.64937311078513, 67.6320391375611, 93.34301588210438)\n",
" (0.0, 0.0, 0.0, 0.0, 0.0, -0.0, 6.389046797900428, 37.94398351785478, 67.06449907636099, 92.89776429848214)\n",
"\n",
"annual energy value\n",
" (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"
" (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"
]
}
],
Expand Down Expand Up @@ -419,7 +432,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"3.0.2\n"
"4.0.0\n"
]
}
],
Expand Down Expand Up @@ -483,15 +496,15 @@
"output_type": "stream",
"text": [
"batt_kw\tbatt_kwh\tavg_npv\n",
"10\t40\t-154353.26606867867\n",
"20\t80\t-151244.90880068636\n",
"30\t120\t-148706.81120574806\n",
"40\t160\t-146575.43792525906\n",
"50\t200\t-144937.62361062184\n",
"60\t240\t-143763.20766567587\n",
"70\t280\t-142771.29847063648\n",
"80\t320\t-141931.5901346006\n",
"90\t360\t-141218.5235190545\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",
"50\t200\t-122370.41286229316\n",
"60\t240\t-121195.8741064144\n",
"70\t280\t-120204.21945391552\n",
"80\t320\t-119364.5472159505\n",
"90\t360\t-118652.03934307654\n"
]
}
],
Expand Down Expand Up @@ -526,7 +539,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.7.12 ('hybrid')",
"display_name": "pysam_build_3.6",
"language": "python",
"name": "python3"
},
Expand All @@ -540,11 +553,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
"version": "3.6.13"
},
"vscode": {
"interpreter": {
"hash": "be2cbe8f104d9ac6d9fabf42fbeb31737fdd025c22f444174f4d7205615d859d"
"hash": "9bb078d9482d46b8624f7a67f4d21bd9eb38583ce4681db84ead483490cabb74"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion Examples/ResidentialPVBatteryWithCustomDispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 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 3.0.2
Most recently tested against PySAM 4.0.0
@author: brtietz
"""
Expand Down
2 changes: 1 addition & 1 deletion Examples/SAMsimPVWattsCommercialExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Run the simulations.
Print the results.
Most recently tested against PySAM 3.0.2
Most recently tested against PySAM 4.0.0
@author: frohro
"""
Expand Down
Loading

0 comments on commit 9423c56

Please sign in to comment.