Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into ctopt
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Mar 5, 2024
2 parents f92671f + e4475ea commit 21e3f9c
Show file tree
Hide file tree
Showing 453 changed files with 19,206 additions and 45,838 deletions.
4 changes: 0 additions & 4 deletions .coverageac

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ _Please provide a minimum working example (MWE) if possible_
### Code versions
_List versions only if relevant_
- Python
-
-
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ assignees: ''
Describe the feature here and provide some context. Under what scenario would this be useful?

# Potential solution
Can you think of ways to implement this?
Can you think of ways to implement this?
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Delete the text explanations below these headers and replace them with informati
Please first consult the [developer guide](https://weis.readthedocs.io/en/latest/how_to_contribute_code.html) to make sure your PR follows all code, testing, and documentation conventions.

## Purpose
Explain the goal of this pull request. If it addresses an existing issue be sure to link to it. Describe the big picture of your changes here, perhaps using a bullet list if multiple changes are done to accomplish a single goal. If it accomplishes multiple goals, it may be best to create separate PR's for each.
Explain the goal of this pull request. If it addresses an existing issue be sure to link to it. Describe the big picture of your changes here, perhaps using a bullet list if multiple changes are done to accomplish a single goal. If it accomplishes multiple goals, it may be best to create separate PR's for each.

## Type of change
What types of change is it?
Expand All @@ -25,4 +25,4 @@ _Put an `x` in the boxes that apply._

- [ ] I have run existing tests which pass locally with my changes
- [ ] I have added new tests or examples that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation
- [ ] I have added necessary documentation
131 changes: 92 additions & 39 deletions .github/workflows/CI_WISDEM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,140 @@ on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build (${{ matrix.os }}, Python ${{ matrix.python-version }})
build_conda:
name: Conda Build-Test (${{ matrix.os }} Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -el {0}

strategy:
fail-fast: False
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.8, 3.9]
os: [ubuntu-latest, windows-latest] #macos-latest,
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- name: checkout repository
uses: actions/checkout@v4

- name: Install conda/mamba
uses: conda-incubator/setup-miniconda@v2
# https://github.com/marketplace/actions/setup-miniconda
with:
miniconda-version: "latest"
channels: conda-forge
# To use mamba, uncomment here, comment out the miniforge line
#mamba-version: "*"
miniforge-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
activate-environment: test
auto-activate-base: false

# Install dependencies of WEIS specific to ubuntu
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
# if you use the shell here, cannot use 'compiler' package due to linker conflicts
shell: bash -l {0}
#shell: pwsh
run: |
conda install -y petsc4py mpi4py gfortran
conda init bash
conda info -e
conda install -y petsc4py gfortran
# Install dependencies of WISDEM specific to windows
- name: Add dependencies windows specific
if: contains( matrix.os, 'windows')
run: |
conda install -y m2w64-toolchain libpython
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Debug config
run: |
conda list
which -a gfortran
which pip
# Install WISDEM with setup
# Note: For some reason, pip --no-deps doesn't find conda packages and downloads everything
- name: Install WISDEM with setup
shell: bash -l {0}
#shell: pwsh
run: |
python setup.py develop
python setup.py install
# Install WISDEM with pip
- name: Install WISDEM with pip for Unix
if: false == contains( matrix.os, 'windows')
shell: bash -l {0}
#shell: pwsh
run: |
pip install -vv --no-deps -e .
#- name: Install WISDEM with pip for Unix
# if: false == contains( matrix.os, 'windows')
# run: |
# python setup.py install

# Install WISDEM with pip
#- name: Install WISDEM with pip for Windows
# if: contains( matrix.os, 'windows')
# shell: bash -l {0}
# shell: pwsh
# run: |
# pip install -vv --no-deps --global-option --compiler=unix .
# python setup.py install

# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

# Run all tests
- name: Run tests
if: contains( matrix.os, 'ubuntu')
shell: bash -l {0}
#shell: pwsh
if: false == contains( matrix.os, 'windows')
run: |
pytest -p no:warnings --disable-warnings --cov=wisdem
# Run limited test on WINDOWS
- name: Limited Windows test
if: contains( matrix.os, 'windows')
run: |
pytest --cov-config=.coverageac --cov=wisdem
cd wisdem/test/test_gluecode
pytest -p no:warnings --disable-warnings test_g*
# Run coveralls
- name: Run coveralls
if: contains( matrix.os, 'ubuntu')
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.10')
uses: coverallsapp/github-action@v2
# This also works, https://github.com/AndreMiras/coveralls-python-action
#uses: AndreMiras/coveralls-python-action@develop
shell: bash -l {0}
#shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#run: |
# coveralls --service=github

build_pip:
name: Pip Build-Test (${{ matrix.os }} Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -el {0}

strategy:
fail-fast: False
matrix:
os: [ubuntu-latest] #, windows-latest, macos-latest,
python-version: ["3.10"]

steps:
- name: Setup GNU Fortran
uses: awvwgk/setup-fortran@v1
#with:
# compiler: intel-classic

- name: checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: cp
with:
python-version: ${{ matrix.python-version }}
update-environment: true

# Install WISDEM with setup
# Note: For some reason, pip --no-deps doesn't find conda packages and downloads everything
- name: Install WISDEM with setup
run: |
'${{ steps.cp.outputs.python-path }}' -m pip install --upgrade pip install pytest
'${{ steps.cp.outputs.python-path }}' -m pip install -vv .
# Run limited tests
- name: Limited test
run: |
coveralls --service=github
cd wisdem/test/test_gluecode
pytest -p no:warnings --disable-warnings test_g*
66 changes: 66 additions & 0 deletions .github/workflows/Publish_WISDEM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and upload to PyPI
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml

# Build on every branch push, tag push, and pull request change:
#on: [push, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Setup GNU Fortran
uses: awvwgk/setup-fortran@v1

- name: Checkout
uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/
9 changes: 0 additions & 9 deletions .isort.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
repos:
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
stages: [commit]

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
name: black
stages: [commit]
language_version: python3

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
34 changes: 25 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,32 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"
# This leads to "excessive memory use"
#python: "miniconda-latest"
python: "mambaforge-22.9"
apt_packages:
- snapd
jobs:
# Read the docs needs a couple packages not in the environment file
pre_install:
- conda install -y cmake compilers sphinx sphinxcontrib-bibtex
- conda install sphinx_rtd_theme>=1.3
pre_build:
- pwd
- wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq && chmod +x yq
- ./yq -p yaml -o json wisdem/inputs/analysis_schema.yaml >| docs/schema/analysis_schema.json
- ./yq -p yaml -o json wisdem/inputs/modeling_schema.yaml >| docs/schema/modeling_schema.json
- sed -i -s '0,/properties/s//definitions/' docs/schema/modeling_schema.json
- sed -i -s '0,/properties/s//definitions/' docs/schema/analysis_schema.json
#- sed -i -s -e '/properties/{s//definitions/;:a' -e '$!N;$!ba' -e '}' docs/schema/modeling_schema.json
#- sed -i -s -e '/properties/{s//definitions/;:a' -e '$!N;$!ba' -e '}' docs/schema/analysis_schema.json


# Shouldn't need conda for building the docs, but it is an option
conda:
environment: docs/environment.yml
environment: environment.yml


# Build documentation in the docs/ directory with Sphinx
Expand All @@ -31,7 +46,8 @@ sphinx:
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
system_packages: true
extra_requirements:
- docs
# system_packages: true
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2012 NREL

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
12 changes: 12 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Copyright 2014 Alliance for Sustainable Energy, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Loading

0 comments on commit 21e3f9c

Please sign in to comment.