Skip to content

Commit

Permalink
deploy: 9e5c210
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Sep 2, 2024
1 parent 54bbb60 commit 050d3f7
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 11 deletions.
30 changes: 23 additions & 7 deletions _modules/arc/species/conformers.html
Original file line number Diff line number Diff line change
Expand Up @@ -683,15 +683,23 @@ <h1>Source code for arc.species.conformers</h1><div class="highlight"><pre>
<span class="n">newest_conformers_dict</span><span class="p">[</span><span class="n">tor</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span> <span class="c1"># Keys are torsions for plotting.</span>
<span class="k">for</span> <span class="n">xyz</span><span class="p">,</span> <span class="n">energy</span><span class="p">,</span> <span class="n">dihedral</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">xyzs</span><span class="p">,</span> <span class="n">energies</span><span class="p">,</span> <span class="n">sampling_points</span><span class="p">):</span>
<span class="n">exists</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">if</span> <span class="nb">any</span><span class="p">([</span><span class="n">converter</span><span class="o">.</span><span class="n">compare_confs</span><span class="p">(</span><span class="n">xyz</span><span class="p">,</span> <span class="n">conf</span><span class="p">[</span><span class="s1">&#39;xyz&#39;</span><span class="p">])</span> <span class="k">for</span> <span class="n">conf</span> <span class="ow">in</span> <span class="n">new_conformers</span> <span class="o">+</span> <span class="n">newest_conformer_list</span><span class="p">]):</span>
<span class="n">exists</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">dmat1</span><span class="p">,</span> <span class="n">fl_distance1</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span>
<span class="k">for</span> <span class="n">conf</span> <span class="ow">in</span> <span class="n">new_conformers</span> <span class="o">+</span> <span class="n">newest_conformer_list</span><span class="p">:</span>
<span class="n">fl_distance1</span><span class="p">,</span> <span class="n">dmat1</span><span class="p">,</span> <span class="n">conf</span><span class="p">,</span> <span class="n">similar</span> <span class="o">=</span> <span class="n">converter</span><span class="o">.</span><span class="n">compare_confs_fl</span><span class="p">(</span><span class="n">xyz</span><span class="p">,</span><span class="n">conf</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">similar</span><span class="p">:</span>
<span class="k">break</span>
<span class="k">if</span> <span class="n">converter</span><span class="o">.</span><span class="n">compare_confs</span><span class="p">(</span><span class="n">xyz</span><span class="p">,</span> <span class="n">conf</span><span class="p">[</span><span class="s1">&#39;xyz&#39;</span><span class="p">],</span> <span class="n">skip_conversion</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dmat1</span><span class="o">=</span><span class="n">dmat1</span><span class="p">,</span> <span class="n">dmat2</span><span class="o">=</span><span class="n">conf</span><span class="p">[</span><span class="s1">&#39;dmat&#39;</span><span class="p">]):</span>
<span class="n">exists</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">break</span>
<span class="k">if</span> <span class="n">xyz</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">energy</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">conformer</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;index&#39;</span><span class="p">:</span> <span class="n">len_conformers</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">new_conformers</span><span class="p">)</span> <span class="o">+</span> <span class="nb">len</span><span class="p">(</span><span class="n">newest_conformer_list</span><span class="p">),</span>
<span class="s1">&#39;xyz&#39;</span><span class="p">:</span> <span class="n">xyz</span><span class="p">,</span>
<span class="s1">&#39;FF energy&#39;</span><span class="p">:</span> <span class="nb">round</span><span class="p">(</span><span class="n">energy</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
<span class="s1">&#39;source&#39;</span><span class="p">:</span> <span class="sa">f</span><span class="s1">&#39;Changing dihedrals on most stable conformer, iteration </span><span class="si">{</span><span class="n">i</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">,</span>
<span class="s1">&#39;torsion&#39;</span><span class="p">:</span> <span class="n">tor</span><span class="p">,</span>
<span class="s1">&#39;dihedral&#39;</span><span class="p">:</span> <span class="nb">round</span><span class="p">(</span><span class="n">dihedral</span><span class="p">,</span> <span class="mi">2</span><span class="p">)}</span>
<span class="s1">&#39;dihedral&#39;</span><span class="p">:</span> <span class="nb">round</span><span class="p">(</span><span class="n">dihedral</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
<span class="s1">&#39;dmat&#39;</span><span class="p">:</span> <span class="n">dmat1</span><span class="p">,</span>
<span class="s1">&#39;fl_distance&#39;</span><span class="p">:</span> <span class="n">fl_distance1</span><span class="p">}</span>
<span class="n">newest_conformers_dict</span><span class="p">[</span><span class="n">tor</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">conformer</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">exists</span><span class="p">:</span>
<span class="n">newest_conformer_list</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">conformer</span><span class="p">)</span>
Expand All @@ -705,7 +713,9 @@ <h1>Source code for arc.species.conformers</h1><div class="highlight"><pre>
<span class="s1">&#39;FF energy&#39;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s1">&#39;source&#39;</span><span class="p">:</span> <span class="sa">f</span><span class="s1">&#39;Changing dihedrals on most stable conformer, iteration </span><span class="si">{</span><span class="n">i</span><span class="si">}</span><span class="s1">, but FF energy is None&#39;</span><span class="p">,</span>
<span class="s1">&#39;torsion&#39;</span><span class="p">:</span> <span class="n">tor</span><span class="p">,</span>
<span class="s1">&#39;dihedral&#39;</span><span class="p">:</span> <span class="nb">round</span><span class="p">(</span><span class="n">dihedral</span><span class="p">,</span> <span class="mi">2</span><span class="p">)})</span>
<span class="s1">&#39;dihedral&#39;</span><span class="p">:</span> <span class="nb">round</span><span class="p">(</span><span class="n">dihedral</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
<span class="s1">&#39;dmat&#39;</span><span class="p">:</span> <span class="n">dmat1</span><span class="p">,</span>
<span class="s1">&#39;fl_distance&#39;</span><span class="p">:</span> <span class="n">fl_distance1</span><span class="p">})</span>
<span class="n">new_conformers</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">newest_conformer_list</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">newest_conformer_list</span><span class="p">:</span>
<span class="n">newest_conformer_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">lowest_conf_i</span><span class="p">]</span>
Expand Down Expand Up @@ -1277,9 +1287,15 @@ <h1>Source code for arc.species.conformers</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">index</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">conformer_list</span><span class="p">)):</span>
<span class="k">if</span> <span class="p">(</span><span class="n">e</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">conformer_list</span><span class="p">[</span><span class="n">index</span><span class="p">][</span><span class="n">energy</span><span class="p">]</span> <span class="o">&gt;</span> <span class="n">min_e</span> <span class="o">+</span> <span class="n">e</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">n</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">lowest_confs</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="n">n</span><span class="p">):</span>
<span class="k">break</span>
<span class="k">if</span> <span class="n">index</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">any</span><span class="p">([</span><span class="n">converter</span><span class="o">.</span><span class="n">compare_confs</span><span class="p">(</span><span class="n">lowest_conf</span><span class="p">[</span><span class="s1">&#39;xyz&#39;</span><span class="p">],</span> <span class="n">conformer_list</span><span class="p">[</span><span class="n">index</span><span class="p">][</span><span class="s1">&#39;xyz&#39;</span><span class="p">])</span>
<span class="k">for</span> <span class="n">lowest_conf</span> <span class="ow">in</span> <span class="n">lowest_confs</span><span class="p">]):</span>
<span class="n">lowest_confs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">conformer_list</span><span class="p">[</span><span class="n">index</span><span class="p">])</span>
<span class="k">if</span> <span class="n">index</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">for</span> <span class="n">lowest_conf</span> <span class="ow">in</span> <span class="n">lowest_confs</span><span class="p">:</span>
<span class="n">_</span><span class="p">,</span> <span class="n">dmat1</span><span class="p">,</span> <span class="n">lowest_conf</span><span class="p">,</span> <span class="n">similar</span> <span class="o">=</span> <span class="n">converter</span><span class="o">.</span><span class="n">compare_confs_fl</span><span class="p">(</span><span class="n">conformer_list</span><span class="p">[</span><span class="n">index</span><span class="p">][</span><span class="s1">&#39;xyz&#39;</span><span class="p">],</span><span class="n">lowest_conf</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">similar</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">converter</span><span class="o">.</span><span class="n">compare_confs</span><span class="p">(</span><span class="n">conformer_list</span><span class="p">[</span><span class="n">index</span><span class="p">][</span><span class="s1">&#39;xyz&#39;</span><span class="p">],</span> <span class="n">lowest_conf</span><span class="p">[</span><span class="s1">&#39;xyz&#39;</span><span class="p">],</span>
<span class="n">skip_conversion</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">dmat1</span><span class="o">=</span><span class="n">dmat1</span><span class="p">,</span><span class="n">dmat2</span><span class="o">=</span><span class="n">lowest_conf</span><span class="p">[</span><span class="s1">&#39;dmat&#39;</span><span class="p">]):</span>
<span class="n">lowest_confs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">conformer_list</span><span class="p">[</span><span class="n">index</span><span class="p">])</span> <span class="k">if</span> <span class="n">lowest_conf</span><span class="o">==</span><span class="n">lowest_confs</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">else</span> <span class="kc">None</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">break</span>
<span class="k">return</span> <span class="n">lowest_confs</span></div>


Expand Down
Loading

0 comments on commit 050d3f7

Please sign in to comment.