Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #285

Merged
merged 4 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .github/workflows/CI_WEIS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.9","3.10","3.11"]
os: ["ubuntu-latest", "macOS-13", "macOS-latest", "windows-latest"] # mac13 is intel, mac-14 arm
python-version: ["3.9","3.10","3.11","3.12"]

steps:
#- name: Setup GNU Fortran
# # if: false == contains( matrix.os, 'windows')
# uses: awvwgk/setup-fortran@main

- uses: actions/checkout@v4

- name: Install conda/mamba
Expand Down Expand Up @@ -56,17 +52,17 @@ jobs:
# Install WEIS
- name: Install WEIS
run: |
pip install -e . -v
python -m pip install --no-deps -e . -v

# Debugging session
#- name: Setup tmate session
# if: contains( matrix.os, 'windows')
# uses: mxschmitt/action-tmate@v3

# List the collected tests for debugging purposes
- name: List tests
run: |
pytest --collect-only weis
#- name: List tests
# run: |
# pytest --collect-only weis

# Run all tests within WEIS, but not computationally expensive examples
- name: Run tests within WEIS
Expand All @@ -76,10 +72,8 @@ jobs:
# Run coveralls
- name: Run coveralls
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.11')
uses: coverallsapp/github-action@v2
# This also works, https://github.com/AndreMiras/coveralls-python-action
#uses: AndreMiras/coveralls-python-action@develop
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#run: |
# coveralls --service=github
#uses: coverallsapp/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
8 changes: 6 additions & 2 deletions .github/workflows/run_exhaustive_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"] #, "macOS-latest"]
python-version: ["3.9","3.10", "3.11"]
python-version: ["3.9","3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -40,6 +40,10 @@ jobs:
if: false == contains( matrix.os, 'windows')
run: |
conda install -y petsc4py mpi4py openmpi

- name: Add test packages
run: |
conda install -y pytest pytest-cov coveralls treon

- name: Show custom environment
run: |
Expand All @@ -53,7 +57,7 @@ jobs:
# Install WEIS
- name: Install WEIS
run: |
pip install -e .
python -m pip install --no-deps -e . -v

# Test walkthrough notebook
- name: Test postprocessing notebooks
Expand Down
59 changes: 3 additions & 56 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,17 @@ channels:
- defaults

dependencies:
#- osqp # Works with the pip version, but not the conda version
- anyio
- argon2-cffi
- arrow
- async-lru
- babel
- beautifulsoup4
- bleach
- cffi
- comm
- debugpy
- decorator
- dill
- executing
- fqdn
- git
- ipython
- isoduration
- jedi
- jinja2
- json5
- jsonmerge
- jupyter
- jupyterlab
- markupsafe
- mat4py
- matplotlib
- meson
- mistune
- moorpy
- ninja
- nlopt
- nlopt
- notebook
- openfast=3.5.2
- openpyxl
- openfast
- openraft
- osqp
- overrides
- pandas
- parso
- patsy
- osqp
- pcrunch
- pexpect
- pip
- platformdirs
- psutil
- ptyprocess
- pyDOE3
- pygments
- pyhams
- python-json-logger
- pyzmq
- qdldl-python
- qtpy
- rosco
- scikit-learn
- setuptools
- smt
- tornado
- traitlets
- treon
- webencodings
- wisdem=3.15
- wisdem
- pip:
- dearpygui
- marmot-agents
Expand Down
10 changes: 8 additions & 2 deletions weis/glue_code/gc_PoseOptimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ def get_number_design_variables(self):


def set_objective(self, wt_opt):
if self.opt['merit_figure'] == 'blade_tip_deflection':
# Set merit figure. Each objective has its own scaling. Check first for user override
if self.opt["merit_figure_user"]["name"] != "":
coeff = -1.0 if self.opt["merit_figure_user"]["max_flag"] else 1.0
wt_opt.model.add_objective(self.opt["merit_figure_user"]["name"],
ref=coeff*np.abs(self.opt["merit_figure_user"]["ref"]))

elif self.opt['merit_figure'] == 'blade_tip_deflection':
wt_opt.model.add_objective('tcons_post.tip_deflection_ratio')

elif self.opt['merit_figure'] == 'DEL_RootMyb': # for DAC optimization on root-flap-bending moments
Expand All @@ -102,7 +108,7 @@ def set_objective(self, wt_opt):
elif self.opt['merit_figure'] == 'Cp':
wt_opt.model.add_objective('aeroelastic.Cp_out', ref=-1.)

elif self.opt['merit_figure'] == 'weis_lcoe':
elif self.opt['merit_figure'] == 'weis_lcoe' or self.opt['merit_figure'].lower() == 'lcoe':
wt_opt.model.add_objective('financese_post.lcoe')

elif self.opt['merit_figure'] == 'OL2CL_pitch':
Expand Down
Loading