Skip to content

Commit 71045b3

Browse files
authored
Allow newest version of OpenMDAO (#400)
* Removed upper bound on OM version added bi-monthly scheduled tests * Update to Python 3.10 for GHA and use MDO Lab flake8 and black tests * Formatted for new version of black * Moved flake8 OAS config file so MDO Lab action will pick it up * Trying to make flake8 happy * More flake8 changes * Whoops I messed up one of the tests * Test oldest package versions in GHA build * Fixing bugs in GHA file * More bugs with quotation marks * Updated oldest OM version and bumped patch version of OAS * Try older pytest version to fix seg fault in GHA * Try newer Python version for oldest and get rid of OpenVSP and pyGeo for debugging * Try back to 3.8 * Add in pySpline and pyGeo * Broke with pySpline/pyGeo, try only OpenVSP * See if OpenVSP is changing the numpy version * Trying an older vsp version so numpy doesn't update * Try installing OpenVSP before OAS and other deps * Add back in pySpline and pyGeo....*gulp* * Move pySpline/Geo install to after OAS install since it needs numpy * The error returns.....see if it can be reproduced without OpenVSP to save debugging time * Does Python 3.9 work * Try Python 3.10, otherwise it's a package issue * Oops, numpy 1.20 doesn't work on Python 3.10, try Python 3.8 but with the newest numpy scipy and OM * Python 3.8 with newest numpy scipy OM still breaks, try 3.10 with newest just to sanity check * Works as expected, try back to 3.8 with newest allowed numpy scipy and OM * See if working build on Python 3.10 works with older setuptools, the only package difference between working and not * Python version is the problem, try 3.9 again * See if Python 3.11 works just for fun * Does it really work fine without pygeo, wtf matplotlib... * How about an older matplotlib * Try an older version of pyGeo * Fixed type in GHA build file * Changed name to specify pygeo version * Try pyGeo v1.12.0 * pyGeo 1.12.0 seems to work, try 1.12.1 * pyGeo 1.12.1 seems to work, try 1.12.2 * pyGeo 1.12.2 seems to work, try latest again * Revert back to pyGeo 1.12.2 for the old build * Get rid of tagged matplotlib version * Add back in OpenVSP * Cleaning up the YAML file * Kinda abusing the build matrix but whatchagonnado * gabagool * Maya Angelou: You will face many defeats in life, but never let yourself be defeated * New table for RTD * pyGeo v1.6.0 on oldest build * Does pyGeo error go away if I install OAS in place * Go back to working build with pyGeo 1.6.0 and update docs
1 parent 473232a commit 71045b3

88 files changed

Lines changed: 148 additions & 310 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ extend-exclude =
44
openaerostruct/docs/conf.py,
55
openaerostruct/docs/aero_walkthrough/part*.py,
66
openaerostruct/docs/_utils/docutil.py,
7-
openaerostruct/docs/_utils/patch.py
7+
openaerostruct/docs/_utils/patch.py,
8+
openaerostruct/utils/plot_*.py,

.github/workflows/oas.yml

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,38 @@ on:
1111
- main
1212
tags:
1313
- v*.*.*
14+
schedule:
15+
# Run the tests at 7:23pm UTC on the 2nd and 17th of every month
16+
- cron: '23 19 2,17 * *'
1417

1518
jobs:
1619
# --- run OAS unit and regression tests ---
1720
test:
1821
runs-on: ubuntu-latest
19-
env:
20-
VSP_VERSION: 3.27.1
22+
strategy:
23+
matrix:
24+
dep-versions: ["oldest", "latest"]
25+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
PYTHON_VERSION_OLDEST: ['3.8']
27+
PYTHON_VERSION_LATEST: ['3.11']
28+
NUMPY_VERSION_OLDEST: ['1.20'] # latest is most recent on PyPI
29+
SCIPY_VERSION_OLDEST: ['1.6.0'] # latest is most recent on PyPI
30+
OPENMDAO_VERSION_OLDEST: ['3.10'] # latest is most recent on PyPI
31+
PYGEO_VERSION_OLDEST: ['1.6.0'] # latest is pulled from main branch, for some reason anything after 1.12.2 seg faults on the old build
32+
VSP_VERSION: ['3.27.1'] # used for both builds
2133

2234
steps:
2335
- uses: actions/checkout@v2
24-
- name: Set up Python 3.8
36+
- name: Set up Python ${{ matrix.PYTHON_VERSION_OLDEST }}
37+
if: ${{ matrix.dep-versions == 'oldest' }}
2538
uses: actions/setup-python@v2
2639
with:
27-
python-version: '3.8'
28-
29-
# OAS dependencies are specified in setup.py.
30-
- name: Install OAS and its dependencies
31-
run: |
32-
python -m pip install --upgrade pip wheel
33-
pip install .[test]
34-
35-
# we need pySpline/pyGeo to run FFD tests.
36-
- name: Install pySpline and pyGeo
37-
run: |
38-
cd ..
39-
sudo apt-get install openmpi-bin libopenmpi-dev
40-
pip install mpi4py
41-
git clone https://github.com/mdolab/pyspline.git
42-
cd pyspline
43-
cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk
44-
make
45-
pip install -e .
46-
cd ..
47-
pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git"
40+
python-version: ${{ matrix.PYTHON_VERSION_OLDEST }}
41+
- name: Set up Python ${{ matrix.PYTHON_VERSION_LATEST }}
42+
if: ${{ matrix.dep-versions == 'latest' }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.PYTHON_VERSION_LATEST }}
4846

