From 71045b3eb5cdad9a5a529cfa188a8c001aed1e76 Mon Sep 17 00:00:00 2001 From: Eytan Adler <63426601+eytanadler@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:51:24 -0500 Subject: [PATCH] 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 --- .github/.flake8_oas_specific => .flake8 | 3 +- .github/workflows/oas.yml | 130 +++++++++--------- README.md | 17 ++- openaerostruct/__init__.py | 2 +- openaerostruct/aerodynamics/lift_coeff_2D.py | 1 - .../aerodynamics/mesh_point_forces.py | 1 - openaerostruct/aerodynamics/pg_scale.py | 1 - .../aerodynamics/rotational_velocity.py | 2 +- openaerostruct/aerodynamics/viscous_drag.py | 2 - openaerostruct/common/atmos_comp.py | 2 - .../docs/_utils/generate_sourcedocs.py | 12 +- openaerostruct/docs/_utils/patch.py | 2 +- .../scripts/two_part_wing_custom_mesh.py | 3 - .../scripts/wingbox_mpt_Q400_example.py | 3 - openaerostruct/docs/installation.rst | 37 ++++- .../docs/wingbox_mpt_opt_example.py | 3 - openaerostruct/examples/black_box_example.py | 1 - openaerostruct/examples/drag_polar.py | 1 - .../run_aerostruct_uCRM_multipoint.py | 3 - openaerostruct/functionals/breguet_range.py | 2 - .../functionals/center_of_gravity.py | 3 - openaerostruct/functionals/equilibrium.py | 1 - .../tests/test_moment_coefficient.py | 1 - openaerostruct/functionals/total_lift_drag.py | 2 - .../geometry/geometry_mesh_transformations.py | 1 - .../geometry/monotonic_constraint.py | 1 - openaerostruct/geometry/utils.py | 4 - .../integration/aerostruct_groups.py | 1 - .../structures/compute_point_mass_loads.py | 1 - .../structures/compute_thrust_loads.py | 1 - .../structures/section_properties_wingbox.py | 1 - openaerostruct/structures/utils.py | 1 - openaerostruct/structures/vonmises_tube.py | 3 - openaerostruct/structures/vonmises_wingbox.py | 1 - openaerostruct/structures/weight.py | 1 - .../structures/wing_weight_loads.py | 2 - openaerostruct/structures/wingbox_geometry.py | 2 - openaerostruct/tests/test_aero_analysis.py | 4 - .../tests/test_aero_analysis_Sref.py | 4 - .../tests/test_aero_analysis_compressible.py | 4 - .../tests/test_aero_analysis_no_symmetry.py | 4 - ...test_aero_analysis_no_symmetry_wavedrag.py | 4 - openaerostruct/tests/test_aero_ffd.py | 4 - .../tests/test_aero_morphing_multipoint.py | 3 - .../tests/test_aero_opt_wavedrag.py | 4 - .../tests/test_aerostruct_analysis.py | 5 +- .../tests/test_aerostruct_analysis_Sref.py | 5 +- .../test_aerostruct_analysis_compressible.py | 5 +- .../tests/test_aerostruct_engine_thrusts.py | 5 +- openaerostruct/tests/test_aerostruct_ffd.py | 5 +- .../tests/test_aerostruct_point_loads.py | 5 +- ...est_aerostruct_wingbox_+weight_analysis.py | 5 +- .../tests/test_aerostruct_wingbox_analysis.py | 5 +- ...ostruct_wingbox_fuel_vol_constraint_opt.py | 5 +- .../tests/test_aerostruct_wingbox_opt.py | 5 +- ...ct_wingbox_wave_fuel_vol_constraint_opt.py | 5 +- .../tests/test_morphing_aerostruct.py | 1 - .../tests/test_multiple_aero_analysis.py | 3 - openaerostruct/tests/test_multiple_rect.py | 4 - .../tests/test_multipoint_aero_ffd.py | 2 - .../test_multipoint_wingbox_aerostruct.py | 5 +- .../tests/test_multipoint_wingbox_derivs.py | 5 +- openaerostruct/tests/test_scaneagle.py | 1 - openaerostruct/tests/test_simple_rect_AS.py | 5 +- openaerostruct/tests/test_simple_rect_aero.py | 4 - .../tests/test_simple_rect_aero_roll.py | 4 - .../tests/test_simple_rect_aero_sideslip.py | 4 - .../test_simple_rect_aero_wo_symmetry.py | 4 - .../tests/test_simple_rect_right_aero.py | 4 - openaerostruct/tests/test_struct_analysis.py | 1 - .../tests/test_struct_analysis_2g.py | 1 - .../tests/test_struct_engine_thrusts.py | 2 - openaerostruct/tests/test_struct_no_loads.py | 1 - .../tests/test_struct_point_masses.py | 2 - openaerostruct/tests/test_v1_aero_analysis.py | 4 - openaerostruct/tests/test_v1_aero_viscous.py | 4 - .../tests/test_v1_aero_viscous_opt.py | 4 - .../tests/test_v1_aerostruct_analysis.py | 5 +- .../tests/test_v1_aerostruct_opt.py | 5 +- .../tests/test_v1_struct_analysis.py | 1 - openaerostruct/tests/test_v1_struct_opt.py | 1 - .../tests/test_vsp_aero_analysis.py | 1 - openaerostruct/tests/test_wingbox_analysis.py | 1 - openaerostruct/tests/test_wingbox_derivs.py | 5 +- .../tests/test_wingbox_distributed_fuel.py | 5 +- openaerostruct/utils/plot_wing.py | 10 -- openaerostruct/utils/plot_wingbox.py | 11 -- setup.py | 7 +- 88 files changed, 148 insertions(+), 310 deletions(-) rename .github/.flake8_oas_specific => .flake8 (75%) diff --git a/.github/.flake8_oas_specific b/.flake8 similarity index 75% rename from .github/.flake8_oas_specific rename to .flake8 index 2ff5cdd9d..7dfa6ed49 100644 --- a/.github/.flake8_oas_specific +++ b/.flake8 @@ -4,4 +4,5 @@ extend-exclude = openaerostruct/docs/conf.py, openaerostruct/docs/aero_walkthrough/part*.py, openaerostruct/docs/_utils/docutil.py, - openaerostruct/docs/_utils/patch.py \ No newline at end of file + openaerostruct/docs/_utils/patch.py, + openaerostruct/utils/plot_*.py, diff --git a/.github/workflows/oas.yml b/.github/workflows/oas.yml index 8714c97db..b954e1864 100644 --- a/.github/workflows/oas.yml +++ b/.github/workflows/oas.yml @@ -11,40 +11,38 @@ on: - main tags: - v*.*.* + schedule: + # Run the tests at 7:23pm UTC on the 2nd and 17th of every month + - cron: '23 19 2,17 * *' jobs: # --- run OAS unit and regression tests --- test: runs-on: ubuntu-latest - env: - VSP_VERSION: 3.27.1 + strategy: + matrix: + dep-versions: ["oldest", "latest"] + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set versions to test here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + PYTHON_VERSION_OLDEST: ['3.8'] + PYTHON_VERSION_LATEST: ['3.11'] + 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.10'] # 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 steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.PYTHON_VERSION_OLDEST }} + if: ${{ matrix.dep-versions == 'oldest' }} uses: actions/setup-python@v2 with: - python-version: '3.8' - - # OAS dependencies are specified in setup.py. - - name: Install OAS and its dependencies - run: | - python -m pip install --upgrade pip wheel - pip install .[test] - - # we need pySpline/pyGeo to run FFD tests. - - name: Install pySpline and pyGeo - run: | - cd .. - sudo apt-get install openmpi-bin libopenmpi-dev - pip install mpi4py - git clone https://github.com/mdolab/pyspline.git - cd pyspline - cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk - make - pip install -e . - cd .. - pip install "pygeo[testing] @ git+https://github.com/mdolab/pygeo.git" + 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 @@ -59,9 +57,9 @@ jobs: cd OpenVSP mkdir build buildlibs # Download source code - wget -q https://github.com/OpenVSP/OpenVSP/archive/refs/tags/OpenVSP_${VSP_VERSION}.tar.gz - tar -xf OpenVSP_${VSP_VERSION}.tar.gz - mv OpenVSP-OpenVSP_${VSP_VERSION} repo + 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 \ @@ -79,13 +77,51 @@ jobs: make -j8 make package # Install python interface - pushd _CPack_Packages/Linux/ZIP/OpenVSP-${VSP_VERSION}-Linux/python + 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: | + python -m pip install --upgrade pip wheel + pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_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] + + # We need pySpline/pyGeo to run FFD tests. + - name: Install pySpline + run: | + cd .. + sudo apt-get install openmpi-bin libopenmpi-dev + pip install mpi4py + 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 env: OMPI_MCA_btl: ^openib # prevent OpenMPI warning messages @@ -97,41 +133,11 @@ jobs: with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - - # --- code style check by flake8 --- - flake8: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - # use both MDO Lab standard config - - name: Code style (flake8) - run: | - pip install flake8==3.9.2 - wget https://raw.githubusercontent.com/mdolab/.github/main/.flake8 -O .flake8_mdolab - python -m flake8 openaerostruct --append-config .flake8_mdolab --append-config .github/.flake8_oas_specific --count --show-source --statistics - - # --- code format check by black --- + # --- linting and formatting --- black: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - # code format check by black - - name: Code format (black) - run: | - pip install black==22.3.0 - black openaerostruct --check --diff -l 120 --target-version py38 + uses: mdolab/.github/.github/workflows/black.yaml@main + flake8: + uses: mdolab/.github/.github/workflows/flake8.yaml@main # --- publish to PyPI pypi: diff --git a/README.md b/README.md index f731f5624..3defe54bb 100644 --- a/README.md +++ b/README.md @@ -76,14 +76,23 @@ Shamsheer S. Chauhan and Joaquim R. R. A. Martins, “Low-Fidelity Aerostructura Version Information ------------------- -The latest version of OpenAeroStruct requires [OpenMDAO](https://github.com/OpenMDAO/openmdao) (versions 3.2.0 to 3.16.0) and Python3. -Python2 is no longer supported. -It also requires the folloing packages: `numpy, scipy, matplotlib`. +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.10 | latest | +| Matplotlib | latest | latest | +| pyGeo (optional) | 1.6.0 | latest | +| OpenVSP (optional) | 3.27.1 | 3.27.1 | + 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). License ------- -Copyright 2018-2022 MDO Lab +Copyright 2018-2023 MDO Lab Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/openaerostruct/__init__.py b/openaerostruct/__init__.py index 667b52f95..43b48b6fd 100644 --- a/openaerostruct/__init__.py +++ b/openaerostruct/__init__.py @@ -1 +1 @@ -__version__ = "2.5.2" +__version__ = "2.5.3" diff --git a/openaerostruct/aerodynamics/lift_coeff_2D.py b/openaerostruct/aerodynamics/lift_coeff_2D.py index 0b959e52e..e4f937e26 100644 --- a/openaerostruct/aerodynamics/lift_coeff_2D.py +++ b/openaerostruct/aerodynamics/lift_coeff_2D.py @@ -69,7 +69,6 @@ def setup(self): self.declare_partials("Cl", "sec_forces", rows=rows, cols=cols) def compute(self, inputs, outputs): - # Input parameters alpha = inputs["alpha"] * np.pi / 180.0 cosa = np.cos(alpha) diff --git a/openaerostruct/aerodynamics/mesh_point_forces.py b/openaerostruct/aerodynamics/mesh_point_forces.py index a82094fe5..d7d528193 100644 --- a/openaerostruct/aerodynamics/mesh_point_forces.py +++ b/openaerostruct/aerodynamics/mesh_point_forces.py @@ -73,7 +73,6 @@ def compute(self, inputs, outputs): le_wt = self.options["le_wt"] te_wt = self.options["te_wt"] for surface in surfaces: - name = surface["name"] sec_forces_name = "{}_sec_forces".format(name) mesh_point_forces_name = "{}_mesh_point_forces".format(name) diff --git a/openaerostruct/aerodynamics/pg_scale.py b/openaerostruct/aerodynamics/pg_scale.py index f031f79db..720378b7c 100644 --- a/openaerostruct/aerodynamics/pg_scale.py +++ b/openaerostruct/aerodynamics/pg_scale.py @@ -265,7 +265,6 @@ def initialize(self): self.options.declare("surfaces", types=list) def setup(self): - self.add_input("Mach_number", val=0.0) # We'll compute all of sensitivities associated with Mach number through diff --git a/openaerostruct/aerodynamics/rotational_velocity.py b/openaerostruct/aerodynamics/rotational_velocity.py index 1671603a6..916195522 100644 --- a/openaerostruct/aerodynamics/rotational_velocity.py +++ b/openaerostruct/aerodynamics/rotational_velocity.py @@ -97,7 +97,7 @@ def compute_partials(self, inputs, J): surfaces = self.options["surfaces"] idx = jdx = 0 ii = self.system_size * 3 - for j, surface in enumerate(surfaces): + for surface in surfaces: mesh = surface["mesh"] nx = mesh.shape[0] ny = mesh.shape[1] diff --git a/openaerostruct/aerodynamics/viscous_drag.py b/openaerostruct/aerodynamics/viscous_drag.py index 4b617c19a..148672f86 100644 --- a/openaerostruct/aerodynamics/viscous_drag.py +++ b/openaerostruct/aerodynamics/viscous_drag.py @@ -121,7 +121,6 @@ def compute_partials(self, inputs, partials): t_over_c = inputs["t_over_c"] if self.with_viscous: - M = inputs["Mach_number"] S_ref = inputs["S_ref"] widths = inputs["widths"] @@ -171,7 +170,6 @@ def compute_partials(self, inputs, partials): if self.k_lam == 0: cdT_Re = 0.455 / (np.log10(Re_c)) ** 3.58 / B * -2.58 / np.log(10) / Re_c elif self.k_lam < 1.0: - cdl_Re = 1.328 / (Re_c * self.k_lam) ** 1.5 * -0.5 * self.k_lam cdt_Re = 0.455 / (np.log10(Re_c * self.k_lam)) ** 3.58 / B * -2.58 / np.log(10) / Re_c cdT_Re = 0.455 / (np.log10(Re_c)) ** 3.58 / B * -2.58 / np.log(10) / Re_c diff --git a/openaerostruct/common/atmos_comp.py b/openaerostruct/common/atmos_comp.py index daece39d9..eaa342c8e 100644 --- a/openaerostruct/common/atmos_comp.py +++ b/openaerostruct/common/atmos_comp.py @@ -741,7 +741,6 @@ def setup(self): self.declare_partials("v", "Mach_number") def compute(self, inputs, outputs): - outputs["T"] = T_interp(inputs["altitude"]) outputs["P"] = P_interp(inputs["altitude"]) outputs["rho"] = rho_interp(inputs["altitude"]) @@ -751,7 +750,6 @@ def compute(self, inputs, outputs): outputs["v"] = outputs["speed_of_sound"] * inputs["Mach_number"] def compute_partials(self, inputs, partials): - partials["T", "altitude"] = T_interp_deriv(inputs["altitude"]) partials["P", "altitude"] = P_interp_deriv(inputs["altitude"]) partials["rho", "altitude"] = rho_interp_deriv(inputs["altitude"]) diff --git a/openaerostruct/docs/_utils/generate_sourcedocs.py b/openaerostruct/docs/_utils/generate_sourcedocs.py index 33facdf28..9dd20d68d 100644 --- a/openaerostruct/docs/_utils/generate_sourcedocs.py +++ b/openaerostruct/docs/_utils/generate_sourcedocs.py @@ -7,7 +7,7 @@ # of our source docs, as well as writing out each individual rst file. -def generate_docs(dir, top, packages, project_name="openmdao"): +def generate_docs(directory, top, packages, project_name="openmdao"): """ generate_docs @@ -45,7 +45,7 @@ def generate_docs(dir, top, packages, project_name="openmdao"): :maxdepth: 1 """ - docs_dir = os.path.dirname(dir) + docs_dir = os.path.dirname(directory) doc_dir = os.path.join(docs_dir, "_srcdocs") if os.path.isdir(doc_dir): @@ -69,7 +69,7 @@ def generate_docs(dir, top, packages, project_name="openmdao"): # order the packages in this list explicitly. Any new ones that # are detected will show up at the end of the list. - # everything in openmdao dir that isn't discarded is appended as a source package. + # everything in openmdao directory that isn't discarded is appended as a source package. for listing in os.listdir(os.path.join(top)): if os.path.isdir(os.path.join("..", listing)): if listing not in IGNORE_LIST and listing not in packages: @@ -88,9 +88,9 @@ def generate_docs(dir, top, packages, project_name="openmdao"): package_filename = os.path.join(packages_dir, project_name + "." + package + ".rst") package_name = project_name + "." + package - # the sub_listing is going into each package dir and listing what's in it - for sub_listing in sorted(os.listdir(os.path.join(dir, package.replace(".", "/")))): - # don't want to catalog files twice, nor use init files nor test dir + # the sub_listing is going into each package directory and listing what's in it + for sub_listing in sorted(os.listdir(os.path.join(directory, package.replace(".", "/")))): + # don't want to catalog files twice, nor use init files nor test directory if (os.path.isdir(sub_listing) and sub_listing != "tests") or ( sub_listing.endswith(".py") and not sub_listing.startswith("_") ): diff --git a/openaerostruct/docs/_utils/patch.py b/openaerostruct/docs/_utils/patch.py index 25d6c83b2..ea0ee1799 100644 --- a/openaerostruct/docs/_utils/patch.py +++ b/openaerostruct/docs/_utils/patch.py @@ -62,7 +62,7 @@ def _parse(self): msg = "Docstring contains both a Returns and Yields section." raise ValueError(msg) - for (section, content) in sections: + for section, content in sections: if not section.startswith(".."): section = (s.capitalize() for s in section.split(" ")) section = " ".join(section) diff --git a/openaerostruct/docs/advanced_features/scripts/two_part_wing_custom_mesh.py b/openaerostruct/docs/advanced_features/scripts/two_part_wing_custom_mesh.py index 5d45a8285..85506b866 100644 --- a/openaerostruct/docs/advanced_features/scripts/two_part_wing_custom_mesh.py +++ b/openaerostruct/docs/advanced_features/scripts/two_part_wing_custom_mesh.py @@ -200,7 +200,6 @@ # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -212,7 +211,6 @@ # Loop through and add a certain number of aerostruct points for i in range(2): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aerostruct point @@ -236,7 +234,6 @@ prob.model.connect("fuel_mass", point_name + ".total_perf.CG.fuelburn") for surface in surfaces: - name = surface["name"] if surf_dict["distributed_fuel_weight"]: diff --git a/openaerostruct/docs/advanced_features/scripts/wingbox_mpt_Q400_example.py b/openaerostruct/docs/advanced_features/scripts/wingbox_mpt_Q400_example.py index 1b82ffaf3..77aa0911f 100644 --- a/openaerostruct/docs/advanced_features/scripts/wingbox_mpt_Q400_example.py +++ b/openaerostruct/docs/advanced_features/scripts/wingbox_mpt_Q400_example.py @@ -133,7 +133,6 @@ # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -145,7 +144,6 @@ # Loop through and add a certain number of aerostruct points for i in range(2): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aerostruct point @@ -169,7 +167,6 @@ prob.model.connect("fuel_mass", point_name + ".total_perf.CG.fuelburn") for surface in surfaces: - name = surface["name"] if surf_dict["distributed_fuel_weight"]: diff --git a/openaerostruct/docs/installation.rst b/openaerostruct/docs/installation.rst index 39e0e8905..b6eb03ab1 100644 --- a/openaerostruct/docs/installation.rst +++ b/openaerostruct/docs/installation.rst @@ -26,20 +26,51 @@ Then from within the OpenAeroStruct folder, pip install the package: Both methods will automatically install the dependencies: numpy, scipy, matplotlib, and OpenMDAO. -The latest version of OpenAeroStruct supports OpenMDAO version 3.2.0 to 3.16.0; 3.16.0 is recommended. -If you wish to install a specific version of OpenMDAO, follow the instructions at https://github.com/OpenMDAO/OpenMDAO/. +The oldest and latest versions of the dependencies that we test regularly are the following (other versions may work, but no guarantees): + +.. list-table:: + :header-rows: 1 + + * - Dependency + - oldest + - latest + * - Python + - 3.8 + - 3.11 + * - NumPy + - 1.20 + - latest + * - SciPy + - 1.6.0 + - latest + * - OpenMDAO + - 3.10 + - latest + * - Matplotlib + - latest + - latest + * - pyGeo (optional) + - 1.6.0 + - latest + * - OpenVSP (optional) + - 3.27.1 + - 3.27.1 If you are unfamiliar with OpenMDAO and wish to modify the internals of OpenAeroStruct, you should examine the OpenMDAO documentation at http://openmdao.org/twodocs/versions/latest/index.html. The tutorials provided with OpenMDAO are helpful to understand the basics of using OpenMDAO to solve an optimization problem. Advanced Options ~~~~~~~~~~~~~~~~ -To run the tests on your machine, use the [test] option. This will install the `testflo `_ package. +To run the tests on your machine, use the [test] option. This will install the pytest package. .. code-block:: bash pip install -e .[test] +Then run the tests from the OpenAeroStruct root directory by calling: + +.. code-block:: bash + pytest -v . To install the dependencies to build the documentation locally, run: diff --git a/openaerostruct/docs/wingbox_mpt_opt_example.py b/openaerostruct/docs/wingbox_mpt_opt_example.py index fd086019f..9405fb6e4 100644 --- a/openaerostruct/docs/wingbox_mpt_opt_example.py +++ b/openaerostruct/docs/wingbox_mpt_opt_example.py @@ -147,7 +147,6 @@ # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -161,7 +160,6 @@ # Loop through and add a certain number of aerostruct points for i in range(2): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -189,7 +187,6 @@ # docs checkpoint 16 for surface in surfaces: - name = surface["name"] if surf_dict["distributed_fuel_weight"]: diff --git a/openaerostruct/examples/black_box_example.py b/openaerostruct/examples/black_box_example.py index 3fdf4a53d..fcbbf95c5 100644 --- a/openaerostruct/examples/black_box_example.py +++ b/openaerostruct/examples/black_box_example.py @@ -134,7 +134,6 @@ # Loopo through each alpha for alpha in alphas: - # Set the alpha in the problem and run analysis prob["alpha"] = alpha prob.run_model() diff --git a/openaerostruct/examples/drag_polar.py b/openaerostruct/examples/drag_polar.py index a1c56df83..295c96a05 100644 --- a/openaerostruct/examples/drag_polar.py +++ b/openaerostruct/examples/drag_polar.py @@ -8,7 +8,6 @@ def compute_drag_polar(Mach, alphas, surfaces, trimmed=False): - if isinstance(surfaces, dict): surfaces = [ surfaces, diff --git a/openaerostruct/examples/run_aerostruct_uCRM_multipoint.py b/openaerostruct/examples/run_aerostruct_uCRM_multipoint.py index bcaa4f440..1c76063c2 100644 --- a/openaerostruct/examples/run_aerostruct_uCRM_multipoint.py +++ b/openaerostruct/examples/run_aerostruct_uCRM_multipoint.py @@ -347,7 +347,6 @@ # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -359,7 +358,6 @@ # Loop through and add a certain number of aerostruct points for i in range(2): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aerostruct point @@ -383,7 +381,6 @@ prob.model.connect("fuel_mass", point_name + ".total_perf.CG.fuelburn") for surface in surfaces: - name = surface["name"] if surf_dict["distributed_fuel_weight"]: diff --git a/openaerostruct/functionals/breguet_range.py b/openaerostruct/functionals/breguet_range.py index f1d336693..505a94ec8 100644 --- a/openaerostruct/functionals/breguet_range.py +++ b/openaerostruct/functionals/breguet_range.py @@ -63,7 +63,6 @@ def setup(self): self.set_check_partial_options(wrt="*", method="cs", step=1e-30) def compute(self, inputs, outputs): - CT = inputs["CT"] a = inputs["speed_of_sound"] R = inputs["R"] @@ -83,7 +82,6 @@ def compute(self, inputs, outputs): outputs["fuelburn"] = (W0 + Ws) * (np.exp(R * CT / a / M * CD / CL) - 1) def compute_partials(self, inputs, partials): - CT = inputs["CT"] a = inputs["speed_of_sound"] R = inputs["R"] diff --git a/openaerostruct/functionals/center_of_gravity.py b/openaerostruct/functionals/center_of_gravity.py index d1cbf0a67..e16fc2812 100644 --- a/openaerostruct/functionals/center_of_gravity.py +++ b/openaerostruct/functionals/center_of_gravity.py @@ -45,7 +45,6 @@ def initialize(self): self.options.declare("surfaces", types=list) def setup(self): - arange = np.arange(3) for surface in self.options["surfaces"]: name = surface["name"] @@ -70,7 +69,6 @@ def setup(self): self.declare_partials("cg", "empty_cg", rows=arange, cols=arange) def compute(self, inputs, outputs): - g = grav_constant * inputs["load_factor"] W0_cg = inputs["W0"] * inputs["empty_cg"] @@ -87,7 +85,6 @@ def compute(self, inputs, outputs): outputs["cg"] = (W0_cg + spar_cg) / (inputs["total_weight"] / g - inputs["fuelburn"]) def compute_partials(self, inputs, partials): - g = grav_constant * inputs["load_factor"] W0 = inputs["W0"] cg = inputs["empty_cg"] diff --git a/openaerostruct/functionals/equilibrium.py b/openaerostruct/functionals/equilibrium.py index 981b50bd5..9414e064e 100644 --- a/openaerostruct/functionals/equilibrium.py +++ b/openaerostruct/functionals/equilibrium.py @@ -80,7 +80,6 @@ def setup(self): self.declare_partials("total_weight", "load_factor") def compute(self, inputs, outputs): - g = grav_constant * inputs["load_factor"] W0 = inputs["W0"] rho = inputs["rho"] diff --git a/openaerostruct/functionals/tests/test_moment_coefficient.py b/openaerostruct/functionals/tests/test_moment_coefficient.py index 3a74a0243..7224bb35d 100644 --- a/openaerostruct/functionals/tests/test_moment_coefficient.py +++ b/openaerostruct/functionals/tests/test_moment_coefficient.py @@ -9,7 +9,6 @@ class Test(unittest.TestCase): def test(self): - wing_dict = {"name": "wing", "mesh": np.zeros((2, 7)), "symmetry": True} tail_dict = {"name": "tail", "mesh": np.zeros((3, 5)), "symmetry": False} diff --git a/openaerostruct/functionals/total_lift_drag.py b/openaerostruct/functionals/total_lift_drag.py index 1e06eedb2..d637f20bc 100644 --- a/openaerostruct/functionals/total_lift_drag.py +++ b/openaerostruct/functionals/total_lift_drag.py @@ -45,7 +45,6 @@ def setup(self): self.declare_partials("CD", "S_ref_total") def compute(self, inputs, outputs): - # Compute the weighted CL and CD contributions from each surface, # weighted by the individual surface areas CL = 0.0 @@ -60,7 +59,6 @@ def compute(self, inputs, outputs): outputs["CD"] = CD / inputs["S_ref_total"] def compute_partials(self, inputs, partials): - # Compute the weighted CL and CD contributions from each surface, # weighted by the individual surface areas CL = 0.0 diff --git a/openaerostruct/geometry/geometry_mesh_transformations.py b/openaerostruct/geometry/geometry_mesh_transformations.py index 80ed0e4d2..89ac16cec 100644 --- a/openaerostruct/geometry/geometry_mesh_transformations.py +++ b/openaerostruct/geometry/geometry_mesh_transformations.py @@ -1041,7 +1041,6 @@ def compute_partials(self, inputs, partials): partials["mesh", "in_mesh"][nn - nqc : nn] += 0.25 * d_qch if rotate_x: - dmats_dthx = np.zeros((ny, 3, 3)) dmats_dthx[:, 1, 0] = cos_rtx * sin_rty dmats_dthx[:, 1, 1] = -sin_rtx diff --git a/openaerostruct/geometry/monotonic_constraint.py b/openaerostruct/geometry/monotonic_constraint.py index ec2d7908d..83dd054d6 100644 --- a/openaerostruct/geometry/monotonic_constraint.py +++ b/openaerostruct/geometry/monotonic_constraint.py @@ -25,7 +25,6 @@ def initialize(self): self.options.declare("surface", types=dict) def setup(self): - self.surface = surface = self.options["surface"] self.var_name = self.options["var_name"] self.con_name = "monotonic_" + self.var_name diff --git a/openaerostruct/geometry/utils.py b/openaerostruct/geometry/utils.py index 8f34ea501..65bfc6201 100644 --- a/openaerostruct/geometry/utils.py +++ b/openaerostruct/geometry/utils.py @@ -632,7 +632,6 @@ def get_default_geo_dict(): def generate_mesh(input_dict): - # Get defaults and update surface with the user-provided input surf_dict = get_default_geo_dict() surf_dict.update(input_dict) @@ -686,7 +685,6 @@ def generate_mesh(input_dict): if surf_dict["symmetry"]: twist = np.interp(np.linspace(0, 1, num_twist), eta, surf_dict["crm_twist"]) else: - # If num_twist is odd, create the twist vector and mirror it # then stack the two together, but remove the duplicated twist # value. @@ -703,7 +701,6 @@ def generate_mesh(input_dict): return mesh, twist else: - return mesh @@ -846,7 +843,6 @@ def generate_vsp_surfaces(vsp_file, symmetry=False, include=None): def write_FFD_file(surface, mx, my): - mesh = surface["mesh"] nx, ny = mesh.shape[:2] diff --git a/openaerostruct/integration/aerostruct_groups.py b/openaerostruct/integration/aerostruct_groups.py index 247b95937..ee97daa81 100644 --- a/openaerostruct/integration/aerostruct_groups.py +++ b/openaerostruct/integration/aerostruct_groups.py @@ -219,7 +219,6 @@ def setup(self): coupled = om.Group() for surface in surfaces: - name = surface["name"] # Connect the output of the loads component with the FEM diff --git a/openaerostruct/structures/compute_point_mass_loads.py b/openaerostruct/structures/compute_point_mass_loads.py index 409060a06..6d2915a56 100644 --- a/openaerostruct/structures/compute_point_mass_loads.py +++ b/openaerostruct/structures/compute_point_mass_loads.py @@ -60,7 +60,6 @@ def compute(self, inputs, outputs): # Loop through each point mass location, incrementing idx for idx, point_mass_location in enumerate(inputs["point_mass_locations"]): - # Get the vector between the nodes and the point mass location xyz_dist = point_mass_location - nodes diff --git a/openaerostruct/structures/compute_thrust_loads.py b/openaerostruct/structures/compute_thrust_loads.py index afcfe82e7..de4761bb1 100644 --- a/openaerostruct/structures/compute_thrust_loads.py +++ b/openaerostruct/structures/compute_thrust_loads.py @@ -56,7 +56,6 @@ def compute(self, inputs, outputs): # Loop through each point mass location, incrementing idx for idx, point_mass_location in enumerate(inputs["point_mass_locations"]): - # Get the vector between the nodes and the point mass location xyz_dist = point_mass_location - nodes diff --git a/openaerostruct/structures/section_properties_wingbox.py b/openaerostruct/structures/section_properties_wingbox.py index 463ccc56e..b09ff8a0f 100644 --- a/openaerostruct/structures/section_properties_wingbox.py +++ b/openaerostruct/structures/section_properties_wingbox.py @@ -100,7 +100,6 @@ def setup(self): self.declare_partials("*", "*", method="cs") def compute(self, inputs, outputs): - # NOTE: In the code below, the x- and y-axes correspond to the element # local z- and y-axes, respectively. diff --git a/openaerostruct/structures/utils.py b/openaerostruct/structures/utils.py index a5a176dc8..216446d67 100644 --- a/openaerostruct/structures/utils.py +++ b/openaerostruct/structures/utils.py @@ -54,7 +54,6 @@ def cross_d(a, b): def radii(mesh, t_c=0.15): - """ Obtain the radii of the FEM element based on local chord. """ diff --git a/openaerostruct/structures/vonmises_tube.py b/openaerostruct/structures/vonmises_tube.py index a90b0944e..cfe243e56 100644 --- a/openaerostruct/structures/vonmises_tube.py +++ b/openaerostruct/structures/vonmises_tube.py @@ -77,7 +77,6 @@ def compute(self, inputs, outputs): num_elems = self.ny - 1 for ielem in range(num_elems): - P0 = nodes[ielem, :] P1 = nodes[ielem + 1, :] L = norm(P1 - P0) @@ -104,7 +103,6 @@ def compute(self, inputs, outputs): outputs["vonmises"][ielem, 1] = np.sqrt(sxx1**2 + 3 * sxt**2) def compute_partials(self, inputs, partials): - radius = inputs["radius"] disp = inputs["disp"] nodes = inputs["nodes"] @@ -115,7 +113,6 @@ def compute_partials(self, inputs, partials): num_elems = self.ny - 1 for ielem in range(num_elems): - # Compute the coordinate delta between the two element end points P0 = nodes[ielem, :] P1 = nodes[ielem + 1, :] diff --git a/openaerostruct/structures/vonmises_wingbox.py b/openaerostruct/structures/vonmises_wingbox.py index 0d8b4389c..052bfbfef 100644 --- a/openaerostruct/structures/vonmises_wingbox.py +++ b/openaerostruct/structures/vonmises_wingbox.py @@ -96,7 +96,6 @@ def compute(self, inputs, outputs): num_elems = self.ny - 1 for ielem in range(num_elems): - P0 = nodes[ielem, :] P1 = nodes[ielem + 1, :] L = norm(P1 - P0) diff --git a/openaerostruct/structures/weight.py b/openaerostruct/structures/weight.py index 5a6b113a6..cac26942f 100644 --- a/openaerostruct/structures/weight.py +++ b/openaerostruct/structures/weight.py @@ -75,7 +75,6 @@ def compute(self, inputs, outputs): outputs["element_mass"] = element_mass def compute_partials(self, inputs, partials): - A = inputs["A"] nodes = inputs["nodes"] mrho = self.surface["mrho"] diff --git a/openaerostruct/structures/wing_weight_loads.py b/openaerostruct/structures/wing_weight_loads.py index 6af88506d..61ced5b2a 100644 --- a/openaerostruct/structures/wing_weight_loads.py +++ b/openaerostruct/structures/wing_weight_loads.py @@ -171,7 +171,6 @@ def setup(self): self.set_check_partial_options(wrt="*", method="cs") def compute(self, inputs, outputs): - struct_weights = inputs["element_mass"] * inputs["load_factor"] * grav_constant nodes = inputs["nodes"] @@ -208,7 +207,6 @@ def compute(self, inputs, outputs): outputs["struct_weight_loads"] = loads def compute_partials(self, inputs, J): - struct_weights = inputs["element_mass"] * inputs["load_factor"] * grav_constant nodes = inputs["nodes"] diff --git a/openaerostruct/structures/wingbox_geometry.py b/openaerostruct/structures/wingbox_geometry.py index c33f43a98..bb4b58571 100644 --- a/openaerostruct/structures/wingbox_geometry.py +++ b/openaerostruct/structures/wingbox_geometry.py @@ -70,7 +70,6 @@ def compute(self, inputs, outputs): # Loop over spanwise elements for ielem in range(mesh.shape[1] - 1): - # Obtain the element nodes P0 = nodes[ielem, :] P1 = nodes[ielem + 1, :] @@ -89,7 +88,6 @@ def compute(self, inputs, outputs): # Loop over spanwise elements for ielem in range(mesh.shape[1] - 1): - # The following is used to approximate the twist angle for the section normal to the FEM element mesh_vec_0 = mesh_vectors[ielem] temp_mesh_vectors_0 = mesh_vec_0.copy() diff --git a/openaerostruct/tests/test_aero_analysis.py b/openaerostruct/tests/test_aero_analysis.py index b6d49ad5c..a31b22012 100644 --- a/openaerostruct/tests/test_aero_analysis.py +++ b/openaerostruct/tests/test_aero_analysis.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "num_x": 3, "wing_type": "CRM", "symmetry": True, "num_twist_cp": 5} @@ -62,7 +61,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -72,7 +70,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -88,7 +85,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aero_analysis_Sref.py b/openaerostruct/tests/test_aero_analysis_Sref.py index 9ee7ba8ec..ce384b4e3 100644 --- a/openaerostruct/tests/test_aero_analysis_Sref.py +++ b/openaerostruct/tests/test_aero_analysis_Sref.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "num_x": 3, "wing_type": "CRM", "symmetry": True, "num_twist_cp": 5} @@ -63,7 +62,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -73,7 +71,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces, user_specified_Sref=True) point_name = "aero_point_{}".format(i) @@ -90,7 +87,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aero_analysis_compressible.py b/openaerostruct/tests/test_aero_analysis_compressible.py index f714e618d..cd7061ad3 100644 --- a/openaerostruct/tests/test_aero_analysis_compressible.py +++ b/openaerostruct/tests/test_aero_analysis_compressible.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "num_x": 2, "wing_type": "CRM", "symmetry": True, "num_twist_cp": 5} @@ -62,7 +61,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -72,7 +70,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces, compressible=True, rotational=False) point_name = "aero_point_{}".format(i) @@ -88,7 +85,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aero_analysis_no_symmetry.py b/openaerostruct/tests/test_aero_analysis_no_symmetry.py index fedfb66bf..8696a91d9 100644 --- a/openaerostruct/tests/test_aero_analysis_no_symmetry.py +++ b/openaerostruct/tests/test_aero_analysis_no_symmetry.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 11, "num_x": 3, "wing_type": "CRM", "symmetry": False, "num_twist_cp": 5} @@ -61,7 +60,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -71,7 +69,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -87,7 +84,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py b/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py index f7f069f10..c0caf118a 100644 --- a/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py +++ b/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 11, "num_x": 3, "wing_type": "CRM", "symmetry": False, "num_twist_cp": 5} @@ -61,7 +60,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -71,7 +69,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -87,7 +84,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aero_ffd.py b/openaerostruct/tests/test_aero_ffd.py index 0f617d957..7096dd7fb 100644 --- a/openaerostruct/tests/test_aero_ffd.py +++ b/openaerostruct/tests/test_aero_ffd.py @@ -14,7 +14,6 @@ @unittest.skipUnless(pygeo_flag, "pyGeo is required.") class Test(unittest.TestCase): def test(self): - from openaerostruct.geometry.utils import generate_mesh, write_FFD_file from openaerostruct.geometry.geometry_group import Geometry @@ -82,7 +81,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - filename = write_FFD_file(surface, surface["mx"], surface["my"]) DVGeo = DVGeometry(filename) geom_group = Geometry(surface=surface, DVGeo=DVGeo) @@ -94,7 +92,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -110,7 +107,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aero_morphing_multipoint.py b/openaerostruct/tests/test_aero_morphing_multipoint.py index 2e748a6ac..15fbedae8 100644 --- a/openaerostruct/tests/test_aero_morphing_multipoint.py +++ b/openaerostruct/tests/test_aero_morphing_multipoint.py @@ -13,7 +13,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = { "num_y": 5, @@ -82,7 +81,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(n_points): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -98,7 +96,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - geom_group = Geometry(surface=surface, connect_geom_DVs=False) # Add tmp_group to the problem as the name of the surface. diff --git a/openaerostruct/tests/test_aero_opt_wavedrag.py b/openaerostruct/tests/test_aero_opt_wavedrag.py index 05cb946a4..79629b17a 100644 --- a/openaerostruct/tests/test_aero_opt_wavedrag.py +++ b/openaerostruct/tests/test_aero_opt_wavedrag.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 11, "num_x": 3, "wing_type": "CRM", "symmetry": False, "num_twist_cp": 5} @@ -61,7 +60,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -71,7 +69,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -87,7 +84,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_aerostruct_analysis.py b/openaerostruct/tests/test_aerostruct_analysis.py index 9f687405c..40578b7ac 100644 --- a/openaerostruct/tests/test_aerostruct_analysis.py +++ b/openaerostruct/tests/test_aerostruct_analysis.py @@ -80,7 +80,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -92,7 +91,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -114,8 +112,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_analysis_Sref.py b/openaerostruct/tests/test_aerostruct_analysis_Sref.py index 879d46ab4..e30cee8ce 100644 --- a/openaerostruct/tests/test_aerostruct_analysis_Sref.py +++ b/openaerostruct/tests/test_aerostruct_analysis_Sref.py @@ -81,7 +81,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -93,7 +92,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -116,8 +114,7 @@ def test(self): prob.model.connect("load_factor", point_name + ".load_factor") prob.model.connect("S_ref_total", point_name + ".S_ref_total") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_analysis_compressible.py b/openaerostruct/tests/test_aerostruct_analysis_compressible.py index c62671b01..2754f128d 100644 --- a/openaerostruct/tests/test_aerostruct_analysis_compressible.py +++ b/openaerostruct/tests/test_aerostruct_analysis_compressible.py @@ -81,7 +81,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -93,7 +92,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -116,8 +114,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_engine_thrusts.py b/openaerostruct/tests/test_aerostruct_engine_thrusts.py index 46e146c85..a3711e177 100644 --- a/openaerostruct/tests/test_aerostruct_engine_thrusts.py +++ b/openaerostruct/tests/test_aerostruct_engine_thrusts.py @@ -90,7 +90,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -102,7 +101,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -125,8 +123,7 @@ def test(self): prob.model.connect("load_factor", point_name + ".load_factor") prob.model.connect("load_factor", point_name + ".coupled.load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_ffd.py b/openaerostruct/tests/test_aerostruct_ffd.py index 98bc6f86c..3d002f954 100644 --- a/openaerostruct/tests/test_aerostruct_ffd.py +++ b/openaerostruct/tests/test_aerostruct_ffd.py @@ -92,7 +92,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -106,7 +105,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -128,8 +126,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_point_loads.py b/openaerostruct/tests/test_aerostruct_point_loads.py index fea8dae62..e117a4784 100644 --- a/openaerostruct/tests/test_aerostruct_point_loads.py +++ b/openaerostruct/tests/test_aerostruct_point_loads.py @@ -88,7 +88,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -100,7 +99,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -123,8 +121,7 @@ def test(self): prob.model.connect("load_factor", point_name + ".load_factor") prob.model.connect("load_factor", point_name + ".coupled.load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py b/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py index 17aafaf71..67b361eb3 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py @@ -327,7 +327,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -339,7 +338,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -361,8 +359,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf." prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_wingbox_analysis.py b/openaerostruct/tests/test_aerostruct_wingbox_analysis.py index f05f60033..a071f6747 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_analysis.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_analysis.py @@ -327,7 +327,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -339,7 +338,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -361,8 +359,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf." prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py index 892f3a152..bf71f3630 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py @@ -332,7 +332,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -344,7 +343,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -366,8 +364,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf." prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_aerostruct_wingbox_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_opt.py index 909e7b5b3..fbb679151 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_opt.py @@ -328,7 +328,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -340,7 +339,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -362,8 +360,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf." prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" 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 83e64ca91..0b8a73353 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 @@ -333,7 +333,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -345,7 +344,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -367,8 +365,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf." prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_morphing_aerostruct.py b/openaerostruct/tests/test_morphing_aerostruct.py index f3b3bea39..38c7bc3f8 100644 --- a/openaerostruct/tests/test_morphing_aerostruct.py +++ b/openaerostruct/tests/test_morphing_aerostruct.py @@ -104,7 +104,6 @@ def test(self): prob.model.connect("twist_cp_1", "AS_point_1.wing.geometry.twist_cp") for point in range(2): - name = "wing" point_name = "AS_point_{}".format(point) diff --git a/openaerostruct/tests/test_multiple_aero_analysis.py b/openaerostruct/tests/test_multiple_aero_analysis.py index 701d90e67..7328f58aa 100644 --- a/openaerostruct/tests/test_multiple_aero_analysis.py +++ b/openaerostruct/tests/test_multiple_aero_analysis.py @@ -95,7 +95,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -105,7 +104,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -121,7 +119,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_multiple_rect.py b/openaerostruct/tests/test_multiple_rect.py index cd92b7ce7..02e3aa072 100644 --- a/openaerostruct/tests/test_multiple_rect.py +++ b/openaerostruct/tests/test_multiple_rect.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "num_x": 2, "wing_type": "rect", "symmetry": True} @@ -93,7 +92,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -103,7 +101,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -119,7 +116,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_multipoint_aero_ffd.py b/openaerostruct/tests/test_multipoint_aero_ffd.py index 0ed7e0dd8..a9b1d6606 100644 --- a/openaerostruct/tests/test_multipoint_aero_ffd.py +++ b/openaerostruct/tests/test_multipoint_aero_ffd.py @@ -13,7 +13,6 @@ @unittest.skipUnless(pygeo_flag, "pyGeo is required.") class Test(unittest.TestCase): def test(self): - from openaerostruct.geometry.utils import generate_mesh, write_FFD_file from openaerostruct.geometry.geometry_group import Geometry from openaerostruct.aerodynamics.aero_groups import AeroPoint @@ -98,7 +97,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(n_points): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) diff --git a/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py b/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py index a5b322af9..2180ab9d2 100644 --- a/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py +++ b/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py @@ -335,7 +335,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -347,7 +346,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(2): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -370,8 +368,7 @@ def test(self): prob.model.connect("fuel_mass", point_name + ".total_perf.L_equals_W.fuelburn") prob.model.connect("fuel_mass", point_name + ".total_perf.CG.fuelburn") - for surface in surfaces: - + for _surface in surfaces: prob.model.connect("load_factor", point_name + ".coupled.load_factor", src_indices=[i]) com_name = point_name + "." + name + "_perf." diff --git a/openaerostruct/tests/test_multipoint_wingbox_derivs.py b/openaerostruct/tests/test_multipoint_wingbox_derivs.py index e0dd3543d..1b79c22b9 100644 --- a/openaerostruct/tests/test_multipoint_wingbox_derivs.py +++ b/openaerostruct/tests/test_multipoint_wingbox_derivs.py @@ -333,7 +333,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -345,7 +344,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(2): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -369,8 +367,7 @@ def test(self): prob.model.connect("fuel_mass", point_name + ".total_perf.L_equals_W.fuelburn") prob.model.connect("fuel_mass", point_name + ".total_perf.CG.fuelburn") - for surface in surfaces: - + for _surface in surfaces: prob.model.connect("load_factor", point_name + ".coupled.load_factor", src_indices=[i]) com_name = point_name + "." + name + "_perf." diff --git a/openaerostruct/tests/test_scaneagle.py b/openaerostruct/tests/test_scaneagle.py index ca7215abe..5cf43b454 100644 --- a/openaerostruct/tests/test_scaneagle.py +++ b/openaerostruct/tests/test_scaneagle.py @@ -12,7 +12,6 @@ class Test(unittest.TestCase): def test(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 diff --git a/openaerostruct/tests/test_simple_rect_AS.py b/openaerostruct/tests/test_simple_rect_AS.py index 15bee3109..88cfc2f0b 100644 --- a/openaerostruct/tests/test_simple_rect_AS.py +++ b/openaerostruct/tests/test_simple_rect_AS.py @@ -81,7 +81,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -93,7 +92,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -115,8 +113,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_simple_rect_aero.py b/openaerostruct/tests/test_simple_rect_aero.py index 9fc542a43..f5843753e 100644 --- a/openaerostruct/tests/test_simple_rect_aero.py +++ b/openaerostruct/tests/test_simple_rect_aero.py @@ -12,7 +12,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": True} @@ -63,7 +62,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -73,7 +71,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -89,7 +86,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_simple_rect_aero_roll.py b/openaerostruct/tests/test_simple_rect_aero_roll.py index f81e3adc2..394656e20 100644 --- a/openaerostruct/tests/test_simple_rect_aero_roll.py +++ b/openaerostruct/tests/test_simple_rect_aero_roll.py @@ -12,7 +12,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": False} @@ -64,7 +63,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -74,7 +72,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces, rotational=True) point_name = "aero_point_{}".format(i) @@ -91,7 +88,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_simple_rect_aero_sideslip.py b/openaerostruct/tests/test_simple_rect_aero_sideslip.py index 9c7cfb840..fe88c2c1e 100644 --- a/openaerostruct/tests/test_simple_rect_aero_sideslip.py +++ b/openaerostruct/tests/test_simple_rect_aero_sideslip.py @@ -12,7 +12,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": False} @@ -65,7 +64,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -75,7 +73,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces, rotational=True) point_name = "aero_point_{}".format(i) @@ -92,7 +89,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_simple_rect_aero_wo_symmetry.py b/openaerostruct/tests/test_simple_rect_aero_wo_symmetry.py index c8ff06e49..ef870b626 100644 --- a/openaerostruct/tests/test_simple_rect_aero_wo_symmetry.py +++ b/openaerostruct/tests/test_simple_rect_aero_wo_symmetry.py @@ -12,7 +12,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": False} @@ -63,7 +62,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -73,7 +71,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -89,7 +86,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_simple_rect_right_aero.py b/openaerostruct/tests/test_simple_rect_right_aero.py index 4222c4b92..4b6b3c903 100644 --- a/openaerostruct/tests/test_simple_rect_right_aero.py +++ b/openaerostruct/tests/test_simple_rect_right_aero.py @@ -12,7 +12,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": True} @@ -91,7 +90,6 @@ def run_problem(self, mesh): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -101,7 +99,6 @@ def run_problem(self, mesh): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -117,7 +114,6 @@ def run_problem(self, mesh): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_struct_analysis.py b/openaerostruct/tests/test_struct_analysis.py index a115701bf..7c8a5b88a 100644 --- a/openaerostruct/tests/test_struct_analysis.py +++ b/openaerostruct/tests/test_struct_analysis.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "wing_type": "CRM", "symmetry": True, "num_twist_cp": 5} diff --git a/openaerostruct/tests/test_struct_analysis_2g.py b/openaerostruct/tests/test_struct_analysis_2g.py index 23ebdf2c3..28ec53128 100644 --- a/openaerostruct/tests/test_struct_analysis_2g.py +++ b/openaerostruct/tests/test_struct_analysis_2g.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "wing_type": "CRM", "symmetry": True, "num_twist_cp": 5} diff --git a/openaerostruct/tests/test_struct_engine_thrusts.py b/openaerostruct/tests/test_struct_engine_thrusts.py index ae473b424..48db58dde 100644 --- a/openaerostruct/tests/test_struct_engine_thrusts.py +++ b/openaerostruct/tests/test_struct_engine_thrusts.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 31, "wing_type": "rect", "span": 10, "symmetry": True} @@ -69,7 +68,6 @@ def test(self): assert_near_equal(prob["vonmises"][-1, 0], 300352.285697, 1e-4) def test_multiple_masses(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 31, "wing_type": "rect", "span": 10, "symmetry": True} diff --git a/openaerostruct/tests/test_struct_no_loads.py b/openaerostruct/tests/test_struct_no_loads.py index ea70ce774..d1d972cbe 100644 --- a/openaerostruct/tests/test_struct_no_loads.py +++ b/openaerostruct/tests/test_struct_no_loads.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "wing_type": "CRM", "symmetry": True, "num_twist_cp": 5} diff --git a/openaerostruct/tests/test_struct_point_masses.py b/openaerostruct/tests/test_struct_point_masses.py index abf9c7f27..b5ef926ae 100644 --- a/openaerostruct/tests/test_struct_point_masses.py +++ b/openaerostruct/tests/test_struct_point_masses.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 31, "wing_type": "rect", "span": 10, "symmetry": True} @@ -69,7 +68,6 @@ def test(self): assert_near_equal(prob["vonmises"][-1, 0], 2956850.70882332, 1e-4) def test_multiple_masses(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 31, "wing_type": "rect", "span": 10, "symmetry": True} diff --git a/openaerostruct/tests/test_v1_aero_analysis.py b/openaerostruct/tests/test_v1_aero_analysis.py index ba014c565..00a45ce75 100644 --- a/openaerostruct/tests/test_v1_aero_analysis.py +++ b/openaerostruct/tests/test_v1_aero_analysis.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = { "num_y": 5, @@ -70,7 +69,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -80,7 +78,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -96,7 +93,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_v1_aero_viscous.py b/openaerostruct/tests/test_v1_aero_viscous.py index 2ce43c952..3da0698f9 100644 --- a/openaerostruct/tests/test_v1_aero_viscous.py +++ b/openaerostruct/tests/test_v1_aero_viscous.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = { "num_y": 5, @@ -70,7 +69,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -80,7 +78,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -96,7 +93,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_v1_aero_viscous_opt.py b/openaerostruct/tests/test_v1_aero_viscous_opt.py index c05f77a08..d4000055c 100644 --- a/openaerostruct/tests/test_v1_aero_viscous_opt.py +++ b/openaerostruct/tests/test_v1_aero_viscous_opt.py @@ -11,7 +11,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = { "num_y": 5, @@ -72,7 +71,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - geom_group = Geometry(surface=surface) # Add tmp_group to the problem as the name of the surface. @@ -82,7 +80,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - # Create the aero point group and add it to the model aero_group = AeroPoint(surfaces=surfaces) point_name = "aero_point_{}".format(i) @@ -98,7 +95,6 @@ def test(self): # Connect the parameters within the model for each aero point for surface in surfaces: - name = surface["name"] # Connect the mesh from the geometry component to the analysis point diff --git a/openaerostruct/tests/test_v1_aerostruct_analysis.py b/openaerostruct/tests/test_v1_aerostruct_analysis.py index 312a8c4eb..9d3b572d3 100644 --- a/openaerostruct/tests/test_v1_aerostruct_analysis.py +++ b/openaerostruct/tests/test_v1_aerostruct_analysis.py @@ -87,7 +87,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -99,7 +98,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -121,8 +119,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_v1_aerostruct_opt.py b/openaerostruct/tests/test_v1_aerostruct_opt.py index 0dfec327a..486ac1d90 100644 --- a/openaerostruct/tests/test_v1_aerostruct_opt.py +++ b/openaerostruct/tests/test_v1_aerostruct_opt.py @@ -87,7 +87,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -99,7 +98,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -121,8 +119,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: com_name = point_name + "." + name + "_perf" prob.model.connect( name + ".local_stiff_transformed", point_name + ".coupled." + name + ".local_stiff_transformed" diff --git a/openaerostruct/tests/test_v1_struct_analysis.py b/openaerostruct/tests/test_v1_struct_analysis.py index 7825d3e20..8f9eb49e2 100644 --- a/openaerostruct/tests/test_v1_struct_analysis.py +++ b/openaerostruct/tests/test_v1_struct_analysis.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = { "num_y": 5, diff --git a/openaerostruct/tests/test_v1_struct_opt.py b/openaerostruct/tests/test_v1_struct_opt.py index d06ce0f1d..9149b4443 100644 --- a/openaerostruct/tests/test_v1_struct_opt.py +++ b/openaerostruct/tests/test_v1_struct_opt.py @@ -10,7 +10,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = { "num_y": 5, diff --git a/openaerostruct/tests/test_vsp_aero_analysis.py b/openaerostruct/tests/test_vsp_aero_analysis.py index aa04d056a..f0517684e 100644 --- a/openaerostruct/tests/test_vsp_aero_analysis.py +++ b/openaerostruct/tests/test_vsp_aero_analysis.py @@ -23,7 +23,6 @@ @unittest.skipUnless(openvsp_flag, "OpenVSP is required.") class Test(unittest.TestCase): def test(self): - # Run a symmetric and full model aero case symm_prob = self.setup_prob(True) full_prob = self.setup_prob(False) diff --git a/openaerostruct/tests/test_wingbox_analysis.py b/openaerostruct/tests/test_wingbox_analysis.py index 8b055be0c..cf6108097 100644 --- a/openaerostruct/tests/test_wingbox_analysis.py +++ b/openaerostruct/tests/test_wingbox_analysis.py @@ -233,7 +233,6 @@ class Test(unittest.TestCase): def test(self): - # Create a dictionary to store options about the surface mesh_dict = {"num_y": 7, "wing_type": "uCRM_based", "symmetry": True, "num_twist_cp": 5} diff --git a/openaerostruct/tests/test_wingbox_derivs.py b/openaerostruct/tests/test_wingbox_derivs.py index d625b231a..9db48e92c 100644 --- a/openaerostruct/tests/test_wingbox_derivs.py +++ b/openaerostruct/tests/test_wingbox_derivs.py @@ -330,7 +330,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -342,7 +341,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -364,8 +362,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: prob.model.connect("load_factor", point_name + ".coupled.load_factor") com_name = point_name + "." + name + "_perf." diff --git a/openaerostruct/tests/test_wingbox_distributed_fuel.py b/openaerostruct/tests/test_wingbox_distributed_fuel.py index 81a41ef05..876f7cc8a 100644 --- a/openaerostruct/tests/test_wingbox_distributed_fuel.py +++ b/openaerostruct/tests/test_wingbox_distributed_fuel.py @@ -334,7 +334,6 @@ def test(self): # Loop over each surface in the surfaces list for surface in surfaces: - # Get the surface name and create a group to contain components # only for this surface name = surface["name"] @@ -346,7 +345,6 @@ def test(self): # Loop through and add a certain number of aero points for i in range(1): - point_name = "AS_point_{}".format(i) # Connect the parameters within the model for each aero point @@ -368,8 +366,7 @@ def test(self): prob.model.connect("empty_cg", point_name + ".empty_cg") prob.model.connect("load_factor", point_name + ".load_factor") - for surface in surfaces: - + for _surface in surfaces: prob.model.connect("load_factor", point_name + ".coupled.load_factor") com_name = point_name + "." + name + "_perf." diff --git a/openaerostruct/utils/plot_wing.py b/openaerostruct/utils/plot_wing.py index c2d3c9e27..d5f2923aa 100644 --- a/openaerostruct/utils/plot_wing.py +++ b/openaerostruct/utils/plot_wing.py @@ -32,7 +32,6 @@ class Display(object): def __init__(self, args): - self.db_name = args[1] try: @@ -150,17 +149,14 @@ def load_db(self): # loop to pull data out of case reader and organize it into arrays for i, case in enumerate(cr.get_cases()): - if self.opt: self.obj.append(case.outputs[self.obj_key]) # Loop through each of the surfaces for name in names: - # Check if this is an aerostructual case; treat differently # due to the way the problem is organized if not self.aerostruct: - # A mesh exists for all types of cases self.mesh.append(case.outputs[name + ".mesh"]) @@ -262,7 +258,6 @@ def load_db(self): self.symmetry = False if self.symmetry: - new_mesh = [] if self.show_tube: new_r = [] @@ -405,9 +400,7 @@ def load_db(self): self.max_vm += diff def plot_sides(self): - if self.show_wing: - self.ax2.cla() self.ax2.locator_params(axis="y", nbins=5) self.ax2.locator_params(axis="x", nbins=3) @@ -424,7 +417,6 @@ def plot_sides(self): self.ax3.set_ylabel("lift", rotation="horizontal", ha="right") if self.show_tube: - self.ax4.cla() self.ax4.locator_params(axis="y", nbins=4) self.ax4.locator_params(axis="x", nbins=3) @@ -468,7 +460,6 @@ def plot_sides(self): self.ax5.plot(span_diff, vm_vals, lw=2, c="b") def plot_wing(self): - n_names = len(self.names) self.ax.cla() az = self.ax.azim @@ -538,7 +529,6 @@ def plot_wing(self): # Loop through each element in the FEM system for i, thick in enumerate(t0): - # Get the radii describing the circles at each nodal point r = np.array((r0[i], r0[i])) R, P = np.meshgrid(r, p) diff --git a/openaerostruct/utils/plot_wingbox.py b/openaerostruct/utils/plot_wingbox.py index 05a6b89c6..6ccd61bdc 100644 --- a/openaerostruct/utils/plot_wingbox.py +++ b/openaerostruct/utils/plot_wingbox.py @@ -34,7 +34,6 @@ class Display(object): def __init__(self, args): - self.db_name = args[1] try: @@ -136,7 +135,6 @@ def load_db(self): # find the names of all surfaces pt_names = [] for key in last_case.outputs: - # Aerostructural if "coupled" in key: self.aerostruct = True @@ -158,17 +156,14 @@ def load_db(self): # loop to pull data out of case reader and organize it into arrays for i, case in enumerate(cr.get_cases()): - if self.opt: self.obj.append(case.outputs[self.obj_key]) # Loop through each of the surfaces for name in names: - # Check if this is an aerostructual case; treat differently # due to the way the problem is organized if not self.aerostruct: - # A mesh exists for all types of cases self.mesh.append(case.outputs[name + ".mesh"]) @@ -309,7 +304,6 @@ def load_db(self): self.symmetry = False if self.symmetry: - new_mesh = [] if self.show_tube: new_r = [] @@ -504,9 +498,7 @@ def load_db(self): self.max_vm += diff def plot_sides(self): - if self.show_wing: - self.ax2.cla() self.ax2.locator_params(axis="y", nbins=5) self.ax2.locator_params(axis="x", nbins=3) @@ -525,7 +517,6 @@ def plot_sides(self): self.ax3.set_ylabel("normalized lift", rotation="horizontal", ha="right") if self.show_tube: - self.ax4.cla() self.ax4.locator_params(axis="y", nbins=4) self.ax4.locator_params(axis="x", nbins=3) @@ -594,7 +585,6 @@ def plot_sides(self): self.ax6.set_xticklabels([]) def plot_wing(self): - n_names = len(self.names) self.ax.cla() az = self.ax.azim @@ -607,7 +597,6 @@ def plot_wing(self): # dist = 15. for j, name in enumerate(self.names): - # for wingbox viz try: le_te = np.load(str("temp_" + name + "_le_te.npy")) diff --git a/setup.py b/setup.py index e9800362a..8da7c04c7 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ optional_dependencies = { "docs": ["sphinx_mdolab_theme"], "test": ["pytest", "pytest-cov", "coverage"], - "ffd": ["pygeo>=1.6.0"] + "ffd": ["pygeo>=1.6.0"], } # Add an optional dependency that concatenates all others @@ -50,8 +50,9 @@ # Test files package_data={"openaerostruct": ["tests/*.py", "*/tests/*.py", "*/*/tests/*.py"]}, install_requires=[ - "openmdao>=3.2, <=3.16.0", # don't forget to update OM versions in README.md and docs/installation.rst - "numpy>1.19", + # Remember to update the oldest versions in the GitHub Actions build, the readme, and in docs/installation.rst + "openmdao>=3.10", + "numpy>=1.20", "scipy>=1.6.0", "matplotlib", ],