Skip to content

Commit

Permalink
deploy: 43e1233
Browse files Browse the repository at this point in the history
  • Loading branch information
drugilsberg committed Jul 16, 2024
1 parent 3492b46 commit 32ef51b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions _modules/rxn/chemutils/conversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1>Source code for rxn.chemutils.conversion</h1><div class="highlight"><pre>

<span class="kn">from</span> <span class="nn">.exceptions</span> <span class="kn">import</span> <span class="n">InvalidInchi</span><span class="p">,</span> <span class="n">InvalidMdl</span><span class="p">,</span> <span class="n">InvalidSmiles</span><span class="p">,</span> <span class="n">SanitizationError</span>

<span class="n">RDLogger</span><span class="o">.</span><span class="n">logger</span><span class="p">()</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">RDLogger</span><span class="o">.</span><span class="n">CRITICAL</span><span class="p">)</span>
<span class="n">RDLogger</span><span class="o">.</span><span class="n">logger</span><span class="p">()</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">RDLogger</span><span class="o">.</span><span class="n">CRITICAL</span><span class="p">)</span> <span class="c1"># type: ignore[no-untyped-call]</span>


<div class="viewcode-block" id="smiles_to_mol"><a class="viewcode-back" href="../../../generated/rxn.chemutils.conversion.smiles_to_mol.html#rxn.chemutils.conversion.smiles_to_mol">[docs]</a><span class="k">def</span> <span class="nf">smiles_to_mol</span><span class="p">(</span>
Expand Down Expand Up @@ -124,7 +124,7 @@ <h1>Source code for rxn.chemutils.conversion</h1><div class="highlight"><pre>
<span class="c1"># function, either with no sanitization, or with radical finding.</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">sanitize</span><span class="p">:</span>
<span class="k">if</span> <span class="n">find_radicals</span><span class="p">:</span>
<span class="n">sanitizations</span> <span class="o">=</span> <span class="p">[</span><span class="n">Chem</span><span class="o">.</span><span class="n">SANITIZE_FINDRADICALS</span><span class="p">]</span>
<span class="n">sanitizations</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">SanitizeFlags</span> <span class="o">|</span> <span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">Chem</span><span class="o">.</span><span class="n">SANITIZE_FINDRADICALS</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">sanitizations</span> <span class="o">=</span> <span class="p">[</span><span class="n">Chem</span><span class="o">.</span><span class="n">SANITIZE_NONE</span><span class="p">]</span>

Expand All @@ -151,7 +151,7 @@ <h1>Source code for rxn.chemutils.conversion</h1><div class="highlight"><pre>
<span class="sd"> Returns:</span>
<span class="sd"> Mol instance.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">mol</span> <span class="o">=</span> <span class="n">MolFromInchi</span><span class="p">(</span><span class="n">inchi</span><span class="p">,</span> <span class="n">sanitize</span><span class="o">=</span><span class="n">sanitize</span><span class="p">,</span> <span class="n">removeHs</span><span class="o">=</span><span class="n">removeHs</span><span class="p">)</span>
<span class="n">mol</span><span class="p">:</span> <span class="n">Mol</span> <span class="o">=</span> <span class="n">MolFromInchi</span><span class="p">(</span><span class="n">inchi</span><span class="p">,</span> <span class="n">sanitize</span><span class="o">=</span><span class="n">sanitize</span><span class="p">,</span> <span class="n">removeHs</span><span class="o">=</span><span class="n">removeHs</span><span class="p">)</span> <span class="c1"># type: ignore[no-untyped-call]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">inchi</span> <span class="ow">or</span> <span class="n">mol</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InvalidInchi</span><span class="p">(</span><span class="n">inchi</span><span class="p">)</span>

Expand All @@ -164,7 +164,7 @@ <h1>Source code for rxn.chemutils.conversion</h1><div class="highlight"><pre>

<span class="sd"> Mainly a wrapper around MolToSmiles.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">MolToSmiles</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">canonical</span><span class="o">=</span><span class="n">canonical</span><span class="p">,</span> <span class="n">isomericSmiles</span><span class="o">=</span><span class="n">isomericSmiles</span><span class="p">)</span> <span class="c1"># type: ignore</span></div>
<span class="k">return</span> <span class="n">MolToSmiles</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">canonical</span><span class="o">=</span><span class="n">canonical</span><span class="p">,</span> <span class="n">isomericSmiles</span><span class="o">=</span><span class="n">isomericSmiles</span><span class="p">)</span></div>


