Skip to content

Commit

Permalink
Deploying to gh-pages from @ 73c8c5a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
frehburg committed Oct 15, 2024
1 parent e500d0c commit 57b3496
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
20 changes: 20 additions & 0 deletions latest/_modules/phenopacket_mapper/utils/io/read_xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,33 @@ <h1>Source code for phenopacket_mapper.utils.io.read_xml</h1><div class="highlig
<span class="k">return</span> <span class="n">dict_</span>


<div class="viewcode-block" id="remove_at_symbols">
<a class="viewcode-back" href="../../../../apidocs/phenopacket_mapper.utils.io.read_xml.html#phenopacket_mapper.utils.io.remove_at_symbols">[docs]</a>
<span class="k">def</span> <span class="nf">remove_at_symbols</span><span class="p">(</span><span class="n">dict_</span><span class="p">:</span> <span class="n">Dict</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span>
<span class="n">new_dict</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dict_</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="k">if</span> <span class="n">k</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;@&quot;</span><span class="p">):</span>
<span class="n">k</span> <span class="o">=</span> <span class="n">k</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">new_dict</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">remove_at_symbols</span><span class="p">(</span><span class="n">item</span><span class="p">)</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">v</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">new_dict</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">remove_at_symbols</span><span class="p">(</span><span class="n">v</span><span class="p">)</span>

<span class="k">return</span> <span class="n">new_dict</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">dict_</span></div>



<div class="viewcode-block" id="parse_xml">
<a class="viewcode-back" href="../../../../apidocs/phenopacket_mapper.utils.io.read_xml.html#phenopacket_mapper.utils.io.parse_xml">[docs]</a>
<span class="k">def</span> <span class="nf">parse_xml</span><span class="p">(</span><span class="n">file</span><span class="p">:</span> <span class="n">IOBase</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Parse an XML file into a dictionary with inferred types.&quot;&quot;&quot;</span>
<span class="n">dict_</span> <span class="o">=</span> <span class="n">xmltodict</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">file</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">dict_</span><span class="si">=}</span><span class="s2">, </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dict_</span><span class="p">)</span><span class="si">=}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">dict_</span> <span class="o">=</span> <span class="n">_post_process_xml_dict</span><span class="p">(</span><span class="n">dict_</span><span class="p">)</span>
<span class="n">dict_</span> <span class="o">=</span> <span class="n">remove_at_symbols</span><span class="p">(</span><span class="n">dict_</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dict_</span></div>


Expand Down
1 change: 1 addition & 0 deletions latest/apidocs/phenopacket_mapper.utils.io.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
</li>
<li class="toctree-l1"><a class="reference internal" href="phenopacket_mapper.utils.io.read_xml.html">phenopacket_mapper.utils.io.read_xml module</a><ul>
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.utils.io.read_xml.html#phenopacket_mapper.utils.io.read_xml.read_xml"><code class="docutils literal notranslate"><span class="pre">read_xml()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.utils.io.read_xml.html#phenopacket_mapper.utils.io.read_xml.remove_at_symbols"><code class="docutils literal notranslate"><span class="pre">remove_at_symbols()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="phenopacket_mapper.utils.io.read_xml.html#phenopacket_mapper.utils.io.read_xml.parse_xml"><code class="docutils literal notranslate"><span class="pre">parse_xml()</span></code></a></li>
</ul>
</li>
Expand Down
5 changes: 5 additions & 0 deletions latest/apidocs/phenopacket_mapper.utils.io.read_xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
<span class="sig-prename descclassname"><span class="pre">phenopacket_mapper.utils.io.read_xml.</span></span><span class="sig-name descname"><span class="pre">read_xml</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/pathlib.html#pathlib.Path" title="(in Python v3.13)"><span class="pre">Path</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/io.html#io.IOBase" title="(in Python v3.13)"><span class="pre">IOBase</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'utf-8'</span></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.Dict" title="(in Python v3.13)"><span class="pre">Dict</span></a></span></span><a class="reference internal" href="../_modules/phenopacket_mapper/utils/io/read_xml.html#read_xml"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#phenopacket_mapper.utils.io.read_xml.read_xml" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="phenopacket_mapper.utils.io.read_xml.remove_at_symbols">
<span class="sig-prename descclassname"><span class="pre">phenopacket_mapper.utils.io.read_xml.</span></span><span class="sig-name descname"><span class="pre">remove_at_symbols</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dict_</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.13)"><span class="pre">Dict</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.Dict" title="(in Python v3.13)"><span class="pre">Dict</span></a></span></span><a class="reference internal" href="../_modules/phenopacket_mapper/utils/io/read_xml.html#remove_at_symbols"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#phenopacket_mapper.utils.io.read_xml.remove_at_symbols" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="phenopacket_mapper.utils.io.read_xml.parse_xml">
<span class="sig-prename descclassname"><span class="pre">phenopacket_mapper.utils.io.read_xml.</span></span><span class="sig-name descname"><span class="pre">parse_xml</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/io.html#io.IOBase" title="(in Python v3.13)"><span class="pre">IOBase</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.Dict" title="(in Python v3.13)"><span class="pre">Dict</span></a></span></span><a class="reference internal" href="../_modules/phenopacket_mapper/utils/io/read_xml.html#parse_xml"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#phenopacket_mapper.utils.io.read_xml.parse_xml" title="Link to this definition"></a></dt>
Expand Down
2 changes: 2 additions & 0 deletions latest/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,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.utils.io.read_xml.html#phenopacket_mapper.utils.io.read_xml.remove_at_symbols">remove_at_symbols() (in module phenopacket_mapper.utils.io.read_xml)</a>
</li>
<li><a href="apidocs/phenopacket_mapper.data_standards.value_set.html#phenopacket_mapper.data_standards.value_set.ValueSet.remove_duplicates">remove_duplicates() (phenopacket_mapper.data_standards.value_set.ValueSet method)</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 57b3496

Please sign in to comment.