Skip to content

Commit

Permalink
glue variables in externally_supported_subsystems.ipynb and modeling_…
Browse files Browse the repository at this point in the history
…exercise.ipynb
  • Loading branch information
xjjiang committed Dec 14, 2024
1 parent 8842366 commit 75a5453
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
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

0 comments on commit 75a5453

Please sign in to comment.