Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/main' into only_fuse_eng…
Browse files Browse the repository at this point in the history
…_final
  • Loading branch information
jkirk5 committed Dec 30, 2024
2 parents 4ad9599 + 0eab7f6 commit e200438
Show file tree
Hide file tree
Showing 489 changed files with 30,773 additions and 14,392 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: ./actions/.github/actions/prepare_environment
with:
NAME: 'latest'
PY: 3
PY: 3.12
NUMPY: 1
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
# Allow running the workflow manually from the Actions tab
workflow_dispatch:


jobs:

latest_docs:
Expand All @@ -28,30 +28,30 @@ jobs:
sparse-checkout: |
.github/actions
path: actions

- name: prepare_docs_environment
uses: ./actions/.github/actions/prepare_environment
with:
NAME: 'latest'
PY: 3
PY: 3.12
NUMPY: 1
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: 'latest'
DYMOS: 'latest'
DYMOS: 'latest'
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
SNOPT_LOCATION_77: ${{ secrets.SNOPT_LOCATION_77 }}

- name: Check docs linting
shell: bash -l {0}
run: |
echo "============================================================="
echo "Lint the docs"
echo "============================================================="
python aviary/docs/tests/check_jupyter_output_linting.py
- name: Build docs
id: build_docs
shell: bash -l {0}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ jobs:
matrix:
include:
# oldest versions of openmdao/dymos
# Note: bugfixes sometimes require incrementing the minimal version of openmdao or dymos.
- NAME: oldest
PY: '3.9'
NUMPY: '1.20'
SCIPY: '1.6'
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: '3.33.0'
OPENMDAO: '3.35.0'
DYMOS: '1.8.0'

# latest versions of openmdao/dymos
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_workflow_dev_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# latest released version of pyoptsparse
# development versions of openmdao/dymos
- NAME: dev
PY: 3
PY: 3.12
NUMPY: 1
SCIPY: 1
PYOPTSPARSE: 'latest'
Expand Down Expand Up @@ -62,7 +62,6 @@ jobs:
testflo . -n 1 --timeout=200 --show_skipped --coverage --coverpkg aviary
- name: Checkout actions (again)
if: failure()
uses: actions/checkout@v3
with:
sparse-checkout: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_workflow_no_dev_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
echo "============================================================="
echo "Install Aviary"
echo "============================================================="
echo ""
echo "Temporarily install specific versions for now."
pip install "numpy<2"
pip install packaging
pip install .[all]
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,9 @@ coloring_files/
# OpenMDAO N2 diagrams
n2.html

# Input and output lists
input_list.txt
output_list.txt

# Windows downloads
*:Zone.Identifier
30 changes: 30 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cff-version: 1.2.0
title: Aviary: An Open-Source Multidisciplinary Design, Analysis, and Optimization Tool for Modeling Aircraft with Analytic Gradients
message: Please use this citation when using Aviary in your research!
type: software
authors:
- given-names: Jennifer
family-names: Gratz
affiliation: NASA Glenn Research Center
- given-names: Jason
family-names: Kirk
affiliation: NASA Langley Research Center
- given-names: Carl
family-names: Recine
affiliation: NASA Ames Research Center
- given-names: John
family-names: Jasa
affiliation: Banner Quality Management Inc.
- given-names: Eliot
family-names: Aretskin-Hariton
affiliation: NASA Glenn Research Center
- given-names: Kenneth
family-names: Moore
affiliation: Banner Quality Management Inc.
identifiers:
- type: doi
value: 10.2514/6.2024-4219
repository-code: 'https://github.com/OpenMDAO/Aviary'
repository: 'https://github.com/OpenMDAO/Aviary_Community'
license: Apache-2.0
version: 0.9.3
9 changes: 4 additions & 5 deletions aviary/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
This module is the API for Aviary aircraft analysis code
For users: All built-in Aviary functions, code, and objects
For users: All built-in Aviary functions, code, and objects
should be imported from this file.
For developers: All Aviary code which is intended to be
Expand Down Expand Up @@ -41,7 +41,7 @@
from aviary.interface.utils.check_phase_info import check_phase_info
from aviary.utils.engine_deck_conversion import EngineDeckConverter
from aviary.utils.fortran_to_aviary import create_aviary_deck
from aviary.utils.functions import set_aviary_initial_values, get_path
from aviary.utils.functions import set_aviary_input_defaults, set_aviary_initial_values, get_path
from aviary.utils.options import list_options
from aviary.constants import GRAV_METRIC_GASP, GRAV_ENGLISH_GASP, GRAV_METRIC_FLOPS, GRAV_ENGLISH_FLOPS, GRAV_ENGLISH_LBM, RHO_SEA_LEVEL_ENGLISH, RHO_SEA_LEVEL_METRIC, MU_TAKEOFF, MU_LANDING, PSLS_PSF, TSLS_DEGR, RADIUS_EARTH_METRIC
from aviary.subsystems.test.subsystem_tester import TestSubsystemBuilderBase, skipIfMissingDependencies
Expand All @@ -58,7 +58,6 @@
from aviary.utils.preprocessors import preprocess_options, preprocess_propulsion
from aviary.utils.process_input_decks import create_vehicle
from aviary.utils.functions import create_opts2vals, add_opts2vals, Null
from aviary.variable_info.variables_in import VariablesIn
from aviary.utils.preprocessors import preprocess_crewpayload

