-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from WISDEM/ci_ccblade
Establish CI workflow for CCBlade
- Loading branch information
Showing
7 changed files
with
176 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
_Describe the bug here_ | ||
|
||
### Steps to reproduce issue | ||
_Please provide a minimum working example (MWE) if possible_ | ||
|
||
1. … | ||
2. … | ||
3. … | ||
|
||
### Current behavior | ||
… | ||
|
||
### Expected behavior | ||
… | ||
|
||
|
||
### Code versions | ||
_List versions only if relevant_ | ||
- Python | ||
- … |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Description of feature | ||
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? |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Delete the text explanations below these headers and replace them with information about your PR. | ||
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. | ||
|
||
## Type of change | ||
What types of change is it? | ||
_Select the appropriate type(s) that describe this PR_ | ||
|
||
- [ ] Bugfix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (non-backwards-compatible fix or feature) | ||
- [ ] Code style update (formatting, renaming) | ||
- [ ] Refactoring (no functional changes, no API changes) | ||
- [ ] Documentation update | ||
- [ ] Maintenance update | ||
- [ ] Other (please describe) | ||
|
||
## Testing | ||
Explain the steps needed to test the new code to verify that it does indeed address the issue and produce the expected behavior. | ||
|
||
## Checklist | ||
_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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: CI_CCBlade | ||
|
||
# We run CI on push commits and pull requests on all branches | ||
on: [push, pull_request] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build_pip: | ||
name: Pip Build (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: False | ||
matrix: | ||
os: ["ubuntu-latest"] #, "windows-latest"] | ||
python-version: [3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Pip Install Dependencies | ||
shell: pwsh | ||
run: | | ||
python -m pip install --upgrade openmdao numpy scipy pip pytest | ||
- name: Pip Install CCBlade | ||
shell: pwsh | ||
run: | | ||
pip install -e . | ||
# Run tests | ||
- name: Pip Run pytest | ||
shell: pwsh | ||
run: | | ||
pytest test | ||
build_conda: | ||
name: Conda Build (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: False | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] | ||
python-version: [3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
# https://github.com/marketplace/actions/setup-miniconda | ||
with: | ||
miniconda-version: "latest" | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: environment.yml | ||
|
||
# Install dependencies of WISDEM specific to windows | ||
- name: Add dependencies windows specific | ||
if: contains( matrix.os, 'windows') | ||
run: | | ||
conda install -y m2w64-toolchain libpython | ||
# Install | ||
- name: Conda Install CCBlade | ||
shell: pwsh | ||
run: | | ||
python setup.py develop | ||
# Run tests | ||
- name: Conda Run pytest | ||
shell: pwsh | ||
run: | | ||
pytest test | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: test | ||
|
||
channels: | ||
- conda-forge | ||
- defaults | ||
|
||
dependencies: | ||
- numpy | ||
- openmdao | ||
- pip | ||
- pytest | ||
- python | ||
- setuptools | ||
- scipy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "numpy"] | ||
build-backend = "setuptools.build_meta" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
from setuptools import setup | ||
from numpy.distutils.core import setup, Extension | ||
import os | ||
|
||
os.environ['NPY_DISTUTILS_APPEND_FLAGS'] = '1' | ||
|
||
setup( | ||
name='CCBlade', | ||
version='1.2.0', | ||
version='1.3.0', | ||
description='Blade element momentum aerodynamics for wind turbines', | ||
author='NREL WISDEM Team', | ||
author_email='systems.engineering@nrel.gov', | ||
#package_dir={'': 'src'}, | ||
#py_modules=['ccblade'], | ||
package_data={'ccblade': []}, | ||
packages=['ccblade'], | ||
#install_requires=['airfoilprep>=0.1'], | ||
install_requires=[ | ||
"numpy", | ||
"openmdao>=3.4", | ||
"scipy", | ||
], | ||
python_requires=">=3.7", | ||
# test_suite='test.test_ccblade.py', | ||
license='Apache License, Version 2.0', | ||
ext_modules=[Extension('ccblade._bem', ['ccblade/src/bem.f90'], extra_compile_args=['-O2','-fPIC'])], | ||
ext_modules=[Extension('ccblade._bem', | ||
sources=[os.path.join('ccblade','src','bem.f90')], | ||
extra_compile_args=['-O2','-fPIC','-std=c11'])], | ||
zip_safe=False | ||
) |