From 7fb3a7026ecf5a4e4cae1e0a835b3fe2e27ab52b Mon Sep 17 00:00:00 2001 From: Alasdair Christison Gray Date: Sun, 14 Jul 2024 22:25:24 -0400 Subject: [PATCH 01/18] Fix bug in wave drag derivatives --- openaerostruct/aerodynamics/wave_drag.py | 42 +++++++++++++++--------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/openaerostruct/aerodynamics/wave_drag.py b/openaerostruct/aerodynamics/wave_drag.py index 07d793329..2b013d1f3 100644 --- a/openaerostruct/aerodynamics/wave_drag.py +++ b/openaerostruct/aerodynamics/wave_drag.py @@ -67,14 +67,15 @@ def compute(self, inputs, outputs): chords = inputs["chords"] CL = inputs["CL"] - mean_chords = (chords[:-1] + chords[1:]) / 2.0 - panel_areas = mean_chords * widths - avg_cos_sweep = np.sum(cos_sweep * panel_areas) / np.sum(panel_areas) # weighted average of 1/4 chord sweep - avg_t_over_c = np.sum(t_over_c * panel_areas) / np.sum(panel_areas) # weighted average of streamwise t/c + panel_mid_chords = (chords[:-1] + chords[1:]) / 2.0 + panel_areas = panel_mid_chords * widths + sum_panel_areas = np.sum(panel_areas) + avg_cos_sweep = np.sum(cos_sweep * panel_areas) / sum_panel_areas # weighted average of 1/4 chord sweep + avg_t_over_c = np.sum(t_over_c * panel_areas) / sum_panel_areas # weighted average of streamwise t/c MDD = self.ka / avg_cos_sweep - avg_t_over_c / avg_cos_sweep**2 - CL / (10 * avg_cos_sweep**3) Mcrit = MDD - (0.1 / 80.0) ** (1.0 / 3.0) - if M > Mcrit: + if np.real(M) > np.real(Mcrit): outputs["CDw"] = 20 * (M - Mcrit) ** 4 else: outputs["CDw"] = 0.0 @@ -86,6 +87,14 @@ def compute(self, inputs, outputs): def compute_partials(self, inputs, partials): """Jacobian for wave drag.""" + # Explicitly zero out the partials to begin, we can't assume the input partials arrays contain zeros already + partials["CDw", "CL"][:] = 0.0 + partials["CDw", "lengths_spanwise"][:] = 0.0 + partials["CDw", "widths"][:] = 0.0 + partials["CDw", "Mach_number"][:] = 0.0 + partials["CDw", "chords"][:] = 0.0 + partials["CDw", "t_over_c"][:] = 0.0 + if self.with_wave: ny = self.surface["mesh"].shape[1] t_over_c = inputs["t_over_c"] @@ -96,16 +105,16 @@ def compute_partials(self, inputs, partials): chords = inputs["chords"] CL = inputs["CL"] - chords = (chords[:-1] + chords[1:]) / 2.0 - panel_areas = chords * widths + panel_mid_chords = (chords[:-1] + chords[1:]) / 2.0 + panel_areas = panel_mid_chords * widths sum_panel_areas = np.sum(panel_areas) avg_cos_sweep = np.sum(cos_sweep * panel_areas) / sum_panel_areas avg_t_over_c = np.sum(t_over_c * panel_areas) / sum_panel_areas - MDD = 0.95 / avg_cos_sweep - avg_t_over_c / avg_cos_sweep**2 - CL / (10 * avg_cos_sweep**3) + MDD = self.ka / avg_cos_sweep - avg_t_over_c / avg_cos_sweep**2 - CL / (10 * avg_cos_sweep**3) Mcrit = MDD - (0.1 / 80.0) ** (1.0 / 3.0) - if M > Mcrit: + if np.real(M) > np.real(Mcrit): dCDwdMDD = -80 * (M - Mcrit) ** 3 dMDDdCL = -1.0 / (10 * avg_cos_sweep**3) dMDDdavg = (-10 * self.ka * avg_cos_sweep**2 + 20 * avg_t_over_c * avg_cos_sweep + 3 * CL) / ( @@ -114,14 +123,17 @@ def compute_partials(self, inputs, partials): dMDDdtoc = -1.0 / (avg_cos_sweep**2) dtocavgdtoc = panel_areas / sum_panel_areas - ccos = np.sum(widths * chords) - ccos2w = np.sum(chords * widths**2 / lengths_spanwise) + ccos = np.sum(widths * panel_mid_chords) + ccos2w = np.sum(panel_mid_chords * widths**2 / lengths_spanwise) - davgdcos = 2 * chords * widths / lengths_spanwise / ccos - chords * ccos2w / ccos**2 - dtocdcos = chords * t_over_c / ccos - chords * np.sum(chords * widths * t_over_c) / ccos**2 - davgdw = -1 * chords * widths**2 / lengths_spanwise**2 / ccos + davgdcos = 2 * panel_mid_chords * widths / lengths_spanwise / ccos - panel_mid_chords * ccos2w / ccos**2 + dtocdcos = ( + panel_mid_chords * t_over_c / ccos + - panel_mid_chords * np.sum(panel_mid_chords * widths * t_over_c) / ccos**2 + ) + davgdw = -1 * panel_mid_chords * widths**2 / lengths_spanwise**2 / ccos davgdc = widths**2 / lengths_spanwise / ccos - widths * ccos2w / ccos**2 - dtocdc = t_over_c * widths / ccos - widths * np.sum(chords * widths * t_over_c) / ccos**2 + dtocdc = t_over_c * widths / ccos - widths * np.sum(panel_mid_chords * widths * t_over_c) / ccos**2 dcdchords = np.zeros((ny - 1, ny)) i, j = np.indices(dcdchords.shape) From 36508499b3a6a429473709d88855c3b1732eb72b Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 09:42:55 -0400 Subject: [PATCH 02/18] black --- openaerostruct/aerodynamics/wave_drag.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openaerostruct/aerodynamics/wave_drag.py b/openaerostruct/aerodynamics/wave_drag.py index 2b013d1f3..0b58e6b22 100644 --- a/openaerostruct/aerodynamics/wave_drag.py +++ b/openaerostruct/aerodynamics/wave_drag.py @@ -126,7 +126,9 @@ def compute_partials(self, inputs, partials): ccos = np.sum(widths * panel_mid_chords) ccos2w = np.sum(panel_mid_chords * widths**2 / lengths_spanwise) - davgdcos = 2 * panel_mid_chords * widths / lengths_spanwise / ccos - panel_mid_chords * ccos2w / ccos**2 + davgdcos = ( + 2 * panel_mid_chords * widths / lengths_spanwise / ccos - panel_mid_chords * ccos2w / ccos**2 + ) dtocdcos = ( panel_mid_chords * t_over_c / ccos - panel_mid_chords * np.sum(panel_mid_chords * widths * t_over_c) / ccos**2 From 5bce62fdc257f45981eeceb381bb5d06cd2c447a Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 10:13:31 -0400 Subject: [PATCH 03/18] Ignore OpenMDAO reports folders --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8582ff81f..bf8c8aedf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Ignore OpenMDAO reports folders +**/reports/ + *.pyc *.py~ *.db @@ -19,6 +22,6 @@ openaerostruct/docs/_srcdocs/ *.msg src/adjoint/tempReverse/ src/adjoint/tempForward/ -openaerostruct.egg-info/ +openaerostruct.egg-info/ .vscode *.plt From c61ff5abf7fadd5dfb060a2cefda564684117812 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 10:58:23 -0400 Subject: [PATCH 04/18] tests --- ...ct_wingbox_wave_fuel_vol_constraint_opt.py | 16 +++++---- openaerostruct/tests/test_scaneagle.py | 33 ++++++++++++++----- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py index 0b8a73353..0760200a2 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py @@ -289,7 +289,7 @@ def test(self): # Airfoil properties for viscous drag calculation "k_lam": 0.05, # percentage of chord with laminar # flow, used for viscous drag - "t_over_c_cp": np.array([0.08, 0.08, 0.08, 0.10, 0.10, 0.08]), + "t_over_c_cp": 0.12 * np.ones(6), # np.array([0.08, 0.08, 0.08, 0.10, 0.10, 0.12]), "original_wingbox_airfoil_t_over_c": 0.12, "c_max_t": 0.38, # chordwise location of maximum thickness "with_viscous": True, @@ -317,10 +317,11 @@ def test(self): # Add problem information as an independent variables component indep_var_comp = om.IndepVarComp() - indep_var_comp.add_output("v", val=0.85 * 295.07, units="m/s") + Mach = 0.77 + indep_var_comp.add_output("v", val=Mach * 295.07, units="m/s") indep_var_comp.add_output("alpha", val=0.0, units="deg") - indep_var_comp.add_output("Mach_number", val=0.85) - indep_var_comp.add_output("re", val=0.348 * 295.07 * 0.85 * 1.0 / (1.43 * 1e-5), units="1/m") + indep_var_comp.add_output("Mach_number", val=Mach) + indep_var_comp.add_output("re", val=0.348 * 295.07 * Mach * 1.0 / (1.43 * 1e-5), units="1/m") indep_var_comp.add_output("rho", val=0.348, units="kg/m**3") indep_var_comp.add_output("CT", val=0.53 / 3600, units="1/s") indep_var_comp.add_output("R", val=14.307e6, units="m") @@ -412,7 +413,7 @@ def test(self): prob.model.add_design_var("wing.twist_cp", lower=-15.0, upper=15.0, scaler=0.1) prob.model.add_design_var("wing.spar_thickness_cp", lower=0.003, upper=0.1, scaler=1e2) prob.model.add_design_var("wing.skin_thickness_cp", lower=0.003, upper=0.1, scaler=1e2) - prob.model.add_design_var("wing.geometry.t_over_c_cp", lower=0.07, upper=0.2, scaler=10.0) + prob.model.add_design_var("wing.geometry.t_over_c_cp", lower=0.06, upper=0.2, scaler=10.0) prob.model.add_constraint("AS_point_0.CL", equals=0.5) prob.model.add_constraint("AS_point_0.wing_perf.failure", upper=0.0) @@ -429,8 +430,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 78292.730861421, 1e-5) - assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 16168.330307591294, 1e-5) + self.assertEqual(prob.driver.get_exit_status(), "SUCCESS") + assert_near_equal(prob["AS_point_0.fuelburn"][0], 85348.88283214, 1e-5) + assert_near_equal(prob["wing.structural_mass"][0], 13029.71120634, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_scaneagle.py b/openaerostruct/tests/test_scaneagle.py index 72d65e04b..f9a35c6b1 100644 --- a/openaerostruct/tests/test_scaneagle.py +++ b/openaerostruct/tests/test_scaneagle.py @@ -8,10 +8,11 @@ from openaerostruct.geometry.utils import generate_mesh from openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint from openaerostruct.utils.constants import grav_constant +from openaerostruct.utils.testing import assert_check_totals class Test(unittest.TestCase): - def test(self): + def setUp(self): # Total number of nodes to use in the spanwise (num_y) and # chordwise (num_x) directions. Vary these to change the level of fidelity. num_y = 21 @@ -86,7 +87,7 @@ def test(self): "c_max_t": 0.303, # chordwise location of maximum (NACA0015) # thickness "with_viscous": True, - "with_wave": False, # if true, compute wave drag + "with_wave": True, # if true, compute wave drag # Material properties taken from http://www.performance-composites.com/carbonfibre/mechanicalproperties_2.asp "E": 85.0e9, "G": 25.0e9, @@ -200,13 +201,29 @@ def test(self): # Set up the problem prob.setup() - # Actually run the optimization problem - prob.run_driver() + self.prob = prob - assert_near_equal(prob["AS_point_0.fuelburn"][0], 4.6365011384888275, 1e-5) - assert_near_equal(prob["wing.twist_cp"], np.array([2.25819837, 10.39881572, 5.0]), 1e-5) - assert_near_equal(prob["wing.sweep"][0], 18.964409030629632, 1e-5) - assert_near_equal(prob["alpha"][0], 2.0366563718492547, 1e-5) + def test_opt(self): + # Actually run the optimization problem + self.prob.run_driver() + + assert_near_equal(self.prob["AS_point_0.fuelburn"][0], 4.6365011384888275, 1e-5) + assert_near_equal(self.prob["wing.twist_cp"], np.array([2.25819837, 10.39881572, 5.0]), 1e-5) + assert_near_equal(self.prob["wing.sweep"][0], 18.964409030629632, 1e-5) + assert_near_equal(self.prob["alpha"][0], 2.0366563718492547, 1e-5) + + def test_totals(self): + self.prob.run_model() + totals = self.prob.check_totals( + method="fd", + form="central", + step=5e-4, + step_calc="rel", + compact_print=True, + abs_err_tol=1e-2, + rel_err_tol=1e-5, + ) + assert_check_totals(totals, atol=1e-4, rtol=1e-5) if __name__ == "__main__": From 994e9713930bd7b8eabb97acdd1567586f06d1db Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 11:12:42 -0400 Subject: [PATCH 05/18] tweak scaneagle test --- openaerostruct/tests/test_scaneagle.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openaerostruct/tests/test_scaneagle.py b/openaerostruct/tests/test_scaneagle.py index f9a35c6b1..10b0a7059 100644 --- a/openaerostruct/tests/test_scaneagle.py +++ b/openaerostruct/tests/test_scaneagle.py @@ -198,12 +198,11 @@ def setUp(self): # We're trying to minimize fuel burn prob.model.add_objective("AS_point_0.fuelburn", scaler=0.1) - # Set up the problem - prob.setup() - self.prob = prob def test_opt(self): + # Set up the problem + self.prob.setup() # Actually run the optimization problem self.prob.run_driver() @@ -213,6 +212,8 @@ def test_opt(self): assert_near_equal(self.prob["alpha"][0], 2.0366563718492547, 1e-5) def test_totals(self): + # Set up the problem + self.prob.setup() self.prob.run_model() totals = self.prob.check_totals( method="fd", From a4eb11d884f892a1cc41e67f51dc2449a9e202a7 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 11:12:52 -0400 Subject: [PATCH 06/18] bump patch version --- openaerostruct/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openaerostruct/__init__.py b/openaerostruct/__init__.py index 7f9085047..573a7705c 100644 --- a/openaerostruct/__init__.py +++ b/openaerostruct/__init__.py @@ -1 +1 @@ -__version__ = "2.7.2" +__version__ = "2.7.3" From 5bf3e8e62fbbebc4a51dad213590138153fc87f6 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 11:35:24 -0400 Subject: [PATCH 07/18] Bump oldest supported versions of things --- .github/workflows/oas.yml | 10 ++++------ README.md | 10 +++++----- openaerostruct/docs/installation.rst | 10 +++++----- setup.py | 6 +++--- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 43820afa2..709b5ebd5 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -20,15 +20,14 @@ jobs: test: runs-on: ubuntu-latest strategy: - fail-fast: false # continue other jobs even if one of the jobs in matrix fails + fail-fast: false # continue other jobs even if one of the jobs in matrix fails matrix: dep-versions: ["oldest", "latest"] # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - PYTHON_VERSION_OLDEST: ['3.8'] + PYTHON_VERSION_OLDEST: ['3.9'] PYTHON_VERSION_LATEST: ['3.11'] - WHEEL_VERSION_OLDEST: ['0.38.4'] # latest wheel cannot build the oldest OpenMDAO (3.17 or older) - NUMPY_VERSION_OLDEST: ['1.20'] # latest is most recent on PyPI - SCIPY_VERSION_OLDEST: ['1.6.0'] # latest is most recent on PyPI + NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI + SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI OPENMDAO_VERSION_OLDEST: ['3.15'] # latest is most recent on PyPI MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI 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 @@ -94,7 +93,6 @@ jobs: - name: Install OAS and its dependencies (oldest versions) if: ${{ matrix.dep-versions == 'oldest' }} run: | - python -m pip install wheel==${{ matrix.WHEEL_VERSION_OLDEST }} pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }} pip install -e .[test] - name: Install OAS and its dependencies (latest versions) diff --git a/README.md b/README.md index d8eaf7d81..856a5ad2e 100644 --- a/README.md +++ b/README.md @@ -94,11 +94,11 @@ Version Information The oldest and latest versions of the dependencies that we test regularly are the following (other versions may work, but no guarantees): | Dependency | oldest | latest | -|--------------------|--------| ------ | -| Python | 3.8 | 3.11 | -| NumPy | 1.20 | latest | -| SciPy | 1.6.0 | latest | -| OpenMDAO | 3.15 | latest | +| ------------------ | ------ | ------ | +| Python | 3.9 | 3.11 | +| NumPy | 1.24 | latest | +| SciPy | 1.9.0 | latest | +| OpenMDAO | 3.20 | latest | | MPhys | 1.0.0 | latest | | Matplotlib | latest | latest | | pyGeo (optional) | 1.6.0 | latest | diff --git a/openaerostruct/docs/installation.rst b/openaerostruct/docs/installation.rst index f4eca5869..cfe018ca8 100644 --- a/openaerostruct/docs/installation.rst +++ b/openaerostruct/docs/installation.rst @@ -35,16 +35,16 @@ The oldest and latest versions of the dependencies that we test regularly are th - oldest - latest * - Python - - 3.8 + - 3.9 - 3.11 * - NumPy - - 1.20 + - 1.24 - latest * - SciPy - - 1.6.0 + - 1.9.0 - latest * - OpenMDAO - - 3.15 + - 3.20 - latest * - Matplotlib - latest @@ -70,7 +70,7 @@ To run the tests on your machine, use the [test] option. This will install the p Then run the tests from the OpenAeroStruct root directory by calling: .. code-block:: bash - + testflo -v . To install the dependencies to build the documentation locally, run: diff --git a/setup.py b/setup.py index ee0d8435b..21ef6b424 100644 --- a/setup.py +++ b/setup.py @@ -53,9 +53,9 @@ package_data={"openaerostruct": ["tests/*.py", "*/tests/*.py", "*/*/tests/*.py"]}, install_requires=[ # Remember to update the oldest versions in the GitHub Actions build, the readme, and in docs/installation.rst - "openmdao>=3.15", - "numpy>=1.20", - "scipy>=1.6.0", + "openmdao>=3.20", + "numpy>=1.24", + "scipy>=1.9", "matplotlib", ], extras_require=optional_dependencies, From a9a19669caa3f7bf42425867add430cc70b7055b Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 11:39:03 -0400 Subject: [PATCH 08/18] Forgot to bump `OPENMDAO_VERSION_OLDEST` --- .github/workflows/oas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 709b5ebd5..cac119e47 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -28,7 +28,7 @@ jobs: PYTHON_VERSION_LATEST: ['3.11'] NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI - OPENMDAO_VERSION_OLDEST: ['3.15'] # latest is most recent on PyPI + OPENMDAO_VERSION_OLDEST: ['3.20'] # latest is most recent on PyPI MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI 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 VSP_VERSION: ['3.27.1'] # used for both builds From 2bab81b7003b0fb3e5a017ab3f9aec1f752cc9f9 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 11:51:17 -0400 Subject: [PATCH 09/18] Need openmdao 3.22 to work with numpy 1.24 --- .github/workflows/oas.yml | 2 +- README.md | 2 +- openaerostruct/docs/installation.rst | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index cac119e47..220c2909e 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -28,7 +28,7 @@ jobs: PYTHON_VERSION_LATEST: ['3.11'] NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI - OPENMDAO_VERSION_OLDEST: ['3.20'] # latest is most recent on PyPI + OPENMDAO_VERSION_OLDEST: ['3.22'] # latest is most recent on PyPI MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI 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 VSP_VERSION: ['3.27.1'] # used for both builds diff --git a/README.md b/README.md index 856a5ad2e..1b1d67d36 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ The oldest and latest versions of the dependencies that we test regularly are th | Python | 3.9 | 3.11 | | NumPy | 1.24 | latest | | SciPy | 1.9.0 | latest | -| OpenMDAO | 3.20 | latest | +| OpenMDAO | 3.22 | latest | | MPhys | 1.0.0 | latest | | Matplotlib | latest | latest | | pyGeo (optional) | 1.6.0 | latest | diff --git a/openaerostruct/docs/installation.rst b/openaerostruct/docs/installation.rst index cfe018ca8..3df3c8ae5 100644 --- a/openaerostruct/docs/installation.rst +++ b/openaerostruct/docs/installation.rst @@ -44,7 +44,7 @@ The oldest and latest versions of the dependencies that we test regularly are th - 1.9.0 - latest * - OpenMDAO - - 3.20 + - 3.22 - latest * - Matplotlib - latest diff --git a/setup.py b/setup.py index 21ef6b424..b0800c634 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ package_data={"openaerostruct": ["tests/*.py", "*/tests/*.py", "*/*/tests/*.py"]}, install_requires=[ # Remember to update the oldest versions in the GitHub Actions build, the readme, and in docs/installation.rst - "openmdao>=3.20", + "openmdao>=3.22", "numpy>=1.24", "scipy>=1.9", "matplotlib", From 9ef3db2500bdc8b46620e96e8b6a8fdd2dae504a Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 13:26:05 -0400 Subject: [PATCH 10/18] Try running tests on our docker images --- .github/workflows/oas.yml | 167 +++++--------------------------------- 1 file changed, 20 insertions(+), 147 deletions(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 220c2909e..11e933c29 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -16,158 +16,31 @@ on: - cron: '23 19 2,17 * *' jobs: - # --- run OAS unit and regression tests --- test: - runs-on: ubuntu-latest strategy: - fail-fast: false # continue other jobs even if one of the jobs in matrix fails + fail-fast: false matrix: - dep-versions: ["oldest", "latest"] - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - PYTHON_VERSION_OLDEST: ['3.9'] - PYTHON_VERSION_LATEST: ['3.11'] - NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI - SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI - OPENMDAO_VERSION_OLDEST: ['3.22'] # latest is most recent on PyPI - MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI - 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 - VSP_VERSION: ['3.27.1'] # used for both builds - PETSC_VERSION_LATEST: ['3.19.1'] - CYTHON_VERSION: ['0.29.36'] # used for both builds + dockerImage: [stable, latest] + runs-on: ubuntu-latest + container: mdolab/public:u22-gcc-ompi-${{ matrix.dockerImage }}-amd64 steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.PYTHON_VERSION_OLDEST }} - if: ${{ matrix.dep-versions == 'oldest' }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.PYTHON_VERSION_OLDEST }} - - name: Set up Python ${{ matrix.PYTHON_VERSION_LATEST }} - if: ${{ matrix.dep-versions == 'latest' }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.PYTHON_VERSION_LATEST }} - - # we need OpenVSP to run vsp tests. - - name: Install OpenVSP - run: | - sudo apt-get update - export PYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") - export PYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") - export INST_PREFIX=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('prefix'))") - cd .. - sudo apt-get install cmake libx11-dev libfltk1.3-dev libcpptest-dev libglm-dev libeigen3-dev libcminpack-dev \ - libglew-dev doxygen graphviz texlive-latex-base - mkdir OpenVSP - cd OpenVSP - mkdir build buildlibs - # Download source code - wget -q https://github.com/OpenVSP/OpenVSP/archive/refs/tags/OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz - tar -xf OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz - mv OpenVSP-OpenVSP_${{ matrix.VSP_VERSION }} repo - # Build dependency libs - cd buildlibs - cmake -DVSP_USE_SYSTEM_LIBXML2=true -DVSP_USE_SYSTEM_FLTK=true -DVSP_USE_SYSTEM_GLM=true \ - -DVSP_USE_SYSTEM_GLEW=true -DVSP_USE_SYSTEM_CMINPACK=true -DVSP_USE_SYSTEM_LIBIGES=false \ - -DVSP_USE_SYSTEM_EIGEN=false -DVSP_USE_SYSTEM_CODEELI=false -DVSP_USE_SYSTEM_CPPTEST=false \ - -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} ../repo/Libraries -DCMAKE_BUILD_TYPE=Release - make -j8 - # Build OpenVSP - cd .. - export BUILD_LIBS_PATH=`pwd` - cd build - cmake ../repo/src/ -DVSP_NO_GRAPHICS=true -DVSP_LIBRARY_PATH=${BUILD_LIBS_PATH}/buildlibs \ - -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \ - -DCMAKE_BUILD_TYPE=Release - make -j8 - make package - # Install python interface - pushd _CPack_Packages/Linux/ZIP/OpenVSP-${{ matrix.VSP_VERSION }}-Linux/python - pip install -r requirements.txt - pushd .. - cp vspaero vspscript vspslicer $INST_PREFIX/bin - popd - popd - - # OAS dependencies are specified in setup.py. - - name: Install OAS and its dependencies (oldest versions) - if: ${{ matrix.dep-versions == 'oldest' }} - run: | - pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }} - pip install -e .[test] - - name: Install OAS and its dependencies (latest versions) - if: ${{ matrix.dep-versions == 'latest' }} - run: | - python -m pip install --upgrade pip wheel - pip install -e .[test,mphys] - - - name: Install MPI - run: | - sudo apt-get install openmpi-bin libopenmpi-dev - pip install mpi4py - - # install PETSc on the latest for MPI tests - - name: Install PETSc - if: ${{ matrix.dep-versions == 'latest' }} - run: | - cd .. - pip download petsc==${{ matrix.PETSC_VERSION_LATEST }} - tar -xf petsc-${{ matrix.PETSC_VERSION_LATEST }}.tar.gz - cd petsc-${{ matrix.PETSC_VERSION_LATEST }} - export PETSC_ARCH=real-debug - export PETSC_DIR=`pwd` - ./configure --PETSC_ARCH=$PETSC_ARCH --download-fblaslapack - make PETSC_DIR=$PETSC_DIR PETSC_ARCH=$PETSC_ARCH all - # Cython 3.0.0 break petsc4py install - pip install cython==${{ matrix.CYTHON_VERSION }} - pip install petsc4py==${{ matrix.PETSC_VERSION_LATEST }} - - # We need pySpline/pyGeo to run FFD tests. - - name: Install pySpline - run: | - cd .. - git clone https://github.com/mdolab/pyspline.git - cd pyspline - cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk - make - pip install -e . - - - name: Install pyGeo ${{ matrix.PYGEO_VERSION_OLDEST }} - if: ${{ matrix.dep-versions == 'oldest' }} - run: | - pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git@v${{ matrix.PYGEO_VERSION_OLDEST }}" - - name: Install pyGeo latest - if: ${{ matrix.dep-versions == 'latest' }} - run: | - pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git" - - - name: List installed Python packages - run: | - pip list -v - - - name: Run tests (latest) - env: - OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages - if: ${{ matrix.dep-versions == 'latest' }} - run: | - testflo -n 2 -v openaerostruct --coverage --coverpkg openaerostruct - coverage xml - # skip MPI tests on the oldest - - name: Run tests (oldest) - env: - OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages - if: ${{ matrix.dep-versions == 'oldest' }} - run: | - testflo -n 2 -v --exclude \*MPI\* openaerostruct --coverage --coverpkg openaerostruct - coverage xml - - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - verbose: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@v4 + - name: Install OAS + run: | + pip install -e .[test,mphys] + - name: Run tests (latest) + run: | + testflo -n 2 -v openaerostruct --coverage --coverpkg openaerostruct + coverage xml + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # --- linting and formatting --- black: From f228023d7fc3921b0b29dadd82d188b8f381062f Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 16:06:09 -0400 Subject: [PATCH 11/18] Revert "Try running tests on our docker images" This reverts commit 9ef3db2500bdc8b46620e96e8b6a8fdd2dae504a. --- .github/workflows/oas.yml | 167 +++++++++++++++++++++++++++++++++----- 1 file changed, 147 insertions(+), 20 deletions(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 11e933c29..220c2909e 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -16,31 +16,158 @@ on: - cron: '23 19 2,17 * *' jobs: + # --- run OAS unit and regression tests --- test: + runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: false # continue other jobs even if one of the jobs in matrix fails matrix: - dockerImage: [stable, latest] + dep-versions: ["oldest", "latest"] + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + PYTHON_VERSION_OLDEST: ['3.9'] + PYTHON_VERSION_LATEST: ['3.11'] + NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI + SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI + OPENMDAO_VERSION_OLDEST: ['3.22'] # latest is most recent on PyPI + MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI + 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 + VSP_VERSION: ['3.27.1'] # used for both builds + PETSC_VERSION_LATEST: ['3.19.1'] + CYTHON_VERSION: ['0.29.36'] # used for both builds - runs-on: ubuntu-latest - container: mdolab/public:u22-gcc-ompi-${{ matrix.dockerImage }}-amd64 steps: - - uses: actions/checkout@v4 - - name: Install OAS - run: | - pip install -e .[test,mphys] - - name: Run tests (latest) - run: | - testflo -n 2 -v openaerostruct --coverage --coverpkg openaerostruct - coverage xml - - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - verbose: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.PYTHON_VERSION_OLDEST }} + if: ${{ matrix.dep-versions == 'oldest' }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.PYTHON_VERSION_OLDEST }} + - name: Set up Python ${{ matrix.PYTHON_VERSION_LATEST }} + if: ${{ matrix.dep-versions == 'latest' }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.PYTHON_VERSION_LATEST }} + + # we need OpenVSP to run vsp tests. + - name: Install OpenVSP + run: | + sudo apt-get update + export PYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") + export PYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") + export INST_PREFIX=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('prefix'))") + cd .. + sudo apt-get install cmake libx11-dev libfltk1.3-dev libcpptest-dev libglm-dev libeigen3-dev libcminpack-dev \ + libglew-dev doxygen graphviz texlive-latex-base + mkdir OpenVSP + cd OpenVSP + mkdir build buildlibs + # Download source code + wget -q https://github.com/OpenVSP/OpenVSP/archive/refs/tags/OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz + tar -xf OpenVSP_${{ matrix.VSP_VERSION }}.tar.gz + mv OpenVSP-OpenVSP_${{ matrix.VSP_VERSION }} repo + # Build dependency libs + cd buildlibs + cmake -DVSP_USE_SYSTEM_LIBXML2=true -DVSP_USE_SYSTEM_FLTK=true -DVSP_USE_SYSTEM_GLM=true \ + -DVSP_USE_SYSTEM_GLEW=true -DVSP_USE_SYSTEM_CMINPACK=true -DVSP_USE_SYSTEM_LIBIGES=false \ + -DVSP_USE_SYSTEM_EIGEN=false -DVSP_USE_SYSTEM_CODEELI=false -DVSP_USE_SYSTEM_CPPTEST=false \ + -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} ../repo/Libraries -DCMAKE_BUILD_TYPE=Release + make -j8 + # Build OpenVSP + cd .. + export BUILD_LIBS_PATH=`pwd` + cd build + cmake ../repo/src/ -DVSP_NO_GRAPHICS=true -DVSP_LIBRARY_PATH=${BUILD_LIBS_PATH}/buildlibs \ + -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \ + -DCMAKE_BUILD_TYPE=Release + make -j8 + make package + # Install python interface + pushd _CPack_Packages/Linux/ZIP/OpenVSP-${{ matrix.VSP_VERSION }}-Linux/python + pip install -r requirements.txt + pushd .. + cp vspaero vspscript vspslicer $INST_PREFIX/bin + popd + popd + + # OAS dependencies are specified in setup.py. + - name: Install OAS and its dependencies (oldest versions) + if: ${{ matrix.dep-versions == 'oldest' }} + run: | + pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }} + pip install -e .[test] + - name: Install OAS and its dependencies (latest versions) + if: ${{ matrix.dep-versions == 'latest' }} + run: | + python -m pip install --upgrade pip wheel + pip install -e .[test,mphys] + + - name: Install MPI + run: | + sudo apt-get install openmpi-bin libopenmpi-dev + pip install mpi4py + + # install PETSc on the latest for MPI tests + - name: Install PETSc + if: ${{ matrix.dep-versions == 'latest' }} + run: | + cd .. + pip download petsc==${{ matrix.PETSC_VERSION_LATEST }} + tar -xf petsc-${{ matrix.PETSC_VERSION_LATEST }}.tar.gz + cd petsc-${{ matrix.PETSC_VERSION_LATEST }} + export PETSC_ARCH=real-debug + export PETSC_DIR=`pwd` + ./configure --PETSC_ARCH=$PETSC_ARCH --download-fblaslapack + make PETSC_DIR=$PETSC_DIR PETSC_ARCH=$PETSC_ARCH all + # Cython 3.0.0 break petsc4py install + pip install cython==${{ matrix.CYTHON_VERSION }} + pip install petsc4py==${{ matrix.PETSC_VERSION_LATEST }} + + # We need pySpline/pyGeo to run FFD tests. + - name: Install pySpline + run: | + cd .. + git clone https://github.com/mdolab/pyspline.git + cd pyspline + cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk + make + pip install -e . + + - name: Install pyGeo ${{ matrix.PYGEO_VERSION_OLDEST }} + if: ${{ matrix.dep-versions == 'oldest' }} + run: | + pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git@v${{ matrix.PYGEO_VERSION_OLDEST }}" + - name: Install pyGeo latest + if: ${{ matrix.dep-versions == 'latest' }} + run: | + pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git" + + - name: List installed Python packages + run: | + pip list -v + + - name: Run tests (latest) + env: + OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages + if: ${{ matrix.dep-versions == 'latest' }} + run: | + testflo -n 2 -v openaerostruct --coverage --coverpkg openaerostruct + coverage xml + # skip MPI tests on the oldest + - name: Run tests (oldest) + env: + OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages + if: ${{ matrix.dep-versions == 'oldest' }} + run: | + testflo -n 2 -v --exclude \*MPI\* openaerostruct --coverage --coverpkg openaerostruct + coverage xml + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # --- linting and formatting --- black: From 1e9e60fca37a1e6fbfd2601b0735807faf466a1c Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 16:22:50 -0400 Subject: [PATCH 12/18] Put it all back how it was --- .github/workflows/oas.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 220c2909e..fcb5dd238 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -24,11 +24,12 @@ jobs: matrix: dep-versions: ["oldest", "latest"] # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - PYTHON_VERSION_OLDEST: ['3.9'] + PYTHON_VERSION_OLDEST: ['3.8'] PYTHON_VERSION_LATEST: ['3.11'] - NUMPY_VERSION_OLDEST: ['1.24'] # latest is most recent on PyPI - SCIPY_VERSION_OLDEST: ['1.9'] # latest is most recent on PyPI - OPENMDAO_VERSION_OLDEST: ['3.22'] # latest is most recent on PyPI + WHEEL_VERSION_OLDEST: ['0.38.4'] # latest wheel cannot build the oldest OpenMDAO (3.17 or older) + NUMPY_VERSION_OLDEST: ['1.20'] # latest is most recent on PyPI + SCIPY_VERSION_OLDEST: ['1.6.0'] # latest is most recent on PyPI + OPENMDAO_VERSION_OLDEST: ['3.15'] # latest is most recent on PyPI MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI 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 VSP_VERSION: ['3.27.1'] # used for both builds @@ -93,6 +94,7 @@ jobs: - name: Install OAS and its dependencies (oldest versions) if: ${{ matrix.dep-versions == 'oldest' }} run: | + python -m pip install wheel==${{ matrix.WHEEL_VERSION_OLDEST }} pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }} pip install -e .[test] - name: Install OAS and its dependencies (latest versions) From 436b2e1f4ed2dc019f4ea6e7c9506f43d851c0e9 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 16:23:16 -0400 Subject: [PATCH 13/18] Use older pip for "oldest" test --- .github/workflows/oas.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index fcb5dd238..220b9f679 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -94,6 +94,7 @@ jobs: - name: Install OAS and its dependencies (oldest versions) if: ${{ matrix.dep-versions == 'oldest' }} run: | + python -m pip install "pip<24" python -m pip install wheel==${{ matrix.WHEEL_VERSION_OLDEST }} pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }} pip install -e .[test] From 5bbf39fc086c5154be0ca2578d9b5d29eb393121 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 16:33:51 -0400 Subject: [PATCH 14/18] Revert "Bump oldest supported versions of things" This reverts commit 5bf3e8e62fbbebc4a51dad213590138153fc87f6. --- README.md | 8 ++++---- openaerostruct/docs/installation.rst | 8 ++++---- setup.py | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1b1d67d36..9b1f733c1 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,10 @@ The oldest and latest versions of the dependencies that we test regularly are th | Dependency | oldest | latest | | ------------------ | ------ | ------ | -| Python | 3.9 | 3.11 | -| NumPy | 1.24 | latest | -| SciPy | 1.9.0 | latest | -| OpenMDAO | 3.22 | latest | +| Python | 3.8 | 3.11 | +| NumPy | 1.20 | latest | +| SciPy | 1.6.0 | latest | +| OpenMDAO | 3.15 | latest | | MPhys | 1.0.0 | latest | | Matplotlib | latest | latest | | pyGeo (optional) | 1.6.0 | latest | diff --git a/openaerostruct/docs/installation.rst b/openaerostruct/docs/installation.rst index 3df3c8ae5..c24f95eca 100644 --- a/openaerostruct/docs/installation.rst +++ b/openaerostruct/docs/installation.rst @@ -35,16 +35,16 @@ The oldest and latest versions of the dependencies that we test regularly are th - oldest - latest * - Python - - 3.9 + - 3.8 - 3.11 * - NumPy - - 1.24 + - 1.20 - latest * - SciPy - - 1.9.0 + - 1.6.0 - latest * - OpenMDAO - - 3.22 + - 3.15 - latest * - Matplotlib - latest diff --git a/setup.py b/setup.py index b0800c634..ee0d8435b 100644 --- a/setup.py +++ b/setup.py @@ -53,9 +53,9 @@ package_data={"openaerostruct": ["tests/*.py", "*/tests/*.py", "*/*/tests/*.py"]}, install_requires=[ # Remember to update the oldest versions in the GitHub Actions build, the readme, and in docs/installation.rst - "openmdao>=3.22", - "numpy>=1.24", - "scipy>=1.9", + "openmdao>=3.15", + "numpy>=1.20", + "scipy>=1.6.0", "matplotlib", ], extras_require=optional_dependencies, From c107fd6711fcbf212d993d7efd8f9bdbb240eb18 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 16:45:47 -0400 Subject: [PATCH 15/18] Add `PIP_VERSION_OLDEST` variable --- .github/workflows/oas.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 220b9f679..5144a51f8 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -26,6 +26,7 @@ jobs: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PYTHON_VERSION_OLDEST: ['3.8'] PYTHON_VERSION_LATEST: ['3.11'] + PIP_VERSION_OLDEST: ['23.3.2'] # OpenMDAO 3.15 doesn't install with pip>=24 WHEEL_VERSION_OLDEST: ['0.38.4'] # latest wheel cannot build the oldest OpenMDAO (3.17 or older) NUMPY_VERSION_OLDEST: ['1.20'] # latest is most recent on PyPI SCIPY_VERSION_OLDEST: ['1.6.0'] # latest is most recent on PyPI @@ -94,7 +95,7 @@ jobs: - name: Install OAS and its dependencies (oldest versions) if: ${{ matrix.dep-versions == 'oldest' }} run: | - python -m pip install "pip<24" + python -m pip install pip==${{ matrix.PIP_VERSION_OLDEST }} python -m pip install wheel==${{ matrix.WHEEL_VERSION_OLDEST }} pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }} pip install -e .[test] From 4ae8f5cc9817d9794d0c38c5cfe31a6120b6477f Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 16:52:06 -0400 Subject: [PATCH 16/18] Change optimisation failure test to work with older OpenMDAO --- .../test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py index 0760200a2..ae783b961 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py @@ -428,9 +428,9 @@ def test(self): # Set up the problem prob.setup() - prob.run_driver() + optFailed = prob.run_driver() - self.assertEqual(prob.driver.get_exit_status(), "SUCCESS") + self.assertFalse(optFailed) assert_near_equal(prob["AS_point_0.fuelburn"][0], 85348.88283214, 1e-5) assert_near_equal(prob["wing.structural_mass"][0], 13029.71120634, 1e-5) From 3b00aff04c7ae8b8e6efe4ba1208e3311f76a533 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 17:02:40 -0400 Subject: [PATCH 17/18] Modify scaneagle tolerance --- openaerostruct/tests/test_scaneagle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openaerostruct/tests/test_scaneagle.py b/openaerostruct/tests/test_scaneagle.py index 10b0a7059..9458a69ad 100644 --- a/openaerostruct/tests/test_scaneagle.py +++ b/openaerostruct/tests/test_scaneagle.py @@ -221,10 +221,10 @@ def test_totals(self): step=5e-4, step_calc="rel", compact_print=True, - abs_err_tol=1e-2, - rel_err_tol=1e-5, + abs_err_tol=1e-4, + rel_err_tol=1e-4, ) - assert_check_totals(totals, atol=1e-4, rtol=1e-5) + assert_check_totals(totals, atol=1e-4, rtol=1e-4) if __name__ == "__main__": From c1a3e2a1ada80c6b449e7d4398259dc6dd0ef7c3 Mon Sep 17 00:00:00 2001 From: Alasdair Gray Date: Mon, 15 Jul 2024 20:34:11 -0400 Subject: [PATCH 18/18] Remove commented out old code --- .../test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py index ae783b961..c4178a26b 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py @@ -289,7 +289,7 @@ def test(self): # Airfoil properties for viscous drag calculation "k_lam": 0.05, # percentage of chord with laminar # flow, used for viscous drag - "t_over_c_cp": 0.12 * np.ones(6), # np.array([0.08, 0.08, 0.08, 0.10, 0.10, 0.12]), + "t_over_c_cp": 0.12 * np.ones(6), "original_wingbox_airfoil_t_over_c": 0.12, "c_max_t": 0.38, # chordwise location of maximum thickness "with_viscous": True,