Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Verbosity cleanup and reduced warnings/printouts #636

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a524869
Updated printout control using verbosity
Dec 20, 2024
834f677
fix warnings appearing in tests
Dec 20, 2024
2c494bf
added backup for failed benchmark tests due to mpi failure
Dec 20, 2024
c3e394f
Merge remote-tracking branch 'remotes/origin/main' into cleanup
Dec 20, 2024
c7f3072
fixed missing variable & updated associated tests
Dec 20, 2024
7102ba6
mass variable naming updates
Dec 23, 2024
bcc5bcd
test bench cleanup
Dec 23, 2024
546e2ca
verbosity updates
Dec 23, 2024
745c921
updates for turboprop
Dec 23, 2024
79fb3b9
adjustments to turboprop bench
Dec 23, 2024
fda0b55
update optimizer printouts for SLSQP
Dec 26, 2024
c8e2529
variable desc cleanup
Dec 26, 2024
c846ad8
more test verbosity updates
Dec 26, 2024
7304904
fixed default verbosity for preprocessors when not provided when user
Dec 26, 2024
78fad60
another round of test verbosity updates/fixes
Dec 26, 2024
32d38d8
Update aviary/interface/methods_for_level2.py
jkirk5 Dec 26, 2024
4567556
better comments in L2
Dec 26, 2024
ba8d89d
suppress multimission bench plot
Dec 26, 2024
8e5d288
Merge branch 'cleanup' of https://github.com/jkirk5/om-Aviary into cl…
Dec 26, 2024
c3e49af
cleaner verbosity comments for L2
Dec 26, 2024
b21d704
more verbosity fixes for tests
Dec 26, 2024
3dec4d1
formatting fixes
Dec 27, 2024
6c3b9e3
fixes for doc glue checks
Dec 27, 2024
935a023
fix invalid char warning for regex
Dec 27, 2024
e1bad53
doc updates
Dec 27, 2024
844dab7
formatting fix
Dec 30, 2024
70e4127
properly incremented version number
Dec 31, 2024
8b02f1a
mach -> Mach in comments/docstrings
Dec 31, 2024
11b14f0
Merge remote-tracking branch 'remotes/origin/main' into cleanup
Dec 31, 2024
a319a15
add skip for OAS test if ambiance not installed
Jan 14, 2025
bd9caa0
Merge remote-tracking branch 'remotes/origin/main' into cleanup
Jan 14, 2025
952e499
minor cleanup
Jan 17, 2025
d8ccd5d
CI fixes
Jan 22, 2025
129ea20
removed docs artifact file (it should be generated while building the…
Jan 22, 2025
e27ab1c
Merge branch 'main' into cleanup
Jan 23, 2025
f42cab0
Merge branch 'main' into cleanup
jkirk5 Jan 23, 2025
a66c80d
Merge remote-tracking branch 'remotes/origin/units' into cleanup
Jan 23, 2025
0b1ccf3
Merge branch 'cleanup' of https://github.com/jkirk5/om-Aviary into cl…
Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ dmypy.json

# Test and spec generated
reports/
aviary/reports/
*.openmdao_out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to make sure you know about the openmdao clean command, for cleaning up all of these directories.
https://openmdao.org/newdocs/versions/latest/other_useful_docs/om_command.html#openmdao-clean

*.out
*.png
*.sql
Expand Down
2 changes: 1 addition & 1 deletion aviary/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.4-dev"
__version__ = "0.9.6"
4 changes: 2 additions & 2 deletions aviary/docs/examples/intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "latest_env",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -67,7 +67,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions aviary/docs/examples/modified_aircraft.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ aircraft:canard:aspect_ratio,0.0,unitless
aircraft:canard:thickness_to_chord,0.0,unitless
aircraft:crew_and_payload:baggage_mass_per_passenger,45.0,lbm
aircraft:crew_and_payload:cargo_container_mass_scaler,1.0,unitless
aircraft:crew_and_payload:design:num_business_class,0,unitless
aircraft:crew_and_payload:design:num_first_class,11,unitless
aircraft:crew_and_payload:design:num_passengers,169,unitless
aircraft:crew_and_payload:design:num_tourist_class,158,unitless
aircraft:crew_and_payload:flight_crew_mass_scaler,1.0,unitless
aircraft:crew_and_payload:mass_per_passenger,180.0,lbm
aircraft:crew_and_payload:misc_cargo,0.0,lbm
aircraft:crew_and_payload:non_flight_crew_mass_scaler,1.0,unitless
aircraft:crew_and_payload:num_business_class,0,unitless
aircraft:crew_and_payload:num_first_class,11,unitless
aircraft:crew_and_payload:num_flight_attendants,3,unitless
aircraft:crew_and_payload:num_flight_crew,2,unitless
aircraft:crew_and_payload:num_galley_crew,0,unitless
aircraft:crew_and_payload:num_passengers,169,unitless
aircraft:crew_and_payload:num_tourist_class,158,unitless
aircraft:crew_and_payload:passenger_service_mass_scaler,1.0,unitless
aircraft:crew_and_payload:wing_cargo,0.0,lbm
aircraft:design:base_area,0.0,ft**2
Expand Down
23 changes: 21 additions & 2 deletions aviary/docs/examples/outputted_phase_info.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
phase_info = {'pre_mission': {'include_takeoff': True, 'optimize_mass': True}, 'climb_1': {'subsystem_options': {'core_aerodynamics': {'method': 'computed'}}, 'user_options': {'optimize_mach': True, 'optimize_altitude': True, 'polynomial_control_order': [1, 2], 'use_polynomial_control': True, 'num_segments': [1], 'order': 1, 'solve_for_distance': True, 'initial_mach': (1, None), 'final_mach': (2, None), 'mach_bounds': (
(0.98, 2.02), None), 'initial_altitude': (1, None), 'final_altitude': (2, None), 'altitude_bounds': ((0.0, 502), None), 'throttle_enforcement': 'path_constraint', 'fix_initial': True, 'constrain_final': True, 'fix_duration': False, 'initial_bounds': ((0.0, 0.0), None), 'duration_bounds': ((0.5, 1.5), None)}, 'initial_guesses': {'time': ([1, 1], None)}}, 'post_mission': {'include_landing': True, 'constrain_range': True, 'target_range': (514.5, None)}}
phase_info = {
'pre_mission': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is proving to be a problem. I think we need it for some glue stuff, but it is auto-generated, so always has to be fixed every time we run the docs.

'include_takeoff': True, 'optimize_mass': True}, 'climb_1': {
'subsystem_options': {
'core_aerodynamics': {
'method': 'computed'}}, 'user_options': {
'optimize_mach': True, 'optimize_altitude': True, 'polynomial_control_order': [
1, 2], 'use_polynomial_control': True, 'num_segments': [1], 'order': 1, 'solve_for_distance': True, 'initial_mach': (
1, None), 'final_mach': (
2, None), 'mach_bounds': (
(0.98, 2.02), None), 'initial_altitude': (
1, None), 'final_altitude': (
2, None), 'altitude_bounds': (
(0.0, 502), None), 'throttle_enforcement': 'path_constraint', 'fix_initial': True, 'constrain_final': True, 'fix_duration': False, 'initial_bounds': (
(0.0, 0.0), None), 'duration_bounds': (
(0.5, 1.5), None)}, 'initial_guesses': {
'time': (
[
1, 1], None)}}, 'post_mission': {
'include_landing': True, 'constrain_range': True, 'target_range': (
514.5, None)}}
4 changes: 2 additions & 2 deletions aviary/docs/getting_started/input_csv_phase_info.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
" - {glue:md}`include_landing`: the flag to indicate whether there is a landing phase.\n",
" - {glue:md}`include_takeoff`: the flag to indicate whether there is a takeoff phase.\n",
" - {glue:md}`optimize_mass`: if True, the gross takeoff mass of the aircraft is a design variable.\n",
" - {glue:md}`target_mach`: the flag to indicate whether to target mach number.\n",
" - {glue:md}`target_mach`: the flag to indicate whether to target Mach number.\n",
"- {glue:md}`initial_guesses`: initial guesses of state variables.\n",
"- `COLLOCATION` related keys:\n",
" - {glue:md}`num_segments`: the number of segments in transcription creation in Dymos. The minimum value is 1. This is needed if 'AnalysisScheme' is `COLLOCATION`.\n",
Expand All @@ -223,7 +223,7 @@
" - {glue:md}`EAS_target`: the target equivalent airspeed.\n",
" - {glue:md}`initial_mach`: initial Mach number.\n",
" - {glue:md}`linear_solver`: provide an instance of a [LinearSolver](https://openmdao.org/newdocs/versions/latest/features/core_features/controlling_solver_behavior/set_solvers.html) to the phase. <!-- looks like this is only supported for pre_mission -->\n",
" - {glue:md}`mach_cruise`: the cruise mach number.\n",
" - {glue:md}`mach_cruise`: the cruise Mach number.\n",
" - {glue:md}`nonlinear_solver`: provide an instance of a [NonlinearSolver](https://openmdao.org/newdocs/versions/latest/features/core_features/controlling_solver_behavior/set_solvers.html) to the phase. <!-- looks like this is only supported for pre_mission -->\n",
" - {glue:md}`polynomial_control_order`: default to `None`.\n",
" - {glue:md}`fix_duration`: default to `False`.\n",
Expand Down
59 changes: 9 additions & 50 deletions aviary/docs/getting_started/onboarding_level1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
"\n",
"- `-o ––outdir`: Use specified directory to write output. The default is the current directory.\n",
"\n",
"- `--optimizer`: Name of optimizer. Choices are: `SNOPT`, `IPOPT`, `SLSQP`, and `None`. The default is `SNOPT`. If optimizer is `None`, it will be set to `IPOPT` or `SNOPT` depending on the analysis scheme. The optimization objective is fuel burn for level 1 runs. The objective is\n",
" - `mission:objectives:fuel` if `mission_method` is `GASP` \n",
" - `fuel_burned` if `mission_method` is `FLOPS`.\n",
"- `--optimizer`: Name of optimizer. Choices are: `SNOPT`, `IPOPT`, `SLSQP`. The default is `IPOPT`. The optimization objective is fuel burn for level 1 runs. The objective is\n",
" - `mission:objectives:fuel` if `mission_method` is `TWO_DEGREES_OF_FREEDOM` \n",
" - `fuel_burned` if `mission_method` is `HEIGHT_ENERGY`.\n",
"\n",
"- `--phase_info`: Path to phase info file. If not provided, it is `default_phase_info/gasp.py` if Mission origin is `2DOF` and `default_phase_info/flops.py` for `simple`.\n",
"\n",
Expand Down Expand Up @@ -223,50 +223,9 @@
"\n",
"To find information about a variable (e.g. description, data type, etc.), users should read the [Variable Metadata Doc](../user_guide/variable_metadata).\n",
"\n",
"There are special rules for the mapping from the input file variable names to the metadata. For example, variable `aircraft:wing:aspect_ratio` in `aircraft_for_bench_GwGm.csv` is mapped to `Aircraft.Wing.ASPECT_RATIO` in `aviary/variable_info/variable_meta_data.py`. So, the first part (e.g., `aircraft` or `mission`) is mapped to the same word but with the first letter capitalized (e.g., `Aircraft` or `Mission`). The third word is all caps (e.g., `ASPECT_RATIO`). The middle part (e.g., `wing`) is a little more complicated. In most cases, this part capitalizes the first letter (e.g., `Wing`). The following words have special mappings:\n",
"Variable names may be differently within the code from how they are formatted inside OpenMDAO components and in input files and outputs. For example, variable `aircraft:wing:aspect_ratio` in `aircraft_for_bench_GwGm.csv` is mapped to `Aircraft.Wing.ASPECT_RATIO` in `aviary/variable_info/variable_meta_data.py`. This is because OpenMDAO requires variable names to be strings, but for developer convenience those strings are mapped to Python classes and attributes. The top-level and sub-categories have capitalized first letters, and the final variable name is always in all-caps. For more information on Aviary's variable hierarchy, see the [Variable Hierarchy doc](../user_guide/variable_hierarchy.ipynb).\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wording : "may be differently..." --> "may appear differently..."

