Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Aug 20, 2024
1 parent c384338 commit 2ab2867
Show file tree
Hide file tree
Showing 101 changed files with 1,079 additions and 1,132 deletions.
2 changes: 0 additions & 2 deletions _modules/dymos/phase/analytic_phase.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,6 @@ <h1></h1>
<h1>Source code for dymos.phase.analytic_phase</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">copy</span> <span class="kn">import</span> <span class="n">deepcopy</span>

<span class="kn">import</span> <span class="nn">openmdao.api</span> <span class="k">as</span> <span class="nn">om</span>

<span class="kn">from</span> <span class="nn">.phase</span> <span class="kn">import</span> <span class="n">Phase</span>
<span class="kn">from</span> <span class="nn">..transcriptions</span> <span class="kn">import</span> <span class="n">Analytic</span>
<span class="kn">from</span> <span class="nn">.options</span> <span class="kn">import</span> <span class="n">StateOptionsDictionary</span>
Expand Down
5 changes: 1 addition & 4 deletions _modules/dymos/phase/phase.html
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ <h1>Source code for dymos.phase.phase</h1><div class="highlight"><pre>

<span class="kn">from</span> <span class="nn">..transcriptions.transcription_base</span> <span class="kn">import</span> <span class="n">TranscriptionBase</span>
<span class="kn">from</span> <span class="nn">..transcriptions.grid_data</span> <span class="kn">import</span> <span class="n">GaussLobattoGrid</span><span class="p">,</span> <span class="n">RadauGrid</span><span class="p">,</span> <span class="n">UniformGrid</span><span class="p">,</span> <span class="n">BirkhoffGrid</span>
<span class="kn">from</span> <span class="nn">..transcriptions</span> <span class="kn">import</span> <span class="n">ExplicitShooting</span><span class="p">,</span> <span class="n">GaussLobatto</span><span class="p">,</span> <span class="n">Radau</span><span class="p">,</span> <span class="n">Birkhoff</span>
<span class="kn">from</span> <span class="nn">..transcriptions</span> <span class="kn">import</span> <span class="n">ExplicitShooting</span><span class="p">,</span> <span class="n">GaussLobatto</span><span class="p">,</span> <span class="n">Radau</span>
<span class="kn">from</span> <span class="nn">..utils.indexing</span> <span class="kn">import</span> <span class="n">get_constraint_flat_idxs</span>
<span class="kn">from</span> <span class="nn">..utils.introspection</span> <span class="kn">import</span> <span class="n">configure_time_introspection</span><span class="p">,</span> <span class="n">_configure_constraint_introspection</span><span class="p">,</span> \
<span class="n">configure_controls_introspection</span><span class="p">,</span> <span class="n">configure_parameters_introspection</span><span class="p">,</span> \
Expand Down Expand Up @@ -3253,7 +3253,6 @@ <h1>Source code for dymos.phase.phase</h1><div class="highlight"><pre>
<span class="c1"># t = deepcopy(self.options[&#39;transcription&#39;]) if transcription is None else transcription</span>
<span class="n">ode_class</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;ode_class&#39;</span><span class="p">]</span>
<span class="n">ode_init_kwargs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;ode_init_kwargs&#39;</span><span class="p">]</span>
<span class="n">auto_solvers</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;auto_solvers&#39;</span><span class="p">]</span>