# ODEs
Expand All @@ -75,8 +74,8 @@
from aviary.mission.gasp_based.ode.flight_path_ode import FlightPathODE as TwoDOFFlightPathODE
from aviary.mission.gasp_based.ode.groundroll_ode import GroundrollODE as TwoDOFGroundrollODE
from aviary.mission.gasp_based.ode.rotation_ode import RotationODE as TwoDOFRotationODE
from aviary.mission.gasp_based.phases.landing_group import LandingSegment as TwoDOFSimplifiedLanding
from aviary.mission.gasp_based.phases.taxi_group import TaxiSegment as AnalyticTaxi
from aviary.mission.gasp_based.ode.landing_ode import LandingSegment as TwoDOFSimplifiedLanding
from aviary.mission.gasp_based.ode.taxi_ode import TaxiSegment as AnalyticTaxi
from aviary.mission.flops_based.phases.simplified_takeoff import TakeoffGroup as HeightEnergySimplifiedTakeoff
from aviary.mission.flops_based.phases.simplified_landing import LandingGroup as HeightEnergySimplifiedLanding

Expand Down
2 changes: 2 additions & 0 deletions aviary/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
GRAV_METRIC_FLOPS = 9.80665 # m/s^2
GRAV_ENGLISH_FLOPS = 32.17399 # ft/s^2
GRAV_ENGLISH_LBM = 1.0 # lbf/lbm
# TODO this does not match what dymos atmosphere comp predicts, which leads to subtle
# problems such as density ratio not being 1 at sea level
RHO_SEA_LEVEL_ENGLISH = 0.0023769 # slug/ft^3
RHO_SEA_LEVEL_METRIC = 1.225 # kg/m^3
MU_TAKEOFF = 0.02 # TODO: fill in coefficient of friction for takeoff
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ copyright: '2023'
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force
timeout: 120
timeout: 240
# execute_notebooks: auto

exclude_patterns: ["*/reports/*"]
Expand Down
7 changes: 7 additions & 0 deletions aviary/docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ parts:
- file: user_guide/features/overriding
- file: user_guide/FLOPS_based_detailed_takeoff_and_landing
- file: user_guide/reserve_missions
- file: user_guide/multi_mission
- file: user_guide/off_design_missions
- file: user_guide/SGM_capabilities
- file: user_guide/troubleshooting

Expand All @@ -56,6 +58,8 @@ parts:
- file: examples/coupled_aircraft_mission_optimization
- file: examples/additional_flight_phases
- file: examples/reserve_missions
- file: examples/multi_mission
- file: examples/off_design_example
- file: examples/OAS_subsystem
- file: examples/level_2_detailed_takeoff_and_landing

Expand All @@ -80,6 +84,9 @@ parts:
- file: developer_guide/unit_tests
- file: developer_guide/contributing_guidelines
- file: developer_guide/how_to_contribute_docs
sections:
- file: developer_guide/doctape.ipynb
- file: developer_guide/doctape_examples.ipynb
- file: developer_guide/debugging_env_from_github

