From 3e0028e83c11ac7912668912b3bfc6955588a580 Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 09:19:58 -0700 Subject: [PATCH 01/10] Update rtd config --- documentation/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/conf.py b/documentation/conf.py index 2b9a8ef..392e0ad 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -131,7 +131,7 @@ #html_theme = 'sphinxdoc' def setup(app): - app.add_stylesheet( "pecos.css" ) + app.add_css_file( "pecos.css" ) on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally From 1116292ad0f953285d09b51dae354487a995b21b Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 09:20:16 -0700 Subject: [PATCH 02/10] Changed Float64 to float64 --- pecos/monitoring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pecos/monitoring.py b/pecos/monitoring.py index 70f3bb3..31aa6ca 100644 --- a/pecos/monitoring.py +++ b/pecos/monitoring.py @@ -853,7 +853,7 @@ def check_custom_streaming(self, quality_control_func, window, key=None, # still expects pandas DataFrames and Series in the user defined quality # control function to keep data types consitent on the user side. np_mask = pd.DataFrame(True, index=self.df.index, columns=self.df.columns).values - np_data = df.values.astype('Float64') + np_data = df.values.astype('float64') ti = df.index.get_loc(df.index[0]+history_window) From 0428c11bdbd224d5630c93c394c33efc6a4fed34 Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 09:31:40 -0700 Subject: [PATCH 03/10] Added py39 tests --- .travis.yml | 6 ++++++ ci/requirements-py39.yml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ci/requirements-py39.yml diff --git a/.travis.yml b/.travis.yml index 9371193..e281604 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,12 @@ matrix: services: - xvfb sudo: true + - python: 3.9 + dist: xenial + env: CONDA_ENV=py39 + services: + - xvfb + sudo: true addons: apt: diff --git a/ci/requirements-py39.yml b/ci/requirements-py39.yml new file mode 100644 index 0000000..f67811b --- /dev/null +++ b/ci/requirements-py39.yml @@ -0,0 +1,17 @@ +name: test_env +channels: + - defaults + - http://conda.anaconda.org/pvlib +dependencies: + - python=3.9 + - pandas + - numpy + - jinja2 + - matplotlib + - nose + - pvlib + - plotly + - ephem + - sqlalchemy + - pip: + - coveralls \ No newline at end of file From 05f9a269fe77e923bf959d344dd58d0cba6fa5dc Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 09:46:33 -0700 Subject: [PATCH 04/10] Updated docs and version number --- documentation/installation.rst | 2 +- pecos/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/installation.rst b/documentation/installation.rst index 18e8493..f39b027 100644 --- a/documentation/installation.rst +++ b/documentation/installation.rst @@ -1,7 +1,7 @@ Installation ====================================== -Pecos requires Python (tested on 3.6, 3.7, and 3.8) along with several Python +Pecos requires Python (tested on 3.6, 3.7, 3.8, and 3.9) along with several Python package dependencies. Information on installing and using Python can be found at https://www.python.org/. Python distributions, such as Anaconda, are recommended to manage the Python interface. diff --git a/pecos/__init__.py b/pecos/__init__.py index e617273..7f274ba 100644 --- a/pecos/__init__.py +++ b/pecos/__init__.py @@ -6,7 +6,7 @@ from pecos import utils from pecos import pv -__version__ = '0.2.0' +__version__ = '0.2.1' __copyright__ = """Copyright 2016 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract From 32cd537e991d7c352eba5cbb30cf037680bccf7b Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 09:56:50 -0700 Subject: [PATCH 05/10] Add github action for testing --- .github/workflows/quick_check.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/quick_check.yml diff --git a/.github/workflows/quick_check.yml b/.github/workflows/quick_check.yml new file mode 100644 index 0000000..51f2c88 --- /dev/null +++ b/.github/workflows/quick_check.yml @@ -0,0 +1,31 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: quick-check + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install packages + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install --upgrade coverage nose + python setup.py develop + - name: Run tests + run: | + nosetests -v --nologcapture --with-doctest --with-coverage --cover-package=pecos --cover-min-percentage=70 pecos From 7feadfb4dd556f0977d9acd80e527708cea64a59 Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 10:03:46 -0700 Subject: [PATCH 06/10] Added requirements file --- requirements.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d5c523c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,12 @@ +# Required +pandas +numpy +jinja +matplotlib + +# Optional +nose +pvlib +plotly +ephem +sqlalchemy From 7221834b9dc6aa36ad558de2a01af82d9bd111e3 Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 10:10:36 -0700 Subject: [PATCH 07/10] minor update --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d5c523c..b3ecadb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Required pandas numpy -jinja +jinja2 matplotlib # Optional From 5c70602fe754279d4af2a4ff5d6e7d2ac7ca25dc Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 10:31:05 -0700 Subject: [PATCH 08/10] Added build tests --- .github/workflows/build_tests.yml | 240 ++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 .github/workflows/build_tests.yml diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml new file mode 100644 index 0000000..f0a4ee5 --- /dev/null +++ b/.github/workflows/build_tests.yml @@ -0,0 +1,240 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: build + +on: + push: + branches: [ master] + pull_request: + branches: [ master] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python --version + python -m pip install --upgrade pip + pip install wheel + pip install -r requirements.txt + - name: Build wheel + run: | + python setup.py bdist_wheel + ls dist/* + - name: Save wheel + uses: actions/upload-artifact@v2 + with: + name: wheel + path: dist/pecos*.whl + + test: + name: Import test + needs: build + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + os: [windows-latest, macOS-latest, ubuntu-latest] + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Download wheel + uses: actions/download-artifact@v2 + with: + name: wheel + - name: Install pecos + run: | + python -m pip install --upgrade pip + pip install wheel + pip install --find-links=. pecos + - name: Import test + run: | + python -c "import pecos" + + windows: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + os: [windows-latest] + 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 dependencies + run: | + python --version + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install coveralls + python setup.py develop + - name: Run Tests + run: | + coverage erase + coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" -m nose -v --nologcapture --with-doctest --traverse-namespace pecos + env: + COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + - name: Save coverage + uses: actions/upload-artifact@v2 + # if: ${{ matrix.os != 'windows-latest' }} + with: + name: coverage + path: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + + macOS: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + os: [macOS-latest] + 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 dependencies + run: | + python --version + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install coveralls + python setup.py develop + - name: Run Tests + run: | + coverage erase + coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" -m nose -v --nologcapture --with-doctest --traverse-namespace --doctest-extension=.rst documentation/*.rst pecos + env: + COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + - name: Save coverage + uses: actions/upload-artifact@v2 + # if: ${{ matrix.os != 'windows-latest' }} + with: + name: coverage + path: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + + linux: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: Setup conda + uses: s-weigand/setup-conda@v1 + with: + update-conda: true + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + conda config --set always_yes yes --set changeps1 no + python --version + python -m pip install --upgrade pip + pip install -r requirements.txt + python setup.py develop + - name: Run Tests + run: | + coverage erase + coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=pecos --omit="*/tests/*" -m nose -v --nologcapture --with-doctest --doctest-extension=.rst --traverse-namespace documentation/*.rst pecos + env: + COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + - name: Save coverage + uses: actions/upload-artifact@v2 + # if: ${{ matrix.os != 'windows-latest' }} + with: + name: coverage + path: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + + coverage: + needs: [ windows, macOS, linux ] + runs-on: windows-latest + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - uses: actions/checkout@v2 + - name: Install coverage + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install coveralls + python setup.py develop + - name: Download coverage artifacts from test matrix + uses: actions/download-artifact@v2 + with: + name: coverage + - name: Setup coverage and combine reports + run: | + echo "[paths]" > .coveragerc + echo "source = " >> .coveragerc + echo " pecos/" >> .coveragerc + echo " pecos\\" >> .coveragerc + echo " D:\\a\\pecos\\pecos\\pecos" >> .coveragerc + echo " /home/runner/work/pecos/pecos/pecos" >> .coveragerc + echo " /Users/runner/work/pecos/pecos/pecos" >> .coveragerc + coverage combine + - name: Create coverage report + run: | + coverage report + coverage json --pretty-print + coverage html --show-contexts + - name: Save coverage JSON + uses: actions/upload-artifact@v2 + with: + name: coverage + path: coverage.json + - name: Save coverage html + uses: actions/upload-artifact@v2 + with: + name: coverage + path: htmlcov + + coveralls: + needs: [ windows, macOS, linux ] + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - uses: actions/checkout@v2 + - name: Install coverage + run: | + python -m pip install --upgrade pip + pip install coveralls + pip install -r requirements.txt + python setup.py develop + - name: Download coverage artifacts from test matrix + uses: actions/download-artifact@v2 + with: + name: coverage + - name: Setup coverage and combine reports + run: | + echo "[paths]" > .coveragerc + echo "source = " >> .coveragerc + echo " pecos/" >> .coveragerc + echo " pecos\\" >> .coveragerc + echo " D:\\a\\pecos\\pecos\\pecos" >> .coveragerc + echo " /home/runner/work/pecos/pecos/pecos" >> .coveragerc + echo " /Users/runner/work/pecos/pecos/pecos" >> .coveragerc + coverage combine + - name: Push to coveralls + run: | + coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bd777d7daed0c594853a5491271ce9b860f20428 Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 10:40:12 -0700 Subject: [PATCH 09/10] minor update for github actions --- .github/workflows/build_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index f0a4ee5..a26bbad 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -144,6 +144,7 @@ jobs: python --version python -m pip install --upgrade pip pip install -r requirements.txt + pip install coveralls python setup.py develop - name: Run Tests run: | From bad93126e36472b6b909c7d78f25e8661cddcdda Mon Sep 17 00:00:00 2001 From: Katherine Klise Date: Thu, 17 Jun 2021 10:55:54 -0700 Subject: [PATCH 10/10] Updated release notes --- documentation/whatsnew.rst | 2 ++ documentation/whatsnew/v0.2.0.rst | 2 +- documentation/whatsnew/v0.2.1.rst | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 documentation/whatsnew/v0.2.1.rst diff --git a/documentation/whatsnew.rst b/documentation/whatsnew.rst index e5bf5ed..242edd6 100644 --- a/documentation/whatsnew.rst +++ b/documentation/whatsnew.rst @@ -1,6 +1,8 @@ Release Notes ================ +.. include:: whatsnew/v0.2.1.rst + .. include:: whatsnew/v0.2.0.rst .. include:: whatsnew/v0.1.9.rst diff --git a/documentation/whatsnew/v0.2.0.rst b/documentation/whatsnew/v0.2.0.rst index d86544f..8bb170f 100644 --- a/documentation/whatsnew/v0.2.0.rst +++ b/documentation/whatsnew/v0.2.0.rst @@ -1,6 +1,6 @@ .. _whatsnew_020: -v0.2.0 (master) +v0.2.0 (March 5, 2021) -------------------------- * Replaced the use of Excel files in examples/tests with CSV files. The Excel files were causing test failures. diff --git a/documentation/whatsnew/v0.2.1.rst b/documentation/whatsnew/v0.2.1.rst new file mode 100644 index 0000000..f9224c6 --- /dev/null +++ b/documentation/whatsnew/v0.2.1.rst @@ -0,0 +1,8 @@ +.. _whatsnew_021: + +v0.2.1 (master) +-------------------------- + +* Minor updates for testing and documentation +* Added GitHub Actions and Python 3.9 tests +