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 getting started and theory guide #609

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
9445d62
minor modifications while reading
xjjiang Oct 30, 2024
8ba77b6
update for Python 3.9 compatibility
xjjiang Oct 30, 2024
469a99f
minor update
xjjiang Oct 31, 2024
f6d82fd
minor comment update
xjjiang Nov 1, 2024
0506dd7
Carl's update
xjjiang Nov 1, 2024
f49cce5
update Carl's change.
xjjiang Nov 1, 2024
9adf4de
update MD cells
xjjiang Nov 1, 2024
185483c
add some comments.
xjjiang Nov 1, 2024
82aa37d
update Carl's changes.
xjjiang Nov 1, 2024
47bc209
update Carl's changes.
xjjiang Nov 1, 2024
13ff84c
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 1, 2024
7f044dd
minor update
xjjiang Nov 1, 2024
0701153
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 2, 2024
68bbb32
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 4, 2024
cd4ddd1
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 4, 2024
022c58c
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 4, 2024
53baac4
minor update
xjjiang Nov 5, 2024
f18c32a
keep consistent with Carl's original
xjjiang Nov 5, 2024
df1eed9
add a comment
xjjiang Nov 5, 2024
efaa636
add a comment
xjjiang Nov 5, 2024
a863c6e
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 5, 2024
b8df5d5
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 5, 2024
3b87cc2
add comment to input_csv_phase_info.ipynb
xjjiang Nov 5, 2024
6efc627
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 6, 2024
178f2b0
add a comment to additional_flight_phases.ipynb
xjjiang Nov 6, 2024
d33b5ea
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 6, 2024
f0ecc29
add a comment
xjjiang Nov 6, 2024
4a5f289
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 6, 2024
a534b1b
minor changes to doctape.ipynb and doctape_examples.ipynb
xjjiang Nov 9, 2024
71ba6ee
Merge branch 'try-glue2' into try_glue2_rest
xjjiang Nov 9, 2024
fc75a3a
add settings:verbosity,1 to aircraft_for_bench_GwGm.csv
xjjiang Nov 14, 2024
f041392
reformat expected_flow
xjjiang Nov 14, 2024
d520f85
reformat doctape_examples.ipynb
xjjiang Nov 14, 2024
23d386b
update screenshots
xjjiang Nov 19, 2024
cdc22a6
fixed a couple of broken links
xjjiang Nov 19, 2024
9fc77f4
Merge branch 'main' into try_glue2_rest
xjjiang Nov 19, 2024
8772c1a
Merge branch 'main' into try_glue2_rest
xjjiang Nov 19, 2024
db06f1a
done glue in onboarding_level1.ipynb
xjjiang Nov 19, 2024
07c2431
roll back
xjjiang Nov 19, 2024
8bc7773
add tag 'raises-exception'
xjjiang Nov 19, 2024
3ac2852
add comments
xjjiang Nov 19, 2024
7ab9d41
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Nov 20, 2024
b959def
Merge branch 'glue_getting_started' of github.com:xjjiang/om-Aviary i…
xjjiang Nov 20, 2024
817f2f2
glue variables in onboarding_level2.ipynb
xjjiang Nov 25, 2024
241fa89
fixed an error
xjjiang Nov 25, 2024
67762df
glue variables in onboarding_level3.ipynb
xjjiang Nov 25, 2024
e59440d
glue variables in onboarding_level3.ipynb
xjjiang Nov 26, 2024
2b8b7ab
run reset_notebook
xjjiang Nov 26, 2024
f213f32
work in progress
xjjiang Nov 26, 2024
47cfbb9
fix a bug.
xjjiang Nov 26, 2024
104ac68
fix a bug
xjjiang Nov 26, 2024
82b1650
testing
xjjiang Nov 26, 2024
d4d626f
remove testing file
xjjiang Nov 26, 2024
4394217
replace SNOPT by IPOPT
xjjiang Nov 26, 2024
c719f69
remove empty cells
xjjiang Nov 26, 2024
282e1c3
make changes based on feedback from Carl
xjjiang Nov 26, 2024
441c645
bug fixes
xjjiang Nov 27, 2024
e106b37
fix bug.
xjjiang Nov 27, 2024
c6a2eca
bug fix
xjjiang Nov 27, 2024
08445c0
glue variables
xjjiang Nov 27, 2024
14825ac
remove display=True. replace double quote by single quote
xjjiang Nov 27, 2024
9045ad7
minor update
xjjiang Nov 27, 2024
e514fed
glue variables in docs/theory_guide/building_metadata_syntax.ipynb
xjjiang Nov 29, 2024
38317dc
update subsystems.ipynb to mach with main
xjjiang Dec 3, 2024
c23e5fc
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 3, 2024
fdcdbee
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 5, 2024
ec2f8e3
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 6, 2024
aa3151e
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 6, 2024
ef3796b
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 6, 2024
279e371
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 17, 2024
91ded8c
polish glue task
xjjiang Dec 18, 2024
be7505c
Merge branch 'main' into glue_getting_started
xjjiang Dec 18, 2024
3bce1a4
rename Dynamic.Mission.Mass to Dynamic.Vehicle.Mass
xjjiang Dec 18, 2024
1abeba7
Update onboarding_level3.ipynb
xjjiang Dec 18, 2024
2c1ca52
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Dec 31, 2024
d8be7b5
Merge branch 'main' into glue_getting_started
xjjiang Jan 7, 2025
f009e7e
Merge branch 'OpenMDAO:main' into glue_getting_started
xjjiang Jan 9, 2025
0caf161
Merge branch 'main' into glue_getting_started
xjjiang Jan 14, 2025
acebb0c
remove temp code that is commnented out.
xjjiang Jan 15, 2025
6b3b6c3
modify jupyter notebooks based on Carl's comments.
xjjiang Jan 16, 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
1 change: 1 addition & 0 deletions aviary/docs/developer_guide/codebase_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"\n",
"folder = get_path('docs').parent\n",
"subfolders = [ f.name for f in os.scandir(folder) ]\n",
"# if a key in structure dictionary is not an actual folder name, this run fails.\n",
"check_contains(structure, subfolders)"
]
}
Expand Down
16 changes: 8 additions & 8 deletions aviary/docs/developer_guide/coding_standards.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"| `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",
"Verbosity levels are defined in Aviary using the {glue:md}`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 the 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."
"It is preferred that within source code, the full Enums are used for better readability (e.g. {glue:md}`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). An example of this is: *options.set_val(Settings.VERBOSITY, 0)* instead of *options.set_val(Settings.VERBOSITY, Verbosity.QUIET)*. Of course, it is always acceptable to use the full Enum in these cases for the same readability reasons."
]
},
{
Expand Down Expand Up @@ -96,7 +96,7 @@
"5. Be formatted in \"[snake case](https://en.wikipedia.org/wiki/Snake_case)\", or all lowercase with underscore-delineated words (such as *example_variable*)\n",
"\n",
"### Classes\n",
"Class names should be written in \"[CamelCase](https://en.wikipedia.org/wiki/Camel_case_)\", or naming with no delimiters such as dashes or underscores between words and each word beginning with a capital letter.\n",
"Class names should be written in \"[CamelCase](https://en.wikipedia.org/wiki/Camel_case)\", or naming with no delimiters such as dashes or underscores between words and each word beginning with a capital letter.\n",
"\n",
"### Functions and Methods\n",
"Function and method names, similar to variables, should be formatted in \"snake case\". Class methods that are not intended to be accessed outside of the class definition can append an underscore at the beginning of the method name to mark it as \"private\", to help other users avoid using those methods incorrectly. An example of this is:\n",
Expand All @@ -106,11 +106,11 @@
"\n",
"Autopep8 allows both absolute and relative paths in `import` statements. Aviary will use absolute path option only. Following autopep8, imports should be grouped in the following order:\n",
"\n",
" 1. Standard library imports.\n",
" 2. Related third party imports.\n",
" 3. Local application/library specific imports.\n",
" 1. Standard library imports (e.g. warnings, numpy).\n",
" 2. Related third party imports (e.g. openmdao.api).\n",
" 3. Local application/library specific imports (e.g. aviary.api).\n",
"\n",
"There should be a blank line between each group of imports.\n",
"The library names should be in alphabetic order in each group and there should be a blank line between each group of imports.\n",
"\n",
"## Code Re-Use and Utility Functions\n",
"If an identical block of code appears multiple times inside a file, consider moving it to a function to make your code cleaner. Repeated code bloats files and makes them less readable. If that function ends up being useful outside that individual file, move it to a \"utils.py\" file in the lowest-level directory shared by all files that need that function. If the utility function is useful across all of Aviary and is integral to the tool's operation, the aviary/utils folder is the appropriate place for it.\n"
Expand Down
19 changes: 16 additions & 3 deletions aviary/docs/developer_guide/doctape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"DocTAPE (Documentation Testing and Automated Placement of Expressions) is a collection of utility functions (and wrappers for [Glue](https://myst-nb.readthedocs.io/en/latest/render/glue.html)) that are useful\n",
"for automating the process of building and testing documentation to ensure that documentation doesn't get stale.\n",
"\n",
"Our standard practice it to include a comment (`# Testing Cell`) at the begining of code cells as well as make use of the `remove-cell` tag.\n",
"Our standard practice is to include a comment (`# Testing Cell`) at the beginning of code cells as well as make use of the `remove-cell` tag.\n",
"\n",
"> \"metadata\": { \"tags\": [ \"remove-cell\" ] },\n",
"\n",
Expand All @@ -33,6 +33,15 @@
"# Testing Cell\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This section is for writing Jupyter notebook in Aviary documentation only. You can skip it for now if you are focusing on the Aviary development.\n",
"\n",
"The Aviary documentation is composed of markdown files and jupyter notebook files. Generally speaking, if a document page contains data, it should be a jupyter notbook file. All glues live in jupyter notbook files."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -48,8 +57,8 @@
"from aviary.utils import doctape\n",
"import inspect\n",
"\n",
"imported_functions = {k:v for k,v in inspect.getmembers(doctape, inspect.isfunction) if v.__module__ == doctape.__name__}\n",
"imported_classes = {k:v for k,v in inspect.getmembers(doctape, inspect.isclass) if v.__module__ == doctape.__name__}\n",
"imported_functions = {k:v for k, v in inspect.getmembers(doctape, inspect.isfunction) if v.__module__ == doctape.__name__}\n",
"imported_classes = {k:v for k, v in inspect.getmembers(doctape, inspect.isclass) if v.__module__ == doctape.__name__}\n",
"\n",
"custom_classes = {\n",
" \"expected_error\": \"is an execption that can be used in try/except blocks to allow desired errors to pass while still raising unexpected errors.\",\n",
Expand All @@ -73,6 +82,7 @@
" \"get_value\": \"recursively get a value from a dict of dicts\",\n",
"}\n",
"\n",
"# make sure all classes and functions are listed here with descriptions.\n",
"doctape.check_value(imported_classes.keys(),custom_classes.keys())\n",
"doctape.check_value(imported_functions.keys(), {\n",
" **testing_functions, **glue_functions, **utility_functions}.keys())\n",
Expand All @@ -92,6 +102,9 @@
" utility_list += ' '*4+f'.. autofunction:: aviary.utils.doctape.{key}\\n{\" \"*8}:noindex:\\n\\n'\n",
"utility_list += '```'\n",
"\n",
"# with eval-rst directive, this will parse the content as ReStructuredText\n",
"# autofunction:: is code that tells jupyter to get the doc string for the function when it compiles\n",
"#\n",
"# testing_list = '```{eval-rst}\\n'\n",
"# for key in testing_functions:\n",
"# utils.glue_variable(key, md_code=True)\n",
Expand Down
23 changes: 12 additions & 11 deletions aviary/docs/developer_guide/doctape_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"from aviary.utils import doctape\n",
"import inspect\n",
"\n",
"imported_functions = {k for k,v in inspect.getmembers(doctape, inspect.isfunction) if v.__module__ == doctape.__name__}\n",
"imported_functions = {k for k, v in inspect.getmembers(doctape, inspect.isfunction) if v.__module__ == doctape.__name__}\n",
"# We prepare all function names for using in the current page (before or later)\n",
"for func in imported_functions:\n",
" doctape.glue_variable(func, md_code=True)\n",
"doctape.glue_variable(doctape.expected_error.__name__, md_code=True)"
Expand Down Expand Up @@ -113,7 +114,7 @@
"from aviary.examples.reserve_missions.run_reserve_mission_fixedrange import phase_info\n",
"\n",
"user_opts = phase_info['reserve_cruise']['user_options']\n",
"check_value(user_opts['target_distance'],(200, 'km'))\n",
"check_value(user_opts['target_distance'], (200, 'km'))\n",
"check_value(user_opts['reserve'],True)"
]
},
Expand Down Expand Up @@ -259,7 +260,7 @@
"### {glue:md}`glue_variable`\n",
"allows users to specify a value that is {glue:}`something different than` what is displayed, but defaults to using the name of the variable if nothing is specified. This makes adapting old documentation easier, because users can just wrap {glue:}`the entire phrase they want to replace`.\n",
"\n",
"Glued text can either be {glue:md}`plain text` or can be formatted as {glue:md}`inline code`\n"
"Glued text can either be {glue:md}`plain text` or can be formatted as {glue:md}`inline code`. Note that the variables in this context do not have the same naming restrictions as Python variables, they can contain spaces or start with a number.\n"
]
},
{
Expand Down Expand Up @@ -303,8 +304,8 @@
"from aviary.utils.doctape import glue_keys\n",
"\n",
"simplified_dict = {\n",
" 'phase1':{'altitude':{'val':30,'units':'kft'},'mach':.4},\n",
" 'phase2':{'altitude':{'val':10,'units':'km'},'mach':.5}\n",
" 'phase1': {'altitude': {'val':30, 'units': 'kft'}, 'mach':.4},\n",
" 'phase2': {'altitude': {'val':10, 'units': 'km'}, 'mach':.5}\n",
" }\n",
"glue_keys(simplified_dict)\n"
]
Expand Down Expand Up @@ -337,8 +338,8 @@
"from aviary.utils.doctape import gramatical_list\n",
"\n",
"single_element = gramatical_list([1])\n",
"two_elements = gramatical_list(['apples','bananas'])\n",
"three_elements_with_or = gramatical_list(['apples','bananas', 'strawberries'],'or')\n",
"two_elements = gramatical_list(['apples', 'bananas'])\n",
"three_elements_with_or = gramatical_list(['apples', 'bananas', 'strawberries'],'or')\n",
"\n",
"print(f\"I would like to order {single_element} smoothie.\")\n",
"print(f\"Do you want {three_elements_with_or} in your smoothie?\")\n",
Expand Down Expand Up @@ -426,7 +427,7 @@
"Using {glue:md}`var_value_code` will result in {glue:md}`value`, whereas using {glue:md}`var_name_code` will result in {glue:md}`Mission.Design.MACH`\n",
"\n",
"### {glue:md}`get_attribute_name`\n",
"allows users to get the name of object attributes in order to glue them into documentation. This works well for Enums or Class Variables that have unique values."
"allows users to get the name of object attributes in order to glue them into documentation. This works well for Enums or Class variables that have unique values."
]
},
{
Expand Down Expand Up @@ -471,8 +472,8 @@
"from aviary.utils.doctape import get_all_keys, get_value\n",
"\n",
"simplified_dict = {\n",
" 'phase1':{'altitude':{'val':30,'units':'kft'},'mach':.4},\n",
" 'phase2':{'altitude':{'val':10,'units':'km'},'mach':.5}\n",
" 'phase1': {'altitude': {'val': 30, 'units': 'kft'}, 'mach': .4},\n",
" 'phase2': {'altitude': {'val': 10, 'units': 'km'}, 'mach': .5}\n",
" }\n",
"unique_keys_only = get_all_keys(simplified_dict)\n",
"all_keys = get_all_keys(simplified_dict, track_layers=True)\n",
Expand Down Expand Up @@ -500,7 +501,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
5 changes: 3 additions & 2 deletions aviary/docs/examples/OAS_subsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"for key in o.options._dict:\n",
" options_list += f'- {key}\\n'\n",
"glue_variable('options_list', options_list, display=False)\n",
"# make all option keys available for later use (e.g. wing_weight_ratio below)\n",
"glue_keys(o.options._dict, display=False)\n",
"\n",
"inputs_list = ''\n",
Expand Down Expand Up @@ -218,12 +219,12 @@
"## Test Case\n",
"\n",
"A simple Aviary mission is defined to test the inclusion of the OpenAeroStruct wing weight subsystem during the pre-mission phase.\n",
"The test mission is defined in [run_simple_OAS_mission](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/external_subsystems/OAS/run_simple_OAS_mission.py) and is a mission based on input data read from the benchmark data file [aircraft_for_bench_FwFm](https://github.com/OpenMDAO/Aviary/blob/main/aviary/models/test_aircraft/aircraft_for_bench_FwFm.csv).\n",
"The test mission is defined in [run_simple_OAS_mission](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/external_subsystems/OAS_weight/run_simple_OAS_mission.py) and is a mission based on input data read from the benchmark data file [aircraft_for_bench_FwFm](https://github.com/OpenMDAO/Aviary/blob/main/aviary/models/test_aircraft/aircraft_for_bench_FwFm.csv).\n",
"\n",
"The OpenAeroStruct subsystem is used to compute an optimum wing mass which will override the Aviary computed wing mass value.\n",
"The value of the Aviary variable {glue:md}`Aircraft.Wing.MASS` is printed at the conclusion of the mission to verify that the wing weight from the subsystem is overriding the Aviary computed wing weight.\n",
"\n",
"A variable in the [run_simple_OAS_mission](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/external_subsystems/OAS/run_simple_OAS_mission.py) file named {glue:md}`use_OAS` may be set by the user to `True` or `False` to run the simple mission with or without the OpenAeroStruct subsystem included.\n",
"A variable in the [run_simple_OAS_mission](https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/external_subsystems/OAS_weight/run_simple_OAS_mission.py) file named {glue:md}`use_OAS` may be set by the user to `True` or `False` to run the simple mission with or without the OpenAeroStruct subsystem included.\n",
"This will allow the mission to be flown either using the Aviary empirical wing weight estimation ({glue:md}`use_OAS=False`) or with the OpenAeroStruct subsystem ({glue:md}`use_OAS=True`)."
]
},
Expand Down
1 change: 1 addition & 0 deletions aviary/docs/examples/additional_flight_phases.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"source": [
"# Testing Cell\n",
"from aviary.utils.doctape import glue_keys\n",
"# make all phase_info keys available for later use (e.g. optimize_mach and target_range below)\n",
"glue_keys(phase_info, display=False)\n"
]
},
Expand Down
Binary file modified aviary/docs/getting_started/images/N2_phases_links.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified aviary/docs/getting_started/images/N2_start.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified aviary/docs/getting_started/images/opt_report_top.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions aviary/docs/getting_started/input_csv_phase_info.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"from aviary.utils.doctape import glue_variable\n",
"\n",
"csv_snippet = '```\\n'\n",
"filename = 'aircraft_for_bench_FwFm.csv'\n",
"filename = 'aircraft_for_bench_FwGm.csv'\n",
"with open(get_model(filename)) as f_in:\n",
" lines = f_in.readlines()\n",
" l, s = [], 1\n",
" # pick up a few rows from the top and the bottom\n",
" for ii in range(7):\n",
" l.append(lines[ii*2*s])\n",
" s*=-1\n",
Expand Down Expand Up @@ -163,7 +164,8 @@
"custom_phase_info = {'pre_mission':pre_mission, 'solved_alpha':solved_alpha}\n",
"\n",
"dummy_phase_info = {}\n",
"dummy_phase_info.update(HE_phase_info)\n",
"# Build a dummy phase from a few default phases so that we have one phase_info with all of the unique keys.\n",
"dummy_phase_info.update(HE_phase_info) \n",
"dummy_phase_info.update(get_completed_phase_info('aircraft_for_bench_FwFm.csv'))\n",
"dummy_phase_info.update(custom_phase_info)\n",
"dummy_phase_info.update(get_completed_phase_info('aircraft_for_bench_FwFm.csv', custom_phase_info))\n",
Expand Down Expand Up @@ -243,7 +245,7 @@
"The `from_phase_info` method is used to convert the `phase_info` dictionary into the inputs needed for the phase builder object.\n",
"The `build_phase` method is used to actually build and output the `Phase` object.\n",
"\n",
"For examples of how to create a custom phase builder, see the `energy_phase.py` file.\n",
"For examples of how to create a custom phase builder, see the [energy_phase.py](../../mission/energy_phase.py) file.\n",
"\n",
"```{note}\n",
"Using custom phase builders is a particularly advanced feature and is not recommended for most users.\n",
Expand Down
Loading
Loading