Skip to content

Commit 59b092d

Browse files
authored
PySAM v 5.1.0 (#163)
* Hybrids in PySAM (#162) * add tests for updated PySSC * add hybrids * update hybrids and add tests * remove set_data_ptr * update ctypes and PySSC * add yml for github actions CI * update yml * update yml * update yml * update yml * update yml * update yml * update yml * update yml * remove hybrid_sandbox * update files * update test_hybrids * update CI yml * remove M1 mac test for now * update test_pysam_all * update test * add back M1 mac test * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml * fix mem leak in test_pyssc * update yml for CI * update build scripts * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml * update test_pkg.yml
1 parent e14413e commit 59b092d

File tree

253 files changed

+13413
-4310
lines changed

Some content is hidden

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

253 files changed

+13413
-4310
lines changed

.github/workflows/test_pkg.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Test Package
2+
3+
on: [ push ]
4+
5+
jobs:
6+
build_1:
7+
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, windows-latest, macOS-latest]
12+
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
13+
14+
env:
15+
SAMNTDIR: ${{ github.workspace }}/../SAM
16+
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
17+
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}
18+
19+
name: ${{ matrix.os }} ${{ matrix.python-version }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Setup conda
23+
uses: s-weigand/setup-conda@v1
24+
with:
25+
update-conda: true
26+
python-version: ${{ matrix.python-version }}
27+
conda-channels: anaconda, conda-forge
28+
- run: conda --version
29+
- run: which python
30+
31+
- name: Checkout Repo
32+
uses: actions/checkout@v3
33+
34+
- name: Get PySAM Version Unix
35+
if: ${{ matrix.os != 'windows-latest' }}
36+
run: |
37+
VER=$(python -c "from files.version import __version__; print(__version__)")
38+
echo "VERSION=$VER" >> $GITHUB_ENV
39+
40+
- name: Get PySAM Version Windows
41+
if: ${{ matrix.os == 'windows-latest'}}
42+
run: |
43+
$VER=$(python -c "from files.version import __version__; print(__version__)")
44+
echo "VERSION=$VER" >> $env:GITHUB_ENV
45+
46+
- name: Install NREL-PySAM
47+
run: |
48+
pip install -r requirements.txt
49+
pip install -r tests/requirements.txt
50+
conda install -c nrel nrel-pysam==${{ env.VERSION }}
51+
52+
- uses: actions/checkout@v3
53+
- name: Checkout SAM
54+
run: |
55+
cd ..
56+
git config --global url.https://github.com/.insteadOf git://github.com/
57+
git clone https://github.com/NREL/SAM.git
58+
59+
- name: Unit tests
60+
run: |
61+
pytest tests/test_pysam_all.py
62+
63+
build_2:
64+
runs-on: ${{ matrix.os }}
65+
strategy:
66+
matrix:
67+
os: [macos-14]
68+
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
69+
70+
env:
71+
SAMNTDIR: ${{ github.workspace }}/../SAM
72+
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
73+
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}
74+
75+
name: ${{ matrix.os }} ${{ matrix.python-version }}
76+
steps:
77+
- name: Install conda Mac arm64
78+
run: |
79+
mkdir -p ~/miniconda3
80+
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
81+
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
82+
rm -rf ~/miniconda3/miniconda.sh
83+
~/miniconda3/bin/conda init bash
84+
source /Users/runner/.bash_profile
85+
conda --version
86+
yes | conda create --name pysam_env python=${{ matrix.python-version }}
87+
conda activate pysam_env
88+
which python
89+
90+
- name: Checkout Repo
91+
uses: actions/checkout@v3
92+
93+
- name: Install NREL-PySAM
94+
run: |
95+
source /Users/runner/.bash_profile
96+
conda activate pysam_env
97+
VER=$(python -c "from files.version import __version__; print(__version__)")
98+
echo $VER
99+
pip install -r requirements.txt
100+
pip install -r tests/requirements.txt
101+
conda install -c nrel nrel-pysam==$VER
102+
103+
- uses: actions/checkout@v3
104+
- name: Checkout SAM
105+
run: |
106+
cd ..
107+
git config --global url.https://github.com/.insteadOf git://github.com/
108+
git clone https://github.com/NREL/SAM.git
109+
110+
- name: Unit tests
111+
run: |
112+
source /Users/runner/.bash_profile
113+
conda activate pysam_env
114+
pytest tests/test_pysam_all.py

Examples/BatteryStateful.ipynb

Lines changed: 13 additions & 13 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 5.0.0
7+
Most recently tested against PySAM 5.1.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 5.0.0
13+
Most recently tested against PySAM 5.1.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 5.0.0
6+
Most recently tested against PySAM 5.1.0
77
88
@author: frohro
99
"""

Examples/LoadToolsExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88
A usage example for LoadTools.get_monthly peaks with hourly annual data
99
Requires PySAM 4.2.0 or greater
10-
Recently tested with 5.0.0
10+
Recently tested with 5.1.0
1111
"""
1212
if __name__ == "__main__":
1313
df = pd.read_csv(str(Path(__file__).parent / "sample_load.csv"), dtype=float)

Examples/Marine energy examples/WaveFileReader_example.ipynb

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

Examples/NonAnnualSimulation.ipynb

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

Examples/PySAMWorkshop.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"\n",
1414
"https://sam.nrel.gov/software-development-kit-sdk/pysam.html\n",
1515
"\n",
16-
"Edit: Most recently tested with Version 5.0.0"
16+
"Edit: Most recently tested with Version 5.1.0"
1717
]
1818
},
1919
{

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 5.0.0
11+
Most recently tested against PySAM 5.1.0
1212
1313
@author: brtietz
1414
"""

0 commit comments

Comments
 (0)