4947
# we need OpenVSP to run vsp tests.
5048
- name: Install OpenVSP
@@ -59,9 +57,9 @@ jobs:
5957
cd OpenVSP
6058
mkdir build buildlibs
6159
# Download source code
62-
wget -q https://github.com/OpenVSP/OpenVSP/archive/refs/tags/OpenVSP_${VSP_VERSION}.tar.gz
63-
tar -xf OpenVSP_${VSP_VERSION}.tar.gz
64-
mv OpenVSP-OpenVSP_${VSP_VERSION} repo
60+
wget -q https://github.com/OpenVSP/OpenVSP/archive/refs/tags/OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz
61+
tar -xf OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz
62+
mv OpenVSP-OpenVSP_${{ matrix.VSP_VERSION }} repo
6563
# Build dependency libs
6664
cd buildlibs
6765
cmake -DVSP_USE_SYSTEM_LIBXML2=true -DVSP_USE_SYSTEM_FLTK=true -DVSP_USE_SYSTEM_GLM=true \
@@ -79,13 +77,51 @@ jobs:
7977
make -j8
8078
make package
8179
# Install python interface
82-
pushd _CPack_Packages/Linux/ZIP/OpenVSP-${VSP_VERSION}-Linux/python
80+
pushd _CPack_Packages/Linux/ZIP/OpenVSP-${{ matrix.VSP_VERSION }}-Linux/python
8381
pip install -r requirements.txt
8482
pushd ..
8583
cp vspaero vspscript vspslicer $INST_PREFIX/bin
8684
popd
8785
popd
8886
87+
# OAS dependencies are specified in setup.py.
88+
- name: Install OAS and its dependencies (oldest versions)
89+
if: ${{ matrix.dep-versions == 'oldest' }}
90+
run: |
91+
python -m pip install --upgrade pip wheel
92+
pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }}
93+
pip install -e .[test]
94+
- name: Install OAS and its dependencies (latest versions)
95+
if: ${{ matrix.dep-versions == 'latest' }}
96+
run: |
97+
python -m pip install --upgrade pip wheel
98+
pip install -e .[test]
99+
100+
# We need pySpline/pyGeo to run FFD tests.
101+
- name: Install pySpline
102+
run: |
103+
cd ..
104+
sudo apt-get install openmpi-bin libopenmpi-dev
105+
pip install mpi4py
106+
git clone https://github.com/mdolab/pyspline.git
107+
cd pyspline
108+
cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk
109+
make
110+
pip install -e .
111+
112+
- name: Install pyGeo ${{ matrix.PYGEO_VERSION_OLDEST }}
113+
if: ${{ matrix.dep-versions == 'oldest' }}
114+
run: |
115+
pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git@v${{ matrix.PYGEO_VERSION_OLDEST }}"
116+
- name: Install pyGeo latest
117+
if: ${{ matrix.dep-versions == 'latest' }}
118+
run: |
119+
pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git"
120+
121+
- name: List installed Python packages
122+
run: |
123+
pip list -v
124+
89125
- name: Run tests
90126
env:
91127
OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages
@@ -97,41 +133,11 @@ jobs:
97133
with:
98134
fail_ci_if_error: true
99135
token: ${{ secrets.CODECOV_TOKEN }}
100-
101-
# --- code style check by flake8 ---
102-
flake8:
103-
runs-on: ubuntu-latest
104-
105-
steps:
106-
- uses: actions/checkout@v2
107-
- name: Set up Python 3.8
108-
uses: actions/setup-python@v2
109-
with:
110-
python-version: '3.8'
111-
112-
# use both MDO Lab standard config
113-
- name: Code style (flake8)
114-
run: |
115-
pip install flake8==3.9.2
116-
wget https://raw.githubusercontent.com/mdolab/.github/main/.flake8 -O .flake8_mdolab
117-
python -m flake8 openaerostruct --append-config .flake8_mdolab --append-config .github/.flake8_oas_specific --count --show-source --statistics
118-
119-
# --- code format check by black ---
136+
# --- linting and formatting ---
120137
black:
121-
runs-on: ubuntu-latest
122-
123-
steps:
124-
- uses: actions/checkout@v2
125-
- name: Set up Python 3.8
126-
uses: actions/setup-python@v2
127-
with:
128-
python-version: '3.8'
129-
130-
# code format check by black
131-
- name: Code format (black)
132-
run: |
133-
pip install black==22.3.0
134-
black openaerostruct --check --diff -l 120 --target-version py38
138+
uses: mdolab/.github/.github/workflows/black.yaml@main
139+
flake8:
140+
uses: mdolab/.github/.github/workflows/flake8.yaml@main
135141

