Skip to content

Commit

Permalink
Deploying to gh-pages from @ 72d1fe6 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
frehburg committed Oct 17, 2024
1 parent b02d02f commit 8002bc8
Show file tree
Hide file tree
Showing 30 changed files with 1,140 additions and 567 deletions.
1 change: 1 addition & 0 deletions latest/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ <h1>All modules for which code is available</h1>
<li><a href="phenopacket_mapper/utils/parsing/parse_primitive_data_value.html">phenopacket_mapper.utils.parsing.parse_primitive_data_value</a></li>
<li><a href="phenopacket_mapper/utils/parsing/parse_value.html">phenopacket_mapper.utils.parsing.parse_value</a></li>
<li><a href="phenopacket_mapper/utils/parsing/parse_value_set.html">phenopacket_mapper.utils.parsing.parse_value_set</a></li>
<li><a href="phenopacket_mapper/utils/recursive_dict_call.html">phenopacket_mapper.utils.recursive_dict_call</a></li>
<li><a href="phenopacket_mapper/utils/str_to_valid_id.html">phenopacket_mapper.utils.str_to_valid_id</a></li>
<li><a href="phenopacket_mapper/validate/validate.html">phenopacket_mapper.validate.validate</a></li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,51 @@ <h1>Source code for phenopacket_mapper.data_standards.cardinality</h1><div class
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Parameter max must be a positive integer. (Not: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">)</span>

<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="si">}</span><span class="s2">..</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">max</span><span class="si">}</span><span class="s2">&quot;</span></div>
<span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="si">}</span><span class="s2">..</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">max</span><span class="si">}</span><span class="s2">&quot;</span>

<span class="c1"># Singleton instances</span>
<span class="n">_instances</span> <span class="o">=</span> <span class="p">{}</span>

<div class="viewcode-block" id="Cardinality.ZERO_TO_ONE">
<a class="viewcode-back" href="../../../apidocs/phenopacket_mapper.data_standards.cardinality.html#phenopacket_mapper.data_standards.Cardinality.ZERO_TO_ONE">[docs]</a>
<span class="nd">@classmethod</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">ZERO_TO_ONE</span><span class="p">(</span><span class="bp">cls</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s1">&#39;Cardinality&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="s1">&#39;ZERO_TO_ONE&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ZERO_TO_ONE&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ZERO_TO_ONE&#39;</span><span class="p">]</span></div>


<div class="viewcode-block" id="Cardinality.ZERO_TO_N">
<a class="viewcode-back" href="../../../apidocs/phenopacket_mapper.data_standards.cardinality.html#phenopacket_mapper.data_standards.Cardinality.ZERO_TO_N">[docs]</a>
<span class="nd">@classmethod</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">ZERO_TO_N</span><span class="p">(</span><span class="bp">cls</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s1">&#39;Cardinality&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="s1">&#39;ZERO_TO_N&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ZERO_TO_N&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;n&#39;</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ZERO_TO_N&#39;</span><span class="p">]</span></div>


<div class="viewcode-block" id="Cardinality.ONE">
<a class="viewcode-back" href="../../../apidocs/phenopacket_mapper.data_standards.cardinality.html#phenopacket_mapper.data_standards.Cardinality.ONE">[docs]</a>
<span class="nd">@classmethod</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">ONE</span><span class="p">(</span><span class="bp">cls</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s1">&#39;Cardinality&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="s1">&#39;OPTIONAL&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ONE&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ONE&#39;</span><span class="p">]</span></div>


<div class="viewcode-block" id="Cardinality.ONE_TO_N">
<a class="viewcode-back" href="../../../apidocs/phenopacket_mapper.data_standards.cardinality.html#phenopacket_mapper.data_standards.Cardinality.ONE_TO_N">[docs]</a>
<span class="nd">@classmethod</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">ONE_TO_N</span><span class="p">(</span><span class="bp">cls</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="s1">&#39;Cardinality&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="s1">&#39;ONE_TO_N&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ONE_TO_N&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;n&#39;</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_instances</span><span class="p">[</span><span class="s1">&#39;ONE_TO_N&#39;</span><span class="p">]</span></div>
</div>


</pre></div>

Expand Down
Loading

0 comments on commit 8002bc8

Please sign in to comment.