Skip to content

Commit

Permalink
Deployed 2420d97 with MkDocs version: 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Aug 23, 2024
1 parent 309029b commit a89d667
Show file tree
Hide file tree
Showing 17 changed files with 416 additions and 242 deletions.
32 changes: 32 additions & 0 deletions api_reference/trestle.common.const/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,13 @@
HELP_FO_OUTPUT
</a>

</li>

<li class="md-nav__item">
<a href="#trestle.common.const.HELP_INCLUDE_ALL_PARTS" class="md-nav__link">
HELP_INCLUDE_ALL_PARTS
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -6564,6 +6571,13 @@
HELP_FO_OUTPUT
</a>

</li>

<li class="md-nav__item">
<a href="#trestle.common.const.HELP_INCLUDE_ALL_PARTS" class="md-nav__link">
HELP_INCLUDE_ALL_PARTS
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -8896,6 +8910,24 @@ <h4 id="trestle.common.const.HELP_FO_OUTPUT" class="doc doc-heading">



<h4 id="trestle.common.const.HELP_INCLUDE_ALL_PARTS" class="doc doc-heading">
<code class="highlight language-python"><span class="n">HELP_INCLUDE_ALL_PARTS</span></code>


<a href="#trestle.common.const.HELP_INCLUDE_ALL_PARTS" class="headerlink" title="Permanent link">¤</a></h4>

<div class="doc doc-contents ">

</div>

</div>



<div class="doc doc-object doc-attribute">



<h4 id="trestle.common.const.HELP_LEVERAGED" class="doc doc-heading">
<code class="highlight language-python"><span class="n">HELP_LEVERAGED</span></code>

Expand Down
42 changes: 28 additions & 14 deletions api_reference/trestle.core.catalog.catalog_reader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4880,30 +4880,45 @@ <h4 id="trestle.core.catalog.catalog_reader.CatalogReader" class="doc doc-headin
<span class="n">ssp</span><span class="o">.</span><span class="n">control_implementation</span><span class="o">.</span><span class="n">implemented_requirements</span>
<span class="p">)</span>
<span class="n">ssp</span><span class="o">.</span><span class="n">control_implementation</span><span class="o">.</span><span class="n">implemented_requirements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">control_imp_req</span><span class="p">)</span>
<span class="n">CatalogReader</span><span class="o">.</span><span class="n">_add_statement_to_impl_requirement</span><span class="p">(</span><span class="n">control_imp_req</span><span class="p">,</span> <span class="n">statement_id</span><span class="p">)</span>
<span class="k">return</span> <span class="n">control_imp_req</span>

<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">_add_statement_to_impl_requirement</span><span class="p">(</span><span class="n">impl_req</span><span class="p">:</span> <span class="n">ossp</span><span class="o">.</span><span class="n">ImplementedRequirement</span><span class="p">,</span> <span class="n">statement_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">ossp</span><span class="o">.</span><span class="n">Statement</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Update the implemented requirement with a new statement.&quot;&quot;&quot;</span>
<span class="n">statement</span> <span class="o">=</span> <span class="n">gens</span><span class="o">.</span><span class="n">generate_sample_model</span><span class="p">(</span><span class="n">ossp</span><span class="o">.</span><span class="n">Statement</span><span class="p">)</span>
<span class="n">statement</span><span class="o">.</span><span class="n">statement_id</span> <span class="o">=</span> <span class="n">statement_id</span>
<span class="n">statement</span><span class="o">.</span><span class="n">by_components</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">control_imp_req</span><span class="o">.</span><span class="n">statements</span> <span class="o">=</span> <span class="n">as_list</span><span class="p">(</span><span class="n">control_imp_req</span><span class="o">.</span><span class="n">statements</span><span class="p">)</span>
<span class="n">control_imp_req</span><span class="o">.</span><span class="n">statements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">statement</span><span class="p">)</span>
<span class="k">return</span> <span class="n">control_imp_req</span>
<span class="n">impl_req</span><span class="o">.</span><span class="n">statements</span> <span class="o">=</span> <span class="n">as_list</span><span class="p">(</span><span class="n">impl_req</span><span class="o">.</span><span class="n">statements</span><span class="p">)</span>
<span class="n">impl_req</span><span class="o">.</span><span class="n">statements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">statement</span><span class="p">)</span>
<span class="k">return</span> <span class="n">statement</span>

