Skip to content

Commit 87edebd

Browse files
authored
Fixed paths to code in docs (#443)
* Fixed paths to tests in docs * Fixed paths to tests in docs that use embed-code * Had to switch from embed-code to literalinclude since tests no longer in python package
1 parent 394f477 commit 87edebd

16 files changed

Lines changed: 57 additions & 33 deletions

openaerostruct/docs/advanced_features/aerostruct_ffd.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ This allows for more general design shape changes and helps sync up geometry cha
99
.. warning::
1010
This example requires `pyGeo`, an external code developed by the MDO Lab. You can install it from `here <https://github.com/mdolab/pygeo>`_.
1111

12-
.. embed-code::
13-
openaerostruct.tests.test_aerostruct_ffd.Test.test
12+
.. literalinclude:: /../../tests/integration_tests/test_aerostruct_ffd.py
13+
:start-after: docs checkpoint 0
14+
:end-before: docs checkpoint 1
15+
:dedent: 8

openaerostruct/docs/advanced_features/ground_effect.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ This means that configurations deep in ground effect (small altitude compared to
1717

1818
To enable ground effect, add a :code:`groundplane: True` attribute to your aerosurfaces, like so:
1919

20-
.. embed-code::
21-
openaerostruct.tests.test_aero_ground_effect.Test.test
20+
.. literalinclude:: /../../tests/integration_tests/test_aero_ground_effect.py
21+
:start-after: docs checkpoint 0
22+
:end-before: docs checkpoint 1
23+
:dedent: 8
2224

2325
If groundplane is turned on for an AeroPoint or AeroStructPoint, a new input will be created (height_agl) which represents the distance from the origin (in airplane coordinates) to the ground plane.
2426
The default value, 8000 meters, produces essentially zero ground effect.

openaerostruct/docs/advanced_features/multiple_surfaces.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Multiple Lifting Surfaces
66
It's easily possible to simulate multiple lifting surfaces simultaneously in OpenAeroStruct.
77
The most straightforward example is a wing and a tail for a conventional airplane, as shown below, though OpenAeroStruct can handle any arbitrary collection of lifting surfaces.
88

9-
.. embed-code::
10-
openaerostruct.tests.test_multiple_aero_analysis.Test.test
11-
:layout: interleave
9+
.. literalinclude:: /../../tests/integration_tests/test_multiple_aero_analysis.py
10+
:start-after: docs checkpoint 0
11+
:end-before: docs checkpoint 1
12+
:dedent: 8

openaerostruct/docs/advanced_features/multipoint.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Aerodynamic Optimization Example
1111
--------------------------------
1212
We optimize the aircraft at two cruise flight conditions below.
1313

14-
.. embed-code::
15-
openaerostruct.tests.test_multipoint_aero.Test.test
16-
:layout: interleave
14+
.. literalinclude:: /../../tests/integration_tests/test_multipoint_aero.py
15+
:start-after: docs checkpoint 0
16+
:end-before: docs checkpoint 1
17+
:dedent: 8
1718

1819

1920
Aerostructural Optimization Example (Q400)

openaerostruct/docs/advanced_features/multipoint_parallel.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Then, let's set up the problem in the same way as the serial runscript.
4343
4444
Next, we need to add AS_points under a ``ParallelGroup`` instead of directly under the ``prob.model``.
4545

46-
.. literalinclude:: ../../tests/test_multipoint_parallel.py
46+
.. literalinclude:: /../../tests/integration_tests/test_multipoint_parallel.py
4747
:dedent: 8
4848
:start-after: # [rst Setup ParallelGroup (beg)]
4949
:end-before: # [rst Setup ParallelGroup (end)]
@@ -55,7 +55,7 @@ Among 6 functions, 4 depend only on AS_point_0, and 2 depend only on AS_point_1.
5555
Therefore, we can form 2 pairs and perform linear solves in parallel.
5656
We specify ``parallel_deriv_color`` to tell OpenMDAO which function's derivatives can be solved for in parallel.
5757

58-
.. literalinclude:: ../../tests/test_multipoint_parallel.py
58+
.. literalinclude:: /../../tests/integration_tests/test_multipoint_parallel.py
5959
:dedent: 8
6060
:start-after: # [rst Parallel deriv color setup 1 (beg)]
6161
:end-before: # [rst Parallel deriv color setup 1 (end)]
@@ -64,15 +64,15 @@ Furthermore, we will add another dummy (nonsense) constraint to explain how para
6464
This dummy constraint (sum of the fuel burns from AS_point_0 and AS_point_1) depends on both AS points.
6565
In this case, the linear solves of AS_point_0 and AS_point_1 will be parallelized.
6666

67-
.. literalinclude:: ../../tests/test_multipoint_parallel.py
67+
.. literalinclude:: /../../tests/integration_tests/test_multipoint_parallel.py
6868
:dedent: 8
6969
:start-after: # [rst Parallel deriv color setup 2 (beg)]
7070
:end-before: # [rst Parallel deriv color setup 2 (end)]
7171

7272
Finally, let's change the linear solver from default.
7373
This step is not necessary and not directly relevant to parallelization, but the ``LinearBlockGS`` solver works better on a fine mesh than the default ``DirectSolver``.
7474

75-
.. literalinclude:: ../../tests/test_multipoint_parallel.py
75+
.. literalinclude:: /../../tests/integration_tests/test_multipoint_parallel.py
7676
:dedent: 8
7777
:start-after: # [rst Change linear solver (beg)]
7878
:end-before: # [rst Change linear solver (end)]
@@ -81,8 +81,10 @@ This step is not necessary and not directly relevant to parallelization, but the
8181
Complete runscript
8282
------------------
8383

84-
.. embed-code::
85-
openaerostruct.tests.test_multipoint_parallel.Test.test_multipoint_MPI
84+
.. literalinclude:: /../../tests/integration_tests/test_multipoint_parallel.py
85+
:start-after: docs checkpoint 0
86+
:end-before: docs checkpoint 1
87+
:dedent: 8
8688

8789
To run this example in parallel with two processors, use the following command:
8890

openaerostruct/docs/aerostructural_tube_walkthrough.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Additionally, we have more variable connections due to the more complex problem
1010

1111
For more details about ``mesh_dict`` and ``surface`` in the following script, see :ref:`Mesh and Surface Dict`.
1212

13-
.. embed-code::
14-
openaerostruct.tests.test_aerostruct.Test.test
15-
:layout: interleave
13+
.. literalinclude:: /../../tests/integration_tests/test_aerostruct.py
14+
:start-after: docs checkpoint 0
15+
:end-before: docs checkpoint 1
16+
:dedent: 8

openaerostruct/docs/quick_example.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Quick Example
66
Here is an example run script to perform aerodynamic optimization.
77
We'll go into more detail later about how to set up a model, define the optimization problem, and postprocess results.
88

9-
.. embed-code::
10-
openaerostruct.tests.test_aero.Test.test
11-
:layout: interleave
12-
9+
.. literalinclude:: /../../tests/integration_tests/test_aero.py
10+
:start-after: docs checkpoint 0
11+
:end-before: docs checkpoint 1
12+
:dedent: 8

openaerostruct/docs/struct_example.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Although doing structural-only optimizations is relatively rare, this is a build
99

1010
For more details about ``mesh_dict`` and ``surf_dict`` in the following script, see :ref:`Mesh and Surface Dict`.
1111

12-
.. embed-code::
13-
openaerostruct.tests.test_struct.Test.test
14-
:layout: interleave
12+
.. literalinclude:: /../../tests/integration_tests/test_struct.py
13+
:start-after: docs checkpoint 0
14+
:end-before: docs checkpoint 1
15+
:dedent: 8

openaerostruct/docs/user_reference/v1_v2_conversion.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ v1 Script
3838
v2 Script
3939
^^^^^^^^^
4040

41-
.. literalinclude:: /../tests/test_v1_aero_opt.py
41+
.. literalinclude:: /../../tests/integration_tests/test_v1_aero_opt.py
4242
:start-after: checkpoint 0
4343
:end-before: checkpoint 1
4444
:dedent: 8
@@ -64,7 +64,7 @@ v1 Script
6464
v2 Script
6565
^^^^^^^^^
6666

67-
.. literalinclude:: /../tests/test_v1_aero_opt.py
67+
.. literalinclude:: /../../tests/integration_tests/test_v1_aero_opt.py
6868
:start-after: checkpoint 2
6969
:end-before: checkpoint 3
7070
:dedent: 8
@@ -92,7 +92,7 @@ v1 Script
9292
v2 Script
9393
^^^^^^^^^
9494

95-
.. literalinclude:: /../tests/test_v1_aero_opt.py
95+
.. literalinclude:: /../../tests/integration_tests/test_v1_aero_opt.py
9696
:start-after: checkpoint 4
9797
:end-before: checkpoint 5
9898
:dedent: 8
@@ -143,7 +143,7 @@ v1 Script
143143
v2 Script
144144
^^^^^^^^^
145145

146-
.. literalinclude:: /../tests/test_v1_aero_opt.py
146+
.. literalinclude:: /../../tests/integration_tests/test_v1_aero_opt.py
147147
:start-after: checkpoint 0
148148
:end-before: checkpoint 5
149149
:dedent: 8

tests/integration_tests/test_aero_ground_effect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
class Test(unittest.TestCase):
55
def test(self):
6+
# docs checkpoint 0
67
import numpy as np
78

89
import openmdao.api as om
@@ -107,6 +108,7 @@ def test(self):
107108
prob.setup()
108109

109110
prob.run_driver()
111+
# docs checkpoint 1
110112

111113
assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03157578980832382, 1e-6)
112114
assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6)

0 commit comments

Comments
 (0)