Repository: NREL/bifacial_radiance (language: python)

Issue:
Sensors change
Updating analysis.moduleAnalysis and analysis1axis to remove sensorsy_front, sensorsy_back, sensorsx_front, sensorsx_back.  Instsead, sensorsy and sensorsx can accept either a numeric value, or a list or tuple.  If list or tuple is used, the first element is the number of front sensors.  The second element is the number of back sensors.


Discussion / hints:
Hey @shirubana - this is going to change behavior of the development branch, but I think it's for the better.  Instead of coming up with four new kwargs (sensorsy_front, sensorsy_back, etc) it reuses the normal sensorsy, but allows you to pass two values into it.  Second value is the rear scan number.  What do you think?
Good point, I'll make sure to allow that in the GUI and modelchain.

Fix patch:
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml
new file mode 100644
index 00000000..1a202f81
--- /dev/null
+++ b/.github/workflows/deploy.yaml
@@ -0,0 +1,33 @@
+name: Deploy Python Package
+
+on:
+  release:
+    types: [published]
+
+jobs:
+  deploy:
+    name: Deploy to PyPI
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: '3.7'
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install setuptools wheel twine
+    - name: Build and publish
+      env:
+        TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+      run: |
+        python setup.py sdist bdist_wheel
+        twine upload dist/*
+    - uses: actions/upload-artifact@v2
+      with:
+        name: dist
+        path: |
+          dist/*


Test patch:
diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml
new file mode 100644
index 00000000..ddda8b15
--- /dev/null
+++ b/.github/workflows/pytest.yaml
@@ -0,0 +1,72 @@
+name: test
+
+on: [pull_request, push]
+
+jobs:
+  pytest:
+
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false  # don't cancel other matrix jobs when one fails
+      matrix:
+        python-version: ["3.7"]
+        # Test two environments:
+        # 1) dependencies with pinned versions from requirements.txt
+        # 2) 'pip install --upgrade --upgrade-strategy=eager .' to install upgraded
+        #    dependencies from PyPi using version ranges defined within setup.py
+        env: [
+          '-r requirements.txt .[all]',
+          '--upgrade --upgrade-strategy=eager .[all]'
+        ]
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+
+    - name: Install Radiance v5.2
+      run: |
+        wget https://github.com/NREL/Radiance/releases/download/5.2/radiance-5.2.dd0f8e38a7-Linux.tar.gz -O /tmp/radiance.tar.gz
+        tar -xvf /tmp/radiance.tar.gz
+
+    - name: Copy gencumulativesky into radiance /bin
+      run: |
+        cp $PWD/bifacial_radiance/data/gencumulativesky $PWD/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/bin/
+
+    - name: Install SMARTS 2.9.5
+      run: |
+        wget https://www.nrel.gov/grid/solar-resource/assets/data/smarts-295-linux-tar.gz -O /tmp/smarts.tar.gz
+        tar -xvf /tmp/smarts.tar.gz
+        unlink $PWD/SMARTS_295_Linux/smarts295bat
+        sed -i 's/batch=.FALSE./batch=.TRUE./g' $PWD/SMARTS_295_Linux/Source_code/smarts295.f
+        sudo apt-get install gfortran
+        gfortran -o $PWD/SMARTS_295_Linux/smarts295bat $PWD/SMARTS_295_Linux/Source_code/smarts295.f
+        ls -l $PWD/SMARTS_295_Linux/
+
+    - name: Install ${{ matrix.env }}
+      run: |
+        pip install ${{ matrix.env }}
+        pip install coveralls wheel
+
+    - name: Set environment variables
+      run: |
+        # https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#adding-a-system-path
+        echo "/home/runner/work/bifacial_radiance/bifacial_radiance/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/bin" >> $GITHUB_PATH
+        echo "/home/runner/work/bifacial_radiance/bifacial_radiance/SMARTS_295_Linux" >> $GITHUB_PATH
+
+    - name: Test with pytest ${{ matrix.env }}
+      uses: GabrielBB/xvfb-action@v1  # GUI testing requires xvfb
+      with:
+        run: |
+          pytest --cov=bifacial_radiance
+      env:  # environment variables available to this step
+        RAYPATH: .:/home/runner/work/bifacial_radiance/bifacial_radiance/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/lib
+        SMARTSPATH: /home/runner/work/bifacial_radiance/bifacial_radiance/SMARTS_295_Linux
+
+    - name: Coveralls
+      run: |
+        coveralls
+