Update EMHASS PVLib databases #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update EMHASS PVLib databases | |
on: | |
push: | |
branches: [ master ] | |
schedule: # run once a month | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
pull-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: install requirements | |
run: python3 -m pip install --break-system-packages .[test] | |
- name: pull latest SAM CEC files | |
run: | | |
git clone https://github.com/NREL/SAM.git /tmp/SAM | |
cp /tmp/SAM/deploy/libraries/CEC\ Inverters.csv ./src/emhass/data/CEC\ Inverters.csv | |
cp /tmp/SAM/deploy/libraries/CEC\ Modules.csv ./src/emhass/data/CEC\ Modules.csv | |
- name: build database via python script | |
run: python3 ./scripts/save_pvlib_module_inverter_database.py | |
- name: push database changes | |
run: | | |
rm -r /tmp/SAM | |
rm ./src/emhass/data/CEC\ Inverters.csv | |
rm ./src/emhass/data/CEC\ Modules.csv | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add ./src/emhass/data/cec_inverters.pbz2 | |
git add ./src/emhass/data/cec_modules.pbz2 | |
git commit -m "Bump inverter/module database" | |
git push |