<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">_get_by_comp_from_imp_req</span><span class="p">(</span>
<span class="n">imp_req</span><span class="p">:</span> <span class="n">ossp</span><span class="o">.</span><span class="n">ImplementedRequirement</span><span class="p">,</span> <span class="n">statement_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">comp_uuid</span><span class="p">:</span> <span class="nb">str</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">ossp</span><span class="o">.</span><span class="n">ByComponent</span><span class="p">:</span>
<span class="k">if</span> <span class="n">statement_id</span><span class="p">:</span>
<span class="n">found_statement</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">ossp</span><span class="o">.</span><span class="n">Statement</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">for</span> <span class="n">statement</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">imp_req</span><span class="o">.</span><span class="n">statements</span><span class="p">):</span>
<span class="k">if</span> <span class="n">statement</span><span class="o">.</span><span class="n">statement_id</span> <span class="o">==</span> <span class="n">statement_id</span><span class="p">:</span>
<span class="k">for</span> <span class="n">by_comp</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">statement</span><span class="o">.</span><span class="n">by_components</span><span class="p">):</span>
<span class="k">if</span> <span class="n">by_comp</span><span class="o">.</span><span class="n">component_uuid</span> <span class="o">==</span> <span class="n">comp_uuid</span><span class="p">:</span>
<span class="k">return</span> <span class="n">by_comp</span>
<span class="c1"># didnt find bycomp so need to make one</span>
<span class="n">by_comp</span> <span class="o">=</span> <span class="n">gens</span><span class="o">.</span><span class="n">generate_sample_model</span><span class="p">(</span><span class="n">ossp</span><span class="o">.</span><span class="n">ByComponent</span><span class="p">)</span>
<span class="n">by_comp</span><span class="o">.</span><span class="n">component_uuid</span> <span class="o">=</span> <span class="n">comp_uuid</span>
<span class="n">by_comp</span><span class="o">.</span><span class="n">implementation_status</span> <span class="o">=</span> <span class="n">com</span><span class="o">.</span><span class="n">ImplementationStatus</span><span class="p">(</span><span class="n">state</span><span class="o">=</span><span class="n">const</span><span class="o">.</span><span class="n">STATUS_PLANNED</span><span class="p">)</span>
<span class="n">statement</span><span class="o">.</span><span class="n">by_components</span> <span class="o">=</span> <span class="n">as_list</span><span class="p">(</span><span class="n">statement</span><span class="o">.</span><span class="n">by_components</span><span class="p">)</span>
<span class="n">statement</span><span class="o">.</span><span class="n">by_components</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">by_comp</span><span class="p">)</span>
<span class="k">return</span> <span class="n">by_comp</span>
<span class="n">found_statement</span> <span class="o">=</span> <span class="n">statement</span>
<span class="k">break</span>

<span class="c1"># If the statement doesn&#39;t exist, create it</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">found_statement</span><span class="p">:</span>
<span class="n">found_statement</span> <span class="o">=</span> <span class="n">CatalogReader</span><span class="o">.</span><span class="n">_add_statement_to_impl_requirement</span><span class="p">(</span><span class="n">imp_req</span><span class="p">,</span> <span class="n">statement_id</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">for</span> <span class="n">by_comp</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">found_statement</span><span class="o">.</span><span class="n">by_components</span><span class="p">):</span>
<span class="k">if</span> <span class="n">by_comp</span><span class="o">.</span><span class="n">component_uuid</span> <span class="o">==</span> <span class="n">comp_uuid</span><span class="p">:</span>
<span class="k">return</span> <span class="n">by_comp</span>

