Skip to content

Commit

Permalink
PySAM v 5.1.0 (#163)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dguittet authored Mar 18, 2024
1 parent e14413e commit 59b092d
Show file tree
Hide file tree
Showing 253 changed files with 13,413 additions and 4,310 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/test_pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Test Package

on: [ push ]

jobs:
build_1:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

env:
SAMNTDIR: ${{ github.workspace }}/../SAM
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}

name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- run: conda --version
- run: which python

- name: Checkout Repo
uses: actions/checkout@v3

- name: Get PySAM Version Unix
if: ${{ matrix.os != 'windows-latest' }}
run: |
VER=$(python -c "from files.version import __version__; print(__version__)")
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Get PySAM Version Windows
if: ${{ matrix.os == 'windows-latest'}}
run: |
$VER=$(python -c "from files.version import __version__; print(__version__)")
echo "VERSION=$VER" >> $env:GITHUB_ENV
- name: Install NREL-PySAM
run: |
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam==${{ env.VERSION }}
- uses: actions/checkout@v3
- name: Checkout SAM
run: |
cd ..
git config --global url.https://github.com/.insteadOf git://github.com/
git clone https://github.com/NREL/SAM.git
- name: Unit tests
run: |
pytest tests/test_pysam_all.py
build_2:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

env:
SAMNTDIR: ${{ github.workspace }}/../SAM
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}

name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- name: Install conda Mac arm64
run: |
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
source /Users/runner/.bash_profile
conda --version
yes | conda create --name pysam_env python=${{ matrix.python-version }}
conda activate pysam_env
which python
- name: Checkout Repo
uses: actions/checkout@v3

- name: Install NREL-PySAM
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
VER=$(python -c "from files.version import __version__; print(__version__)")
echo $VER
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam==$VER
- uses: actions/checkout@v3
- name: Checkout SAM
run: |
cd ..
git config --global url.https://github.com/.insteadOf git://github.com/
git clone https://github.com/NREL/SAM.git
- name: Unit tests
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
pytest tests/test_pysam_all.py
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 5.0.0
Most recently tested against PySAM 5.1.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 5.0.0
Most recently tested against PySAM 5.1.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 5.0.0
Most recently tested against PySAM 5.1.0
@author: frohro
"""
Expand Down
2 changes: 1 addition & 1 deletion Examples/LoadToolsExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
A usage example for LoadTools.get_monthly peaks with hourly annual data
Requires PySAM 4.2.0 or greater
Recently tested with 5.0.0
Recently tested with 5.1.0
"""
if __name__ == "__main__":
df = pd.read_csv(str(Path(__file__).parent / "sample_load.csv"), dtype=float)
Expand Down
8 changes: 4 additions & 4 deletions Examples/Marine energy examples/WaveFileReader_example.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Examples/NonAnnualSimulation.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Examples/PySAMWorkshop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"\n",
"https://sam.nrel.gov/software-development-kit-sdk/pysam.html\n",
"\n",
"Edit: Most recently tested with Version 5.0.0"
"Edit: Most recently tested with Version 5.1.0"
]
},
{
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 5.0.0
Most recently tested against PySAM 5.1.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 5.0.0
Most recently tested against PySAM 5.1.0
@author: frohro
"""
Expand Down
Loading

0 comments on commit 59b092d

Please sign in to comment.