<div class="viewcode-block" id="mdl_to_mol"><a class="viewcode-back" href="../../../generated/rxn.chemutils.conversion.mdl_to_mol.html#rxn.chemutils.conversion.mdl_to_mol">[docs]</a><span class="k">def</span> <span class="nf">mdl_to_mol</span><span class="p">(</span><span class="n">mdl</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">sanitize</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Mol</span><span class="p">:</span>
Expand Down Expand Up @@ -197,7 +197,7 @@ <h1>Source code for rxn.chemutils.conversion</h1><div class="highlight"><pre>

<span class="sd"> Mainly a wrapper around MolToMolBlock.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">MolToMolBlock</span><span class="p">(</span><span class="n">mol</span><span class="p">)</span> <span class="c1"># type: ignore</span></div>
<span class="k">return</span> <span class="n">MolToMolBlock</span><span class="p">(</span><span class="n">mol</span><span class="p">)</span></div>


<div class="viewcode-block" id="sanitize_mol"><a class="viewcode-back" href="../../../generated/rxn.chemutils.conversion.sanitize_mol.html#rxn.chemutils.conversion.sanitize_mol">[docs]</a><span class="k">def</span> <span class="nf">sanitize_mol</span><span class="p">(</span>
Expand Down Expand Up @@ -306,7 +306,7 @@ <h1>Source code for rxn.chemutils.conversion</h1><div class="highlight"><pre>

<span class="c1"># Sanitization as a separate step, to enable exclusion of valence check</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">excluded_sanitizations</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">excluded_sanitizations</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">SanitizeFlags</span> <span class="o">|</span> <span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">check_valence</span><span class="p">:</span>
<span class="n">excluded_sanitizations</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Chem</span><span class="o">.</span><span class="n">SANITIZE_PROPERTIES</span><span class="p">)</span>
<span class="n">sanitize_mol</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">exclude_sanitizations</span><span class="o">=</span><span class="n">excluded_sanitizations</span><span class="p">)</span>
Expand Down
4 changes: 2 additions & 2 deletions _modules/rxn/chemutils/miscellaneous.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h1>Source code for rxn.chemutils.miscellaneous</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">mol</span><span class="p">:</span> <span class="n">Mol</span> <span class="o">=</span> <span class="n">AddHs</span><span class="p">(</span><span class="n">smiles_to_mol</span><span class="p">(</span><span class="n">smiles</span><span class="p">,</span> <span class="n">sanitize</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span>
<span class="n">atoms</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Atom</span><span class="p">]</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">GetAtoms</span><span class="p">()</span>
<span class="n">atoms</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Atom</span><span class="p">]</span> <span class="o">=</span> <span class="n">mol</span><span class="o">.</span><span class="n">GetAtoms</span><span class="p">()</span> <span class="c1"># type: ignore[call-arg,no-untyped-call]</span>
<span class="k">return</span> <span class="n">Counter</span><span class="p">(</span><span class="n">atom</span><span class="o">.</span><span class="n">GetSymbol</span><span class="p">()</span> <span class="k">for</span> <span class="n">atom</span> <span class="ow">in</span> <span class="n">atoms</span><span class="p">)</span></div>


Expand Down Expand Up @@ -394,7 +394,7 @@ <h1>Source code for rxn.chemutils.miscellaneous</h1><div class="highlight"><pre>
<span class="sd"> mol: RDKit Mol.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">atom</span><span class="p">:</span> <span class="n">Atom</span>
<span class="k">for</span> <span class="n">atom</span> <span class="ow">in</span> <span class="n">mol</span><span class="o">.</span><span class="n">GetAtoms</span><span class="p">():</span>
<span class="k">for</span> <span class="n">atom</span> <span class="ow">in</span> <span class="n">mol</span><span class="o">.</span><span class="n">GetAtoms</span><span class="p">():</span> <span class="c1"># type: ignore[call-arg,no-untyped-call]</span>
<span class="k">if</span> <span class="n">atom</span><span class="o">.</span><span class="n">GetAtomMapNum</span><span class="p">()</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">return</span> <span class="kc">False</span></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<h1>rxn.chemutils.reaction_smiles.ReactionFormat<a class="headerlink" href="#rxn-chemutils-reaction-smiles-reactionformat" title="Permalink to this heading"></a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="rxn.chemutils.reaction_smiles.ReactionFormat">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">rxn.chemutils.reaction_smiles.</span></span><span class="sig-name descname"><span class="pre">ReactionFormat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">names</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">values</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">module</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qualname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">start</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">boundary</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/rxn/chemutils/reaction_smiles.html#ReactionFormat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#rxn.chemutils.reaction_smiles.ReactionFormat" title="Permalink to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">rxn.chemutils.reaction_smiles.</span></span><span class="sig-name descname"><span class="pre">ReactionFormat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">names=&lt;not</span> <span class="pre">given&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">*values</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">module=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qualname=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">start=1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">boundary=None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/rxn/chemutils/reaction_smiles.html#ReactionFormat"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#rxn.chemutils.reaction_smiles.ReactionFormat" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">RxnEnum</span></code></p>
<p>Existing reaction SMILES formats.</p>
<dl class="py attribute">
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 32ef51b

Please sign in to comment.