Skip to content

Commit

Permalink
Deploying to gh-pages from @ 8d53a77 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
frehburg committed Oct 17, 2024
1 parent 231143b commit 0c8b529
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1>Source code for phenopacket_mapper.data_standards.data_model</h1><div class=

<span class="kn">from</span> <span class="nn">dataclasses</span> <span class="kn">import</span> <span class="n">dataclass</span><span class="p">,</span> <span class="n">field</span>
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Tuple</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Union</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">,</span> <span class="n">Iterable</span>
<span class="kn">import</span> <span class="nn">warnings</span>

<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
Expand Down Expand Up @@ -648,6 +648,34 @@ <h1>Source code for phenopacket_mapper.data_standards.data_model</h1><div class=
<span class="k">return</span> <span class="n">f</span>
<span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;&#39;OrGroup&#39; object has no attribute &#39;</span><span class="si">{</span><span class="n">var_name</span><span class="si">}</span><span class="s2">&#39;&quot;</span><span class="p">)</span></div>



<div class="viewcode-block" id="recursive_collect_all_members_data_model">
<a class="viewcode-back" href="../../../apidocs/phenopacket_mapper.data_standards.data_model.html#phenopacket_mapper.recursive_collect_all_members_data_model">[docs]</a>
<span class="k">def</span> <span class="nf">recursive_collect_all_members_data_model</span><span class="p">(</span>
<span class="n">data_model</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="n">DataModel</span><span class="p">,</span> <span class="n">DataSection</span><span class="p">,</span> <span class="n">OrGroup</span><span class="p">,</span> <span class="n">DataField</span><span class="p">]</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Iterable</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">DataSection</span><span class="p">,</span> <span class="n">OrGroup</span><span class="p">,</span> <span class="n">DataField</span><span class="p">]]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Recursively collect all members of a DataModel, DataSection, OrGroup, or DataField</span>

<span class="sd"> :param data_model: DataModel, DataSection, OrGroup, or DataField to collect all members from</span>
<span class="sd"> :return: Iterable of DataSection, OrGroup, and DataField members</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data_model</span><span class="p">,</span> <span class="n">DataModel</span><span class="p">):</span>
<span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">data_model</span><span class="o">.</span><span class="n">fields</span><span class="p">:</span>
<span class="k">yield from</span> <span class="n">recursive_collect_all_members_data_model</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data_model</span><span class="p">,</span> <span class="n">DataSection</span><span class="p">):</span>
<span class="k">yield</span> <span class="n">data_model</span>
<span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">data_model</span><span class="o">.</span><span class="n">fields</span><span class="p">:</span>
<span class="k">yield from</span> <span class="n">recursive_collect_all_members_data_model</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data_model</span><span class="p">,</span> <span class="n">OrGroup</span><span class="p">):</span>
<span class="k">yield</span> <span class="n">data_model</span>
<span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">data_model</span><span class="o">.</span><span class="n">fields</span><span class="p">:</span>
<span class="k">yield from</span> <span class="n">recursive_collect_all_members_data_model</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data_model</span><span class="p">,</span> <span class="n">DataField</span><span class="p">):</span>
<span class="k">yield</span> <span class="n">data_model</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Unsupported data_model type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">data_model</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span></div>

</pre></div>

</div>
Expand Down
14 changes: 14 additions & 0 deletions latest/apidocs/phenopacket_mapper.data_standards.data_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,20 @@

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="phenopacket_mapper.data_standards.data_model.recursive_collect_all_members_data_model">
<span class="sig-prename descclassname"><span class="pre">phenopacket_mapper.data_standards.data_model.</span></span><span class="sig-name descname"><span class="pre">recursive_collect_all_members_data_model</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data_model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.DataModel" title="phenopacket_mapper.data_standards.data_model.DataModel"><span class="pre">DataModel</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.DataSection" title="phenopacket_mapper.data_standards.data_model.DataSection"><span class="pre">DataSection</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.OrGroup" title="phenopacket_mapper.data_standards.data_model.OrGroup"><span class="pre">OrGroup</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.DataField" title="phenopacket_mapper.data_standards.data_model.DataField"><span class="pre">DataField</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Iterable" title="(in Python v3.13)"><span class="pre">Iterable</span></a><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.DataSection" title="phenopacket_mapper.data_standards.data_model.DataSection"><span class="pre">DataSection</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.OrGroup" title="phenopacket_mapper.data_standards.data_model.OrGroup"><span class="pre">OrGroup</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#phenopacket_mapper.data_standards.data_model.DataField" title="phenopacket_mapper.data_standards.data_model.DataField"><span class="pre">DataField</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/phenopacket_mapper/data_standards/data_model.html#recursive_collect_all_members_data_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#phenopacket_mapper.data_standards.data_model.recursive_collect_all_members_data_model" title="Link to this definition"></a></dt>
<dd><p>Recursively collect all members of a DataModel, DataSection, OrGroup, or DataField</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data_model</strong> – DataModel, DataSection, OrGroup, or DataField to collect all members from</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Iterable of DataSection, OrGroup, and DataField members</p>
</dd>
</dl>
</dd></dl>

</section>


Expand Down
1 change: 1 addition & 0 deletions latest/apidocs/phenopacket_mapper.data_standards.html
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.data_standards.data_model.html#phenopacket_mapper.data_standards.data_model.DataModelInstance"><code class="docutils literal notranslate"><span class="pre">DataModelInstance</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.data_standards.data_model.html#phenopacket_mapper.data_standards.data_model.DataSet"><code class="docutils literal notranslate"><span class="pre">DataSet</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.data_standards.data_model.html#phenopacket_mapper.data_standards.data_model.OrGroup"><code class="docutils literal notranslate"><span class="pre">OrGroup</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.data_standards.data_model.html#phenopacket_mapper.data_standards.data_model.recursive_collect_all_members_data_model"><code class="docutils literal notranslate"><span class="pre">recursive_collect_all_members_data_model()</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="phenopacket_mapper.data_standards.date.html">phenopacket_mapper.data_standards.date module</a><ul>
Expand Down
2 changes: 2 additions & 0 deletions latest/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,8 @@ <h2 id="R">R</h2>
<li><a href="apidocs/phenopacket_mapper.utils.io.read_xml.html#phenopacket_mapper.utils.io.read_xml.read_xml">(in module phenopacket_mapper.utils.io.read_xml)</a>
</li>
</ul></li>
<li><a href="apidocs/phenopacket_mapper.data_standards.data_model.html#phenopacket_mapper.data_standards.data_model.recursive_collect_all_members_data_model">recursive_collect_all_members_data_model() (in module phenopacket_mapper.data_standards.data_model)</a>
</li>
<li><a href="apidocs/phenopacket_mapper.utils.html#phenopacket_mapper.utils.recursive_dict_call">recursive_dict_call() (in module phenopacket_mapper.utils)</a>

<ul>
Expand Down
Binary file modified latest/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion latest/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 0c8b529

Please sign in to comment.