<span class="n">self_tx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">[</span><span class="s1">&#39;transcription&#39;</span><span class="p">]</span>
<span class="n">num_seg</span> <span class="o">=</span> <span class="n">self_tx</span><span class="o">.</span><span class="n">grid_data</span><span class="o">.</span><span class="n">num_segments</span>
Expand Down Expand Up @@ -3360,8 +3359,6 @@ <h1>Source code for dymos.phase.phase</h1><div class="highlight"><pre>
<span class="n">ip_dict</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">([(</span><span class="n">name</span><span class="p">,</span> <span class="n">options</span><span class="p">)</span> <span class="k">for</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">options</span><span class="p">)</span> <span class="ow">in</span> <span class="n">phs</span><span class="o">.</span><span class="n">list_inputs</span><span class="p">(</span><span class="n">units</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">out_stream</span><span class="o">=</span><span class="kc">None</span><span class="p">)])</span>

<span class="n">phs_path</span> <span class="o">=</span> <span class="n">phs</span><span class="o">.</span><span class="n">pathname</span> <span class="o">+</span> <span class="s1">&#39;.&#39;</span> <span class="k">if</span> <span class="n">phs</span><span class="o">.</span><span class="n">pathname</span> <span class="k">else</span> <span class="s1">&#39;&#39;</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">pathname</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
<span class="n">self_path</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s1">&#39;.&#39;</span>
<span class="k">else</span><span class="p">:</span>
Expand Down
5 changes: 2 additions & 3 deletions _modules/dymos/trajectory/trajectory.html
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ <h1>Source code for dymos.trajectory.trajectory</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">..transcriptions.common</span> <span class="kn">import</span> <span class="n">ParameterComp</span>
<span class="kn">from</span> <span class="nn">..utils.misc</span> <span class="kn">import</span> <span class="n">create_subprob</span><span class="p">,</span> <span class="n">get_rate_units</span><span class="p">,</span> <span class="n">_unspecified</span><span class="p">,</span> <span class="n">_none_or_unspecified</span>
<span class="kn">from</span> <span class="nn">..utils.introspection</span> <span class="kn">import</span> <span class="n">get_promoted_vars</span><span class="p">,</span> <span class="n">get_source_metadata</span><span class="p">,</span> <span class="n">_get_common_metadata</span>
<span class="kn">from</span> <span class="nn">.._options</span> <span class="kn">import</span> <span class="n">options</span> <span class="k">as</span> <span class="n">dymos_options</span>


<span class="n">om_version</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">([</span><span class="nb">int</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">openmdao</span><span class="o">.</span><span class="n">__version__</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;-&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)])</span>
Expand Down Expand Up @@ -1202,7 +1201,7 @@ <h1>Source code for dymos.trajectory.trajectory</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">targets</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">reason</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">&#39;Option `targets=None` but no phase in the trajectory has a parameter named `</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s1">`.&#39;</span>
<span class="k">elif</span> <span class="nb">all</span><span class="p">([</span><span class="n">t</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">targets</span><span class="o">.</span><span class="n">values</span><span class="p">()])</span> <span class="ow">and</span> <span class="n">targets</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">_phases</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">reason</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">&#39;Option `targets` is a dictionary keyed by phase name but target for each phase is None.&#39;</span>
<span class="n">reason</span> <span class="o">=</span> <span class="s1">&#39;Option `targets` is a dictionary keyed by phase name but target for each phase is None.&#39;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">reason</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;No target was found for trajectory parameter `</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s1">` in any phase.</span><span class="se">\n</span><span class="si">{</span><span class="n">reason</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
Expand Down Expand Up @@ -1367,7 +1366,7 @@ <h1>Source code for dymos.trajectory.trajectory</h1><div class="highlight"><pre>
<span class="n">user_shape</span><span class="o">=</span><span class="n">_unspecified</span><span class="p">)</span>
<span class="n">shapes</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">meta</span><span class="p">[</span><span class="s1">&#39;shape&#39;</span><span class="p">]</span>
<span class="n">units</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">meta</span><span class="p">[</span><span class="s1">&#39;units&#39;</span><span class="p">]</span>
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">info_str</span><span class="si">}</span><span class="s1">Error in linking </span><span class="si">{</span><span class="n">var_a</span><span class="si">}</span><span class="s1"> from </span><span class="si">{</span><span class="n">phase_name_a</span><span class="si">}</span><span class="s1"> to </span><span class="si">{</span><span class="n">var_b</span><span class="si">}</span><span class="s1"> in &#39;</span>
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">phase_name_b</span><span class="si">}</span><span class="s1">. Unable to find variable </span><span class="se">\&#39;</span><span class="si">{</span><span class="nb">vars</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="si">}</span><span class="se">\&#39;</span><span class="s1"> in phase &#39;</span>
<span class="sa">f</span><span class="s1">&#39;</span><span class="se">\&#39;</span><span class="si">{</span><span class="n">phases</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">pathname</span><span class="si">}</span><span class="se">\&#39;</span><span class="s1"> or its ODE.&#39;</span><span class="p">)</span>
Expand Down
6 changes: 3 additions & 3 deletions _sources/api/phase_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"# This cell is mandatory in all Dymos documentation notebooks.\n",
"missing_packages = []\n",
"try:\n",
" import openmdao.api as om\n",
" import openmdao.api as om # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install openmdao[notebooks]\n",
" else:\n",
" missing_packages.append('openmdao')\n",
"try:\n",
" import dymos as dm\n",
" import dymos as dm # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install dymos\n",
" else:\n",
" missing_packages.append('dymos')\n",
"try:\n",
" import pyoptsparse\n",
" import pyoptsparse # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !pip install -q condacolab\n",
Expand Down
6 changes: 3 additions & 3 deletions _sources/api/run_problem_function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"# This cell is mandatory in all Dymos documentation notebooks.\n",
"missing_packages = []\n",
"try:\n",
" import openmdao.api as om\n",
" import openmdao.api as om # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install openmdao[notebooks]\n",
" else:\n",
" missing_packages.append('openmdao')\n",
"try:\n",
" import dymos as dm\n",
" import dymos as dm # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install dymos\n",
" else:\n",
" missing_packages.append('dymos')\n",
"try:\n",
" import pyoptsparse\n",
" import pyoptsparse # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !pip install -q condacolab\n",
Expand Down
6 changes: 3 additions & 3 deletions _sources/api/trajectory_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"# This cell is mandatory in all Dymos documentation notebooks.\n",
"missing_packages = []\n",
"try:\n",
" import openmdao.api as om\n",
" import openmdao.api as om # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install openmdao[notebooks]\n",
" else:\n",
" missing_packages.append('openmdao')\n",
"try:\n",
" import dymos as dm\n",
" import dymos as dm # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install dymos\n",
" else:\n",
" missing_packages.append('dymos')\n",
"try:\n",
" import pyoptsparse\n",
" import pyoptsparse # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !pip install -q condacolab\n",
Expand Down
6 changes: 3 additions & 3 deletions _sources/api/transcriptions_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"# This cell is mandatory in all Dymos documentation notebooks.\n",
"missing_packages = []\n",
"try:\n",
" import openmdao.api as om\n",
" import openmdao.api as om # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install openmdao[notebooks]\n",
" else:\n",
" missing_packages.append('openmdao')\n",
"try:\n",
" import dymos as dm\n",
" import dymos as dm # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install dymos\n",
" else:\n",
" missing_packages.append('dymos')\n",
"try:\n",
" import pyoptsparse\n",
" import pyoptsparse # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !pip install -q condacolab\n",
Expand Down
14 changes: 7 additions & 7 deletions _sources/contributing/contributing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"# This cell is mandatory in all Dymos documentation notebooks.\n",
"missing_packages = []\n",
"try:\n",
" import openmdao.api as om\n",
" import openmdao.api as om # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install openmdao[notebooks]\n",
" else:\n",
" missing_packages.append('openmdao')\n",
"try:\n",
" import dymos as dm\n",
" import dymos as dm # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install dymos\n",
" else:\n",
" missing_packages.append('dymos')\n",
"try:\n",
" import pyoptsparse\n",
" import pyoptsparse # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !pip install -q condacolab\n",
Expand Down Expand Up @@ -108,13 +108,13 @@
"outputs": [],
"source": [
"try:\n",
" import openmdao.api as om\n",
" import dymos as dm\n",
" import openmdao.api as om # noqa: F401\n",
" import dymos as dm # noqa: F401\n",
"except ModuleNotFoundError:\n",
" !python -m pip install openmdao[notebooks]\n",
" !python -m pip install dymos\n",
" import openmdao.api as om\n",
" import dymos as dm"
" import openmdao.api as om # noqa: F401\n",
" import dymos as dm # noqa: F401"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions _sources/examples/balanced_field/balanced_field.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"# This cell is mandatory in all Dymos documentation notebooks.\n",
"missing_packages = []\n",
"try:\n",
" import openmdao.api as om\n",
" import openmdao.api as om # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install openmdao[notebooks]\n",
" else:\n",
" missing_packages.append('openmdao')\n",
"try:\n",
" import dymos as dm\n",
" import dymos as dm # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !python -m pip install dymos\n",
" else:\n",
" missing_packages.append('dymos')\n",
"try:\n",
" import pyoptsparse\n",
" import pyoptsparse # noqa: F401\n",
"except ImportError:\n",
" if 'google.colab' in str(get_ipython()):\n",
" !pip install -q condacolab\n",
Expand Down Expand Up @@ -747,7 +747,7 @@
" textcoords='axes fraction', arrowprops=dict(arrowstyle='->'),\n",
" horizontalalignment='center', verticalalignment='top')\n",
"\n",
"axes[0].annotate(f'', xy=(tf_rto, rf_rto),\n",
"axes[0].annotate('', xy=(tf_rto, rf_rto),\n",
" xycoords='data', xytext=(0.7, 0.5),\n",
" textcoords='axes fraction', arrowprops=dict(arrowstyle='->'),\n",
" horizontalalignment='center', verticalalignment='top')\n",
Expand Down
Loading

0 comments on commit 2ab2867

Please sign in to comment.