"\n",
"- `air_conditioning -> AirConditioning`\n",
"- `anti_icing -> AntiIcing`\n",
"- `blended_wing_body -> BWB`\n",
"- `crew_and_payload -> CrewPayload`\n",
"- `horizontal_tail -> HorizontalTail`\n",
"- `landing_gear -> LandingGear`\n",
"- `tail_boom -> TailBoom`\n",
"- `vertical_tail -> VerticalTail`\n",
"\n",
"This can be summarized as to capitalize the leading letter and to capitalize the first letter after special character “`_`”.\n",
"\n",
"File `aviary/variable_info/variables.py` is a variable hierarchy that is for a single mission. Each mission gets a copy of this hierarchy. Below is a snippet of this file:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f57d6c96",
"metadata": {
"tags": [
"remove-input"
]
},
"outputs": [],
"source": [
"import aviary.api as av\n",
"\n",
"# Get the path of variables.py within the aviary package\n",
"file_path = av.get_path('variable_info/variables.py')\n",
"\n",
"# Read and print the first 15 lines of the file\n",
"with open(file_path, 'r') as file:\n",
" for i in range(18):\n",
" print(file.readline().strip('\\n'))"
]
},
{
"cell_type": "markdown",
"id": "b597474e",
"metadata": {},
"source": [
"Aviary variables are always set to default values before the input file is read in. Then Aviary will update the values based on the user-provided `.csv` input file. If you want to set different values, you can set them in the `.csv` input file."
"Aviary variables that are not defined in the `.csv` input file are set to their default values, as described in the variable metadata."
]
},
{
Expand Down Expand Up @@ -329,14 +288,14 @@
"\n",
"This [`fortran_to_aviary`](../user_guide/aviary_commands) tool converts FORTRAN namelists into Aviary's csv based format using the mappings found in the `historical_name` section of the [variable_meta_data](../user_guide/variable_metadata). The resulting csv is automatically sorted into three sections:\n",
"1. **Input Values:**\n",
" Any FORTRAN variables that were mapped to input variables in Aviary components\n",
" Any FORTRAN variables that were mapped to input variables in the variable metadata, converted to their equivalent Aviary names\n",
"2. **Initial Guesses:**\n",
" Some variables are only used as initial guesses for the trajectory.\n",
" These are displayed separately from the Input Values because they will not be passed directly to components\n",
"3. **Unconverted Values:**\n",
" If the fortran_to_aviary converter can't find an Aviary variable that matches the FORTRAN variable, it is added to the end of the csv file.\n",
" We recommend that you check this section after converting a namelist to ensure that there aren't any variables you expected to be converted here.\n",
" Many of these unconverted variables represent features or options that are not used in Aviary and can be safely ignored. Variables related to mission definition are important, but Aviary defines mission profiles in a significantly different way. Currently, the user must build a new [mission definition file](../examples/simple_mission_example) that recreates the mission.\n",
" Many of these unconverted variables represent features or options that are not used in Aviary and can be ignored. Variables related to mission definition are important, but Aviary defines mission profiles in a significantly different way. Currently, the user must build a new [mission definition file](../examples/simple_mission_example) that recreates the mission.\n",
" Aviary will ignore unconverted variables when loading the csv, so you can safely leave them.\n"
]
},
Expand Down Expand Up @@ -764,7 +723,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -778,7 +737,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions aviary/docs/getting_started/onboarding_level2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "latest_env",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -1020,7 +1020,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
5 changes: 0 additions & 5 deletions aviary/docs/misc_resources/planned_future_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
Aviary is under active development and new features are being added regularly.
The following is a non-exhaustive list of planned features that are not yet implemented. (The Aviary team reserves the right to remove features from this list if the need arises. This list is provided for informational purposes only and is not a commitment to perform work.)

