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

Glue Variables in User_Guide #615

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7374d1a
glue variables in off_design_missions.ipynb
xjjiang Nov 28, 2024
a57e8c2
update how_to_contribute_docs.md
xjjiang Nov 28, 2024
202d3e4
update how_to_contribute_docs.md
xjjiang Nov 28, 2024
361523f
glue variables in docs/user_guide/mass.ipynb
xjjiang Nov 29, 2024
d56e7af
add glue in aerodynamics.ipynb
xjjiang Nov 30, 2024
5aead60
add glue in aviary_commands.ipynb
xjjiang Nov 30, 2024
2f081f7
minor update
xjjiang Nov 30, 2024
a8f9c8b
update docstring
xjjiang Nov 30, 2024
cabf87a
format aviary command options source code
xjjiang Dec 3, 2024
61c2389
add glue to aviary_commands.ipynb
xjjiang Dec 3, 2024
ff462c0
Merge branch 'OpenMDAO:main' into glue_user_guide
xjjiang Dec 3, 2024
9073067
Merge branch 'OpenMDAO:main' into glue_user_guide
xjjiang Dec 5, 2024
2d16a94
format _setup_level1_parser in methods_for_level1.py
xjjiang Dec 5, 2024
ecc22dc
autopep8
xjjiang Dec 5, 2024
1829237
minor
xjjiang Dec 5, 2024
610e082
Merge branch 'OpenMDAO:main' into glue_user_guide
xjjiang Dec 6, 2024
ff90a0a
Merge branch 'OpenMDAO:main' into glue_user_guide
xjjiang Dec 6, 2024
b13d7ba
Merge branch 'OpenMDAO:main' into glue_user_guide
xjjiang Dec 6, 2024
4167a08
move aviary hangar to the end of aviary_commands.ipynb because it cau…
xjjiang Dec 7, 2024
968a62d
glue variables in battery_subsystem_example.ipynb
xjjiang Dec 7, 2024
1c37f92
glue variables in drawing_and_running_simple_missions.ipynb
xjjiang Dec 9, 2024
439a61d
glue variables in drawing_and_running_simple_missions.ipynb and examp…
xjjiang Dec 9, 2024
e291aa2
glue variables in external_aero.ipynb
xjjiang Dec 9, 2024
af117c7
add glue variables to features_and_functionalities.ipynb
xjjiang Dec 10, 2024
028f229
minor update
xjjiang Dec 10, 2024
f794777
glue variables in FLOPS_based_detailed_takeoff_and_landing.ipynb
xjjiang Dec 10, 2024
e779ba0
glue variables in hamilton_standard.ipynb
xjjiang Dec 10, 2024
01cf911
glue variables in input_files.ipynb
xjjiang Dec 10, 2024
0e93159
glue variables in postprocessing_and_visualizing_results.ipynb
xjjiang Dec 11, 2024
30c6d3b
work in progress
xjjiang Dec 11, 2024
b30e556
glue variables in propulsion.ipynb
xjjiang Dec 12, 2024
46191d2
remove a print statement
xjjiang Dec 12, 2024
d049174
glue variables in reserve_missions.ipynb
xjjiang Dec 12, 2024
7c8a7d7
glue variables in SGM_capabilities.ipynb
xjjiang Dec 12, 2024
5e05674
glue variables in step_by_step_external_guide.ipynb
xjjiang Dec 13, 2024
fb5d88a
minor update to step_by_step_external_guide.ipynb
xjjiang Dec 13, 2024
a0e151f
remove outputs
xjjiang Dec 13, 2024
677f206
minor updates
xjjiang Dec 13, 2024
7e8d414
glue variables in variable_hierarchy.ipynb and variable_metadata.ipynb
xjjiang Dec 14, 2024
8842366
glue variables in overriding.ipynb
xjjiang Dec 14, 2024
75a5453
glue variables in externally_supported_subsystems.ipynb and modeling_…
xjjiang Dec 14, 2024
570f05a
move get_class_names() and get_function_names() to doctape.py
xjjiang Dec 16, 2024
1ce5e76
move get_class_names() and get_function_names() to doctape.py
xjjiang Dec 16, 2024
ba1f04e
polish glue task
xjjiang Dec 17, 2024
ca176dd
further polish
xjjiang Dec 17, 2024
bd52c14
Merge branch 'OpenMDAO:main' into glue_user_guide
xjjiang Dec 17, 2024
b7278ac
autopep8
xjjiang Dec 17, 2024
ce353c8
docpage update
xjjiang Dec 17, 2024
cc1eb0f
add two utility functions: get_class_names and get_function_names
xjjiang Dec 17, 2024
5f26f69
Merge branch 'main' into glue_user_guide
xjjiang Dec 18, 2024
b97f574
rename Aircraft.Engine.COMPUTE_PROPELLER_INSTALLATION_LOSS to Aircraf…
xjjiang Dec 18, 2024
7354357
rename Aircraft.Engine.COMPUTE_INSTALLATION_LOSS to Aircraft.Engine.P…
xjjiang Dec 18, 2024
641371a
Update hamilton_standard.ipynb
xjjiang Dec 18, 2024
a029c94
Update hamilton_standard.ipynb
xjjiang Dec 18, 2024
37a44a7
Update hamilton_standard.ipynb
xjjiang Dec 18, 2024
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 aviary/docs/developer_guide/doctape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
" \"get_attribute_name\": \"gets the name of an object's attribute based on it's value\",\n",
" \"get_all_keys\": \"recursively get all of the keys from a dict of dicts\",\n",
" \"get_value\": \"recursively get a value from a dict of dicts\",\n",
" \"get_class_names\": \"gets all class names from a given file and return as a set\",\n",
" \"get_function_names\": \"gets all function names in a given file and return as a set\",\n",
"}\n",
"\n",
"doctape.check_value(imported_classes.keys(),custom_classes.keys())\n",
Expand Down
4 changes: 3 additions & 1 deletion aviary/docs/developer_guide/how_to_contribute_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
Doc pages can be added as `.ipynb` or `.md` files within the `aviary/docs` folder.
We're using [jupyter-book](https://jupyterbook.org/) for the docs, which is a well-documented and full-featured platform.
To build the docs, you'll need to install jupyter-book following [these instructions](https://jupyterbook.org/en/stable/start/overview.html).
Jupyter-book allows for arbitrary Jupyter notebook usage to intersperse code and documentation and it uses [MyST markdown](https://jupyterbook.org/en/stable/content/myst.html).
Jupyter-book allows for arbitrary Jupyter notebook usage to intersperse code and documentation and it uses [MyST markdown](https://jupyterbook.org/en/stable/content/myst.html).

Whenever a page contains code, it should be a Jupyter notebook. Otherwise, you can write it as markdown page. Note that if you run an optimiser in a Jupyter notebook, don't use `SNOPT` because it is not available in test run on Github. Also, if you plan to push a Jupyter notebook to the Aviary repository, make sure you run `reset_notebook` on that page.

To modify the docs, simply add a file to the repo within the docs folder.
You can then add it to the `docs/_toc.yml` file following the structure for the skeletal outline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"# Externally Supported Subsystems\n",
"\n",
"Aviary supports any generic subsystem that a user adds.\n",
"We include some examples within the Aviary repo within the `aviary/examples/external_subsystems` folder."
"We include some examples within the Aviary repo within the {glue:md}`aviary/examples/external_subsystems` folder."
]
},
{
Expand All @@ -22,7 +22,9 @@
"source": [
"# Testing Cell\n",
"import aviary.api as av\n",
"av.get_path('examples/external_subsystems')"
"from aviary.utils.doctape import glue_variable\n",
"av.get_path('examples/external_subsystems')\n",
"glue_variable('aviary/examples/external_subsystems', md_code=True)"
]
}
],
Expand Down
44 changes: 35 additions & 9 deletions aviary/docs/misc_resources/modeling_exercise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"\n",
"## Task 1: Run a basic Aviary script\n",
"\n",
"Aviary ships with multiple examples in the `aviary/examples` directory.\n",
"The most basic, `run_basic_aviary_example.py`, [(available here)](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/run_basic_aviary_example.py) is our first starting point.\n",
"Aviary ships with multiple examples in the {glue:md}`aviary/examples` directory.\n",
"The most basic, {glue:md}`run_basic_aviary_example.py`, [(available here)](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/run_basic_aviary_example.py) is our first starting point.\n",
"Run this script in your terminal."
]
},
Expand All @@ -37,7 +37,10 @@
"source": [
"# Testing Cell\n",
"import aviary.api as av\n",
"av.get_path('examples/run_basic_aviary_example.py')"
"from aviary.utils.doctape import glue_variable\n",
"av.get_path('examples/run_basic_aviary_example.py')\n",
"glue_variable('aviary/examples', md_code=True)\n",
"glue_variable('run_basic_aviary_example.py', md_code=True)"
]
},
{
Expand Down Expand Up @@ -76,6 +79,27 @@
"_command_map['dashboard'];"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"# Testing Cell\n",
"from aviary.interface.methods_for_level2 import AviaryGroup\n",
"from aviary.utils.doctape import glue_variable\n",
"\n",
"ag = AviaryGroup()\n",
"opts = list(ag.options)\n",
"for opt in opts:\n",
" if opt == 'phase_info':\n",
" glue_variable('phase_info', md_code=True)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -88,10 +112,10 @@
"The next step is to run an Aviary case with a mission profile that you define.\n",
"Please follow the [instructions in this example doc](../examples/simple_mission_example) to create a custom mission profile.\n",
"Once you have created your custom mission profile, run the Aviary case following the instructions in the example doc.\n",
"If you are not able to successfully create a custom `phase_info` object to define the mission, please use the default one defined in the example.\n",
"If you are not able to successfully create a custom {glue:md}`phase_info` object to define the mission, please use the default one defined in the example.\n",
"\n",
"```{note}\n",
"The survey will ask you to provide a copy of the `phase_info` object you create, so please save this information for later.\n",
"The survey will ask you to provide a copy of the {glue:md}`phase_info` object you create, so please save this information for later.\n",
"```\n",
"\n",
"Again open the Aviary dashboard and visually examine the results by running the following command in your terminal:\n",
Expand All @@ -103,7 +127,7 @@
"## Task 3: Run a mission with a reserve phase\n",
"\n",
"Aviary has the capability to run a mission with a reserve phase as [detailed in the docs here](https://openmdao.github.io/Aviary/examples/reserve_missions.html).\n",
"The included example, `run_reserve_mission_fixedrange.py`, [(available here)](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/reserve_missions/run_reserve_mission_fixedrange.py) demonstrates how to run a mission with a reserve phase.\n",
"The included example, {glue:md}`run_reserve_mission_fixedrange.py`, [(available here)](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/reserve_missions/run_reserve_mission_fixedrange.py) demonstrates how to run a mission with a reserve phase.\n",
"Please copy the contents of this file into a new Python script."
]
},
Expand All @@ -119,7 +143,9 @@
"source": [
"# Testing Cell\n",
"import aviary.api as av\n",
"av.get_path('examples/reserve_missions/run_reserve_mission_fixedrange.py');"
"from aviary.utils.doctape import glue_variable\n",
"av.get_path('examples/reserve_missions/run_reserve_mission_fixedrange.py');\n",
"glue_variable('run_reserve_mission_fixedrange.py', md_code=True)"
]
},
{
Expand All @@ -141,7 +167,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "latest_env",
"display_name": "av1",
"language": "python",
"name": "python3"
},
Expand All @@ -155,7 +181,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
Loading
Loading