- caption: Miscellaneous Resources
Expand Down
53 changes: 40 additions & 13 deletions aviary/docs/developer_guide/codebase_overview.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"from aviary.utils.doctape import glue_variable\n",
"\n",
"structure = {\n",
" 'docs':'contains the doc files for Aviary',\n",
" 'examples':'contains example code for using Aviary, including external subsystem examples',\n",
" 'interface':'is where most code that users interact with is located',\n",
" 'mission':'contains OpenMDAO components and groups for modeling the aircraft mission',\n",
" 'models':'contains aircraft and propulsion models for use in Aviary examples and tests',\n",
" 'subsystems':'is where the aerodynamic, atmosphere, energy, propulsion, mass, and geometry core subsystems are located',\n",
" 'utils':'contains utility functions for use in Aviary code, examples, and tests',\n",
" 'validation_cases':'contains validation cases for testing and benchmarking Aviary',\n",
" 'variable_info':'contains the variable meta data as well as several variable classes that are used in Aviary',\n",
" 'visualization':'is where the Aviary dashboard is located',\n",
" }\n",
"\n",
"bulleted_list = ''\n",
"for key, val in structure.items():\n",
" bulleted_list += f'- `{key}` {val}\\n'\n",
"\n",
"# change display to False to prevent displaying the results when running cells directly\n",
"# (Does not change the generated book)\n",
"glue_variable('folder_structure', bulleted_list, display=True)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -10,16 +44,9 @@
"\n",
"Within the Aviary repository and package, the codebase is structured as follows:\n",
"\n",
"- `docs` contains the doc files for Aviary\n",
"- `examples` contains example code for using Aviary, including external subsystem examples\n",
"- `interface` is where most code that users interact with is located\n",
"- `mission` contains OpenMDAO components and groups for modeling the aircraft mission\n",
"- `models` contains aircraft and propulsion models for use in Aviary examples and tests\n",
"- `subsystems` is where the aerodynamic, propulsion, mass, and geometry core subsystems are located\n",
"- `utils` contains utility functions for use in Aviary code, examples, and tests\n",
"- `validation_cases` contains validation cases for testing and benchmarking Aviary\n",
"- `variable_info` contains the variable meta data as well as several variable classes that are used in Aviary\n",
"- `visualization` is where the Aviary dashboard is located"
"```{glue:md} folder_structure\n",
":format: myst\n",
"```"
]
},
{
Expand All @@ -35,11 +62,11 @@
"# Testing Cell\n",
"import os\n",
"from aviary.utils.functions import get_path\n",
"from aviary.docs.tests.utils import check_contains\n",
"directories = ['docs', 'examples', 'interface', 'mission', 'models', 'subsystems', 'utils', 'validation_cases', 'variable_info', 'visualization']\n",
"from aviary.utils.doctape import check_contains\n",
"\n",
"folder = get_path('docs').parent\n",
"subfolders = [ f.name for f in os.scandir(folder) ]\n",
"check_contains(directories, subfolders)"
"check_contains(structure, subfolders)"
]
}
],
Expand Down
38 changes: 37 additions & 1 deletion aviary/docs/developer_guide/coding_standards.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"# Testing Cell\n",
"import aviary.api as av\n",
"from aviary.utils.doctape import get_attribute_name, get_variable_name, glue_variable\n",
"Verbosity = av.Verbosity;\n",
"\n",
"verbosity = get_attribute_name(av.Settings,av.Settings.VERBOSITY)\n",
"glue_variable('VERBOSITY',verbosity, md_code=True)\n",
"glue_variable(get_variable_name(Verbosity), md_code=True)\n",
"glue_variable('QUIET',av.Verbosity.QUIET.name, md_code=True)\n",
"glue_variable('BRIEF',av.Verbosity.BRIEF.name, md_code=True)\n",
"glue_variable(get_variable_name(Verbosity.BRIEF), md_code=True)\n",
"glue_variable('VERBOSE',av.Verbosity.VERBOSE.name, md_code=True)\n",
"glue_variable('DEBUG',av.Verbosity.DEBUG.name, md_code=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -23,7 +48,18 @@
"The Aviary repository contains a configuration file that defines what is run when commits are made and with what options enabled. Currently this is limited to autopep8 with a max line length restriction.\n",
"\n",
"### Controlling Display Levels\n",
"To make debugging issues easier, it is strongly recommended to make use of the `VERBOSITY` setting. This allows control over how much information is displayed to a user; too much information makes finding relevant information difficult and not enough information can make tracking difficult. `Brief` should be the default in most cases; however, `Quiet` should be the default for tests."
"To make debugging issues easier, it is strongly recommended to make use of the {glue:md}`Verbosity` setting. This allows control over how much information is displayed to a user; too much information makes finding relevant information difficult and not enough information can make tracking difficult. Aviary uses a sliding scale of possible verbosity settings:\n",
"| Verbosity Level | Numerical Value | Description |\n",
"| :--- | :--- | :--- |\n",
"| `QUIET` | 0 | All output except errors are suppressed |\n",
"| `BRIEF` | 1 | Only important information is output, in human-readable format |\n",
"| `VERBOSE` | 2 | All user-relevant information is output, in human-readable format |\n",
"| `DEBUG` | 3 | Any information can be outputted, including warnings, intermediate calculations, etc., with no formatting requirement |\n",
"\n",
"Verbosity levels are defined in Aviary using the `Verbosity` Enum. Each verbosity level is paired with an integer value. In source code, verbosity level can be checked either through comparison with the Enum, or through equality or inequality comparisons with the matching integer value. This allows for code to be triggered not just at a specific level, but for any level above or below the desired setting. Numerical comparisons are recommended for several reasons: they don't require importing the {glue:md}`Verbosity` Enum, and activation is more flexible through the use of inequality comparators, preventing issues like a message only being outputted during {glue:md}`BRIEF` but not {glue:md}`VERBOSE` or {glue:md}`DEBUG`, which a user would expect to also see in higher verbosity settings.\n",
"{glue:md}`BRIEF` is default setting and is used in most cases; however, {glue:md}`QUIET` should be used for tests.\n",
"\n",
"It is preferred that within source code, the full Enums are used for better readability (e.g. `Verbosity.BRIEF`). For tests, scripts, examples, and other places where Aviary is called (rather than defined), it is ok to use the integer representations of verbosity to shorten lines and remove the need to import the {glue:md}`Verbosity` Enum (e.g. passing `0` as the verbosity argument to a function when {glue:md}`QUIET` is desired). Of course, it is always acceptable to use the full Enum in these cases for the same readability reasons."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/developer_guide/contributing_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We require all code entering our codebase to be validated and regression tested.
Documentation is the backbone of the Aviary team's support for our user community. The goal of Aviary's documentation is to provide a way for Aviary users to learn the codebase and have their questions answered in an efficient manner. Thus, we monitor the documentation to ensure that changes in the code are reflected in the docs, and that new code features are documented as well. As a result of this, any pull request which alters a feature's behavior must also update the documentation for that feature, and any pull request which creates a new feature for use by a user must also document that feature. For a guide on writing documentation in Aviary visit [How to Contribute Docs](how_to_contribute_docs).

## Docstrings
The Aviary codebase is currently under active development and cleanup, including the addition of docstrings. Thus, not every function and class currently includes a docstring, however, we are slowly adding them. In order to move forwards instead of backwards we require that all added functions and classes include a docstring in the numpy format.
The Aviary codebase is currently under active development and cleanup, including the addition of docstrings. Thus, not every function and class currently includes a docstring, however, we are slowly adding them. In order to move forwards instead of backwards we require that all added functions and classes include a docstring in the numpy format. Note: Do not add docstrings in [unit test](unit_tests.md) methods because when we run unittest/testflo, the docstring will print instead of the test object path, which isn't always ideal.

## Benchmark Tests
The Aviary codebase has several benchmark tests which test some of the baseline models included in Aviary. These tests supplement the unit test capability, and are tested frequently by the Aviary team. We encourage you to run these tests using our test runner located [here](https://github.com/OpenMDAO/Aviary/blob/main/aviary/run_all_benchmarks.py).
Expand Down
Loading

0 comments on commit e200438

Please sign in to comment.