- The ability to run off-design missions to develop payload-range diagrams
- The full capabilities of FLOPS and GASP to model medium and large sized commercial aircraft, with a few exceptions that have been determined unnecessary
- The tested ability to have different types of engines on the same aircraft
- The ability to accept propeller maps for modeling propeller-driven aircraft
- A converter to convert a table of mach/altitude combinations into a phase_info file. This capability exists in the simple mission GUI, but it will be tweaked to allow for the direct input of tabular data as an alternative to the GUI
- Natively supported builders for certain high-interest external subsystem tools. Some potential tools to support are: NPSS, pyCycle, OpenVSP, VSPaero, OpenAeroStruct, etc. The Aviary team develops these builders as the need arises, and the development or lack of it for a certain tool does not indicate endorsement of the tool.
- Improved cleanliness of the code
- Improved ease-of-use for the user interface
- Improved Fortran-to-Aviary converter which requires no human intervention or checking
- Support for relevant FAA regulations governing aircraft design and operation
- Capability to fly reserve missions using the same mission analysis techniques as the main mission (right now reserve estimates are fixed values or fixed percentages of mission fuel)
- Improved model re-run capability
- Full test suite that tests the code format, including testing for docstrings on all functions and classes
- Fully tested code blocks in the documentation
14 changes: 13 additions & 1 deletion aviary/docs/user_guide/aerodynamics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -160,7 +172,7 @@
"\n",
"You can also use GASP-based aero with the height-energy mission by using the `solved_alpha` method.\n",
"\n",
"Gasp-based drag polars have 3 inputs: altitude, mach number, and angle of attack. Since the height-energy equations of motion do not incorporate angle of attack, `solved_alpha` creates an computational group with a solver that varies the angle of attack until the interpolated lift matches the weight force on the aircraft. The format for the table in the file is the same as for GASP-based aerodynamics used with the 2-DOF mission.\n",
"Gasp-based drag polars have 3 inputs: altitude, Mach number, and angle of attack. Since the height-energy equations of motion do not incorporate angle of attack, `solved_alpha` creates an computational group with a solver that varies the angle of attack until the interpolated lift matches the weight force on the aircraft. The format for the table in the file is the same as for GASP-based aerodynamics used with the 2-DOF mission.\n",
"\n",
"## Externally Computed Polars\n",
"\n",
Expand Down
7 changes: 3 additions & 4 deletions aviary/docs/user_guide/aviary_commands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@
"metadata": {},
"source": [
"`input_deck` is the path to vehicle input deck .csv file.\n",
"`-o` or `--outdir` is the directory to write outputs. The default is current directory.\n",
"`--optimizer` is the name of the optimizer. The default is `SNOPT`.\n",
"`--optimizer` is the name of the optimizer. The default is `IPOPT`.\n",
"`--shooting` indicates that the integration method is shooting method instead of collocation scheme. The default is collocation.\n",
"`--phase_info` is the path to phase info file. If it is missing, it depends on the integration method (collocation or shooting) and on the mission method (settings:equations+of_motion with value of `2DOF` or `height_energy`) which is defined in the .csv input file.\n",
"`--max_iter` is the maximum number of iterations. The default is 50.\n",
Expand Down Expand Up @@ -558,7 +557,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "latest_env",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -572,7 +571,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions aviary/docs/user_guide/external_aero.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"\n",
"This example shows how to build, using the level-2 interface, an aviary model that includes an external susbsystem that computes a lift and drag polar and passes them into the mission aerodynamics for a 3-phase mission (climb, cruise, descent). During the mission, Aviary will interpolate on the computed polars to compute actual lift and drag for a given flight condition.\n",
"\n",
"We start with the assumption that we have an external component called `ExternalAero` that can compute the lift and drag at any given altitude, mach number, and angle of attack. The details of such a component may be highly complicated and not important for the purposes of this example. We will be using a structured grid, which assumes the data table is regularly spaced in all dimensions. We want to compute lift and drag over a grid of altitudes (in 'ft'), mach numbers, and angles of attack given by:"
"We start with the assumption that we have an external component called `ExternalAero` that can compute the lift and drag at any given altitude, Mach number, and angle of attack. The details of such a component may be highly complicated and not important for the purposes of this example. We will be using a structured grid, which assumes the data table is regularly spaced in all dimensions. We want to compute lift and drag over a grid of altitudes (in 'ft'), Mach numbers, and angles of attack given by:"
]
},
{
Expand Down Expand Up @@ -62,7 +62,7 @@
" self.options.declare(\"altitude\", default=None, allow_none=True,\n",
" desc=\"List of altitudes in ascending order.\")\n",
" self.options.declare(\"mach\", default=None, allow_none=True,\n",
" desc=\"List of mach numbers in ascending order.\")\n",
" desc=\"List of Mach numbers in ascending order.\")\n",
" self.options.declare(\"angle_of_attack\", default=None, allow_none=True,\n",
" desc=\"List of angles of attack in ascending order.\")\n",
"\n",
Expand Down
Loading
Loading