136142
# --- publish to PyPI
137143
pypi:

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,23 @@ Shamsheer S. Chauhan and Joaquim R. R. A. Martins, “Low-Fidelity Aerostructura
7676

7777
Version Information
7878
-------------------
79-
The latest version of OpenAeroStruct requires [OpenMDAO](https://github.com/OpenMDAO/openmdao) (versions 3.2.0 to 3.16.0) and Python3.
80-
Python2 is no longer supported.
81-
It also requires the folloing packages: `numpy, scipy, matplotlib`.
79+
The oldest and latest versions of the dependencies that we test regularly are the following (other versions may work, but no guarantees):
80+
81+
| Dependency | oldest | latest |
82+
| ---------- | ------ | ------ |
83+
| Python | 3.8 | 3.11 |
84+
| NumPy | 1.20 | latest |
85+
| SciPy | 1.6.0 | latest |
86+
| OpenMDAO | 3.10 | latest |
87+
| Matplotlib | latest | latest |
88+
| pyGeo (optional) | 1.6.0 | latest |
89+
| OpenVSP (optional) | 3.27.1 | 3.27.1 |
90+
8291
If you are looking to use the previous version of OpenAeroStruct which uses OpenMDAO 1.7.4, use OpenAeroStruct 1.0 from [here](https://github.com/mdolab/OpenAeroStruct/releases).
8392

8493
License
8594
-------
86-
Copyright 2018-2022 MDO Lab
95+
Copyright 2018-2023 MDO Lab
8796

8897
Licensed under the Apache License, Version 2.0 (the "License");
8998
you may not use this file except in compliance with the License.

openaerostruct/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.5.2"
1+
__version__ = "2.5.3"

openaerostruct/aerodynamics/lift_coeff_2D.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def setup(self):
6969
self.declare_partials("Cl", "sec_forces", rows=rows, cols=cols)
7070

7171
def compute(self, inputs, outputs):
72-
7372
# Input parameters
7473
alpha = inputs["alpha"] * np.pi / 180.0
7574
cosa = np.cos(alpha)

openaerostruct/aerodynamics/mesh_point_forces.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def compute(self, inputs, outputs):
7373
le_wt = self.options["le_wt"]
7474
te_wt = self.options["te_wt"]
7575
for surface in surfaces:
76-
7776
name = surface["name"]
7877
sec_forces_name = "{}_sec_forces".format(name)
7978
mesh_point_forces_name = "{}_mesh_point_forces".format(name)

openaerostruct/aerodynamics/pg_scale.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ def initialize(self):
265265
self.options.declare("surfaces", types=list)
266266

267267
def setup(self):
268-
269268
self.add_input("Mach_number", val=0.0)
270269

271270
# We'll compute all of sensitivities associated with Mach number through

openaerostruct/aerodynamics/rotational_velocity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def compute_partials(self, inputs, J):
9797
surfaces = self.options["surfaces"]
9898
idx = jdx = 0
9999
ii = self.system_size * 3
100-
for j, surface in enumerate(surfaces):
100+
for surface in surfaces:
101101
mesh = surface["mesh"]
102102
nx = mesh.shape[0]
103103
ny = mesh.shape[1]

openaerostruct/aerodynamics/viscous_drag.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def compute_partials(self, inputs, partials):
121121
t_over_c = inputs["t_over_c"]
122122

123123
if self.with_viscous:
124-
125124
M = inputs["Mach_number"]
126125
S_ref = inputs["S_ref"]
127126
widths = inputs["widths"]
@@ -171,7 +170,6 @@ def compute_partials(self, inputs, partials):
171170
if self.k_lam == 0:
172171
cdT_Re = 0.455 / (np.log10(Re_c)) ** 3.58 / B * -2.58 / np.log(10) / Re_c
173172
elif self.k_lam < 1.0:
174-
175173
cdl_Re = 1.328 / (Re_c * self.k_lam) ** 1.5 * -0.5 * self.k_lam
176174
cdt_Re = 0.455 / (np.log10(Re_c * self.k_lam)) ** 3.58 / B * -2.58 / np.log(10) / Re_c
177175
cdT_Re = 0.455 / (np.log10(Re_c)) ** 3.58 / B * -2.58 / np.log(10) / Re_c

openaerostruct/common/atmos_comp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,6 @@ def setup(self):
741741
self.declare_partials("v", "Mach_number")
742742

743743
def compute(self, inputs, outputs):
744-
745744
outputs["T"] = T_interp(inputs["altitude"])
746745
outputs["P"] = P_interp(inputs["altitude"])
747746
outputs["rho"] = rho_interp(inputs["altitude"])
@@ -751,7 +750,6 @@ def compute(self, inputs, outputs):
751750
outputs["v"] = outputs["speed_of_sound"] * inputs["Mach_number"]
752751

753752
def compute_partials(self, inputs, partials):
754-
755753
partials["T", "altitude"] = T_interp_deriv(inputs["altitude"])
756754
partials["P", "altitude"] = P_interp_deriv(inputs["altitude"])
757755
partials["rho", "altitude"] = rho_interp_deriv(inputs["altitude"])

0 commit comments

Comments
 (0)