<span class="c1"># didnt find bycomp or new statement so need to make one</span>
<span class="n">by_comp</span> <span class="o">=</span> <span class="n">gens</span><span class="o">.</span><span class="n">generate_sample_model</span><span class="p">(</span><span class="n">ossp</span><span class="o">.</span><span class="n">ByComponent</span><span class="p">)</span>
<span class="n">by_comp</span><span class="o">.</span><span class="n">component_uuid</span> <span class="o">=</span> <span class="n">comp_uuid</span>
<span class="n">by_comp</span><span class="o">.</span><span class="n">implementation_status</span> <span class="o">=</span> <span class="n">com</span><span class="o">.</span><span class="n">ImplementationStatus</span><span class="p">(</span><span class="n">state</span><span class="o">=</span><span class="n">const</span><span class="o">.</span><span class="n">STATUS_PLANNED</span><span class="p">)</span>
<span class="n">found_statement</span><span class="o">.</span><span class="n">by_components</span> <span class="o">=</span> <span class="n">as_list</span><span class="p">(</span><span class="n">found_statement</span><span class="o">.</span><span class="n">by_components</span><span class="p">)</span>
<span class="n">found_statement</span><span class="o">.</span><span class="n">by_components</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">by_comp</span><span class="p">)</span>
<span class="k">return</span> <span class="n">by_comp</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">for</span> <span class="n">by_comp</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">imp_req</span><span class="o">.</span><span class="n">by_components</span><span class="p">):</span>
<span class="k">if</span> <span class="n">by_comp</span><span class="o">.</span><span class="n">component_uuid</span> <span class="o">==</span> <span class="n">comp_uuid</span><span class="p">:</span>
Expand All @@ -4914,7 +4929,6 @@ <h4 id="trestle.core.catalog.catalog_reader.CatalogReader" class="doc doc-headin
<span class="n">imp_req</span><span class="o">.</span><span class="n">by_components</span> <span class="o">=</span> <span class="n">as_list</span><span class="p">(</span><span class="n">imp_req</span><span class="o">.</span><span class="n">by_components</span><span class="p">)</span>
<span class="n">imp_req</span><span class="o">.</span><span class="n">by_components</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">by_comp</span><span class="p">)</span>
<span class="k">return</span> <span class="n">by_comp</span>
<span class="k">raise</span> <span class="n">TrestleError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Internal error seeking by_comp for component </span><span class="si">{</span><span class="n">comp_uuid</span><span class="si">}</span><span class="s1"> and statement </span><span class="si">{</span><span class="n">statement_id</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>

<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">_read_comp_info_from_md</span><span class="p">(</span><span class="n">control_file_path</span><span class="p">:</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">,</span>
Expand Down
8 changes: 6 additions & 2 deletions api_reference/trestle.core.catalog.catalog_writer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4847,9 +4847,11 @@ <h4 id="trestle.core.catalog.catalog_writer.CatalogWriter" class="doc doc-headin
<span class="c1"># adds it to prof-param-value-origin</span>
<span class="k">if</span> <span class="n">prof_param_value_origin</span> <span class="o">!=</span> <span class="s1">&#39;&#39;</span> <span class="ow">and</span> <span class="n">prof_param_value_origin</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">context</span><span class="o">.</span><span class="n">purpose</span> <span class="o">==</span> <span class="n">ContextPurpose</span><span class="o">.</span><span class="n">PROFILE</span><span class="p">:</span>
<span class="n">new_dict</span><span class="p">[</span><span class="n">const</span><span class="o">.</span><span class="n">PROFILE_PARAM_VALUE_ORIGIN</span><span class="p">]</span> <span class="o">=</span> <span class="n">prof_param_value_origin</span>
<span class="k">if</span> <span class="n">const</span><span class="o">.</span><span class="n">AGGREGATES</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="n">prop</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">prop</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">param</span><span class="o">.</span><span class="n">props</span><span class="p">)]:</span>
<span class="n">new_dict</span><span class="p">[</span><span class="n">const</span><span class="o">.</span><span class="n">PROFILE_PARAM_VALUE_ORIGIN</span><span class="p">]</span> <span class="o">=</span> <span class="n">prof_param_value_origin</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">new_dict</span><span class="p">[</span><span class="n">const</span><span class="o">.</span><span class="n">PROFILE_PARAM_VALUE_ORIGIN</span><span class="p">]</span> <span class="o">=</span> <span class="n">const</span><span class="o">.</span><span class="n">REPLACE_ME_PLACEHOLDER</span>
<span class="k">if</span> <span class="n">const</span><span class="o">.</span><span class="n">AGGREGATES</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="n">prop</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">prop</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">param</span><span class="o">.</span><span class="n">props</span><span class="p">)]:</span>
<span class="n">new_dict</span><span class="p">[</span><span class="n">const</span><span class="o">.</span><span class="n">PROFILE_PARAM_VALUE_ORIGIN</span><span class="p">]</span> <span class="o">=</span> <span class="n">const</span><span class="o">.</span><span class="n">REPLACE_ME_PLACEHOLDER</span>
<span class="c1"># then insert the original, incoming values as values</span>
<span class="k">if</span> <span class="n">param_id</span> <span class="ow">in</span> <span class="n">control_param_dict</span><span class="p">:</span>
<span class="n">orig_param</span> <span class="o">=</span> <span class="n">control_param_dict</span><span class="p">[</span><span class="n">param_id</span><span class="p">]</span>
Expand All @@ -4862,6 +4864,8 @@ <h4 id="trestle.core.catalog.catalog_writer.CatalogWriter" class="doc doc-headin
<span class="n">new_dict</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">const</span><span class="o">.</span><span class="n">VALUES</span><span class="p">)</span>
<span class="k">if</span> <span class="n">new_dict</span><span class="p">[</span><span class="n">const</span><span class="o">.</span><span class="n">GUIDELINES</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">new_dict</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">const</span><span class="o">.</span><span class="n">GUIDELINES</span><span class="p">)</span>
<span class="k">if</span> <span class="n">const</span><span class="o">.</span><span class="n">AGGREGATES</span> <span class="ow">in</span> <span class="p">[</span><span class="n">prop</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">prop</span> <span class="ow">in</span> <span class="n">as_list</span><span class="p">(</span><span class="n">orig_param</span><span class="o">.</span><span class="n">props</span><span class="p">)]:</span>
<span class="n">new_dict</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">const</span><span class="o">.</span><span class="n">PROFILE_PARAM_VALUE_ORIGIN</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># if the profile doesnt change this param at all, show it in the header with values</span>
<span class="n">tmp_dict</span> <span class="o">=</span> <span class="n">ModelUtils</span><span class="o">.</span><span class="n">parameter_to_dict</span><span class="p">(</span><span class="n">param_dict</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
Expand Down
Loading

0 comments on commit a89d667

Please sign in to comment.