Skip to content

Commit

Permalink
deploy: 5f2e420
Browse files Browse the repository at this point in the history
  • Loading branch information
kfir4444 committed Nov 20, 2024
1 parent 050d3f7 commit a85eb96
Show file tree
Hide file tree
Showing 17 changed files with 411 additions and 150 deletions.
8 changes: 3 additions & 5 deletions _modules/arc/common.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ <h1>Source code for arc.common</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="s1">&#39;fine_grid&#39;</span> <span class="ow">in</span> <span class="n">job_types</span><span class="p">:</span>
<span class="k">del</span> <span class="n">job_types</span><span class="p">[</span><span class="s1">&#39;fine_grid&#39;</span><span class="p">]</span>

<span class="n">defaults_to_true</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;conformers&#39;</span><span class="p">,</span> <span class="s1">&#39;fine&#39;</span><span class="p">,</span> <span class="s1">&#39;freq&#39;</span><span class="p">,</span> <span class="s1">&#39;irc&#39;</span><span class="p">,</span> <span class="s1">&#39;opt&#39;</span><span class="p">,</span> <span class="s1">&#39;rotors&#39;</span><span class="p">,</span> <span class="s1">&#39;sp&#39;</span><span class="p">]</span>
<span class="n">defaults_to_false</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;bde&#39;</span><span class="p">,</span> <span class="s1">&#39;onedmin&#39;</span><span class="p">,</span> <span class="s1">&#39;orbitals&#39;</span><span class="p">]</span>
<span class="n">defaults_to_true</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;conf_opt&#39;</span><span class="p">,</span> <span class="s1">&#39;fine&#39;</span><span class="p">,</span> <span class="s1">&#39;freq&#39;</span><span class="p">,</span> <span class="s1">&#39;irc&#39;</span><span class="p">,</span> <span class="s1">&#39;opt&#39;</span><span class="p">,</span> <span class="s1">&#39;rotors&#39;</span><span class="p">,</span> <span class="s1">&#39;sp&#39;</span><span class="p">]</span>
<span class="n">defaults_to_false</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;conf_sp&#39;</span><span class="p">,</span> <span class="s1">&#39;bde&#39;</span><span class="p">,</span> <span class="s1">&#39;onedmin&#39;</span><span class="p">,</span> <span class="s1">&#39;orbitals&#39;</span><span class="p">]</span>
<span class="k">if</span> <span class="n">job_types</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">job_types</span> <span class="o">=</span> <span class="n">default_job_types</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Job types were not specified, using ARC&#39;s defaults&quot;</span><span class="p">)</span>
Expand Down Expand Up @@ -920,9 +920,7 @@ <h1>Source code for arc.common</h1><div class="highlight"><pre>
<span class="sd"> Returns: Optional[Union[int, None]]</span>
<span class="sd"> The entry with the minimal/maximal value.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">lst</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">None</span>
<span class="k">elif</span> <span class="nb">all</span><span class="p">([</span><span class="n">entry</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">]):</span>
<span class="k">if</span> <span class="n">lst</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span><span class="n">lst</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">or</span> <span class="nb">all</span><span class="p">([</span><span class="n">entry</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">]):</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">lst</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">return</span> <span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
Expand Down
188 changes: 160 additions & 28 deletions _modules/arc/job/trsh.html

Large diffs are not rendered by default.

34 changes: 24 additions & 10 deletions _modules/arc/main.html

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions _modules/arc/plotter.html
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,8 @@ <h1>Source code for arc.plotter</h1><div class="highlight"><pre>
<span class="n">ts_methods</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">im_freqs</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">float</span><span class="p">]]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">log_content</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">before_optimization</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="n">sp_flag</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Save the conformers before or after optimization.</span>
Expand All @@ -1082,23 +1084,28 @@ <h1>Source code for arc.plotter</h1><div class="highlight"><pre>
<span class="sd"> ts_methods (list, optional): Entries are method names used to generate the TS guess.</span>
<span class="sd"> im_freqs (list, optional): Entries lists of imaginary frequencies.</span>
<span class="sd"> log_content (bool): Whether to log the content of the conformers file. ``True`` to log, default is ``False``.</span>
<span class="sd"> before_optimization (bool): Whether the conformers are before DFT optimization. ``True`` for before, default is ``True``.</span>
<span class="sd"> sp_flag (bool): Whether the conformers are single point calculations. ``True`` for single point, default is ``False``.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">spc_dir</span> <span class="o">=</span> <span class="s1">&#39;rxns&#39;</span> <span class="k">if</span> <span class="n">is_ts</span> <span class="k">else</span> <span class="s1">&#39;Species&#39;</span>
<span class="n">geo_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">project_directory</span><span class="p">,</span> <span class="s1">&#39;output&#39;</span><span class="p">,</span> <span class="n">spc_dir</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="s1">&#39;geometry&#39;</span><span class="p">,</span> <span class="s1">&#39;conformers&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">geo_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">geo_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="n">energies</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="nb">any</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="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">energies</span><span class="p">):</span>
<span class="n">optimized</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">min_e</span> <span class="o">=</span> <span class="n">extremum_list</span><span class="p">(</span><span class="n">energies</span><span class="p">,</span> <span class="n">return_min</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">conf_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">geo_dir</span><span class="p">,</span> <span class="s1">&#39;conformers_after_optimization.txt&#39;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">optimized</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">if</span> <span class="n">before_optimization</span><span class="p">:</span>
<span class="n">conf_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">geo_dir</span><span class="p">,</span> <span class="s1">&#39;conformers_before_optimization.txt&#39;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">conf_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">geo_dir</span><span class="p">,</span> <span class="s1">&#39;conformers_after_optimization.txt&#39;</span><span class="p">)</span>
<span class="n">min_e</span> <span class="o">=</span> <span class="n">extremum_list</span><span class="p">(</span><span class="n">energies</span><span class="p">,</span> <span class="n">return_min</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">conf_path</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">content</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
<span class="k">if</span> <span class="n">optimized</span><span class="p">:</span>
<span class="k">if</span> <span class="n">before_optimization</span><span class="p">:</span>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;Conformers for </span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s1">, computed using a force field:</span><span class="se">\n\n</span><span class="s1">&#39;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">level_of_theory</span> <span class="o">=</span> <span class="n">level_of_theory</span><span class="o">.</span><span class="n">simple</span><span class="p">()</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">level_of_theory</span><span class="p">,</span> <span class="n">Level</span><span class="p">)</span> <span class="k">else</span> <span class="n">level_of_theory</span>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;Conformers for </span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s1">, optimized at the </span><span class="si">{</span><span class="n">level_of_theory</span><span class="si">}</span><span class="s1"> level:</span><span class="se">\n\n</span><span class="s1">&#39;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">sp_flag</span><span class="p">:</span>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;Conformers for </span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s1">, optimized at the </span><span class="si">{</span><span class="n">level_of_theory</span><span class="si">}</span><span class="s1"> level:</span><span class="se">\n\n</span><span class="s1">&#39;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;Conformers for </span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s1">, single point calculation at the </span><span class="si">{</span><span class="n">level_of_theory</span><span class="si">}</span><span class="s1"> level:</span><span class="se">\n\n</span><span class="s1">&#39;</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">xyz</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">xyzs</span><span class="p">):</span>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;conformer </span><span class="si">{</span><span class="n">i</span><span class="si">}</span><span class="s1">:</span><span class="se">\n</span><span class="s1">&#39;</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="p">:</span>
Expand All @@ -1114,7 +1121,7 @@ <h1>Source code for arc.plotter</h1><div class="highlight"><pre>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;TS guess method: </span><span class="si">{</span><span class="n">ts_methods</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span>
<span class="k">if</span> <span class="n">im_freqs</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">im_freqs</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">content</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;Imaginary frequencies: </span><span class="si">{</span><span class="n">im_freqs</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span>
<span class="k">if</span> <span class="n">optimized</span><span class="p">:</span>
<span class="k">if</span> <span class="n">min_e</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">energies</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">min_e</span><span class="p">:</span>
<span class="n">content</span> <span class="o">+=</span> <span class="s1">&#39;Relative Energy: 0 kJ/mol (lowest)&#39;</span>
<span class="k">elif</span> <span class="n">energies</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
Expand Down
Loading

0 comments on commit a85eb96

Please sign in to comment.