From 7c9c56673f3ffa777266782d35e2334bdf66c289 Mon Sep 17 00:00:00 2001 From: bnb32 Date: Fri, 5 Jan 2024 13:21:48 -0700 Subject: [PATCH] testing workflow edits --- .github/workflows/gh_pages.yml | 69 ++++++++++++++++++++++------------ nsrdb/all_sky/all_sky.py | 36 +++++++++++------- requirements.txt | 1 + 3 files changed, 68 insertions(+), 38 deletions(-) diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index 75fdbecb..72e44207 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -4,27 +4,48 @@ on: pull_request jobs: make-pages: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ['3.9'] - - name: install sphinx dependencies - run: | - python -m pip install --upgrade pip - python -m pip install . - python -m pip install sphinx - python -m pip install sphinx_rtd_theme - python -m pip install sphinx-click - - name: build documentation - run: | - cd docs - make html - - name: deploy - uses: peaceiris/actions-gh-pages@v3.6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_build/html - force_orphan: true - full_commit_message: ${{ github.event.head_commit.message }} + runs-on: ubuntu-latest + matrix: + os: [ubuntu-latest] + python-version: ['3.9'] + steps: + - uses: actions/checkout@v3 + - name: select python version + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: checkout rest2 + uses: actions/checkout@v2 + with: + repository: nrel/rest2 + ssh-key: ${{ secrets.SSH_KEY }} + path: rest2 + - name: Set up Python ${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + - name: Install rest2 dependencies + working-directory: ./rest2 + shell: bash -l {0} + run: | + conda install pip + pip install -e . + - name: install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + python -m pip install sphinx + python -m pip install sphinx_rtd_theme + python -m pip install sphinx-click + - name: build documentation + run: | + cd docs + make html + - name: deploy + uses: peaceiris/actions-gh-pages@v3.6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/_build/html + force_orphan: true + full_commit_message: ${{ github.event.head_commit.message }} diff --git a/nsrdb/all_sky/all_sky.py b/nsrdb/all_sky/all_sky.py index 885fbc44..4a1af493 100755 --- a/nsrdb/all_sky/all_sky.py +++ b/nsrdb/all_sky/all_sky.py @@ -1,30 +1,38 @@ # -*- coding: utf-8 -*- """NSRDB all-sky module. """ -from concurrent.futures import as_completed import logging -import numpy as np import os -import pandas as pd -import psutil +from concurrent.futures import as_completed from warnings import warn -from rex import MultiFileResource, Resource -from rex.utilities import SpawnProcessPool - +import numpy as np +import pandas as pd +import psutil from farms import SZA_LIM from farms.disc import disc from farms.farms import farms -from farms.utilities import (ti_to_radius, calc_beta, merge_rest_farms, - calc_dhi, screen_sza, screen_cld, - dark_night, cloud_variability) +from farms.utilities import ( + calc_beta, + calc_dhi, + cloud_variability, + dark_night, + merge_rest_farms, + screen_cld, + screen_sza, + ti_to_radius, +) from rest2.rest2 import rest2, rest2_tuuclr +from rex import MultiFileResource, Resource +from rex.utilities import SpawnProcessPool from nsrdb.all_sky.utilities import scale_all_sky_outputs -from nsrdb.gap_fill.irradiance_fill import (make_fill_flag, gap_fill_irrad, - missing_cld_props, - enforce_clearsky) - +from nsrdb.gap_fill.irradiance_fill import ( + enforce_clearsky, + gap_fill_irrad, + make_fill_flag, + missing_cld_props, +) logger = logging.getLogger(__name__) diff --git a/requirements.txt b/requirements.txt index 9ac0bc8d..e36fa5bf 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ matplotlib NREL-cloud_fs>=0.0.8 NREL-farms>=1.0.5 NREL-reV<0.8.0 +NREL-rest2>=1.0.1 scikit-learn>=1.0