Skip to content

Commit

Permalink
Documentation build
Browse files Browse the repository at this point in the history
  • Loading branch information
YHordijk authored and github-actions[bot] committed May 7, 2024
1 parent 0079387 commit f3a5d97
Show file tree
Hide file tree
Showing 17 changed files with 710 additions and 12 deletions.
Binary file modified docs/_build/doctrees/api/tcutility.data.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/api/tcutility.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/cli_scripts/main.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
1 change: 1 addition & 0 deletions docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ <h1>All modules for which code is available</h1>
<li><a href="tcutility/analysis/vdd/manager.html">tcutility.analysis.vdd.manager</a></li>
<li><a href="tcutility/analysis/vibration/ts_vibration.html">tcutility.analysis.vibration.ts_vibration</a></li>
<li><a href="tcutility/cache.html">tcutility.cache</a></li>
<li><a href="tcutility/cite.html">tcutility.cite</a></li>
<li><a href="tcutility/data/atom.html">tcutility.data.atom</a></li>
<li><a href="tcutility/data/basis_sets.html">tcutility.data.basis_sets</a></li>
<li><a href="tcutility/data/functionals.html">tcutility.data.functionals</a></li>
Expand Down
536 changes: 536 additions & 0 deletions docs/_build/html/_modules/tcutility/cite.html

Large diffs are not rendered by default.

39 changes: 32 additions & 7 deletions docs/_build/html/_modules/tcutility/data/functionals.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ <h1>Source code for tcutility.data.functionals</h1><div class="highlight"><pre>
<span class="sd">&#39;&#39;&#39;</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">tcutility</span> <span class="kn">import</span> <span class="n">results</span><span class="p">,</span> <span class="n">cache</span>
<span class="kn">import</span> <span class="nn">re</span>


<span class="n">j</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>
Expand Down Expand Up @@ -341,6 +342,7 @@ <h1>Source code for tcutility.data.functionals</h1><div class="highlight"><pre>
<span class="sd"> - ``adf_settings`` **(:class:`Result &lt;tcutility.results.result.Result&gt;`)** - the settings that are used to select the functional in the ADF input.</span>
<span class="sd"> - ``name_latex`` **(str)** - the name of the functional formatted to be used with LaTeX renderers.</span>
<span class="sd"> - ``name_html`` **(str)** - the name of the functional formatted to be used with HTML renderers.</span>
<span class="sd"> - ``dois`` **(List[str])** - a list of relevant dois for this functional.</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">def</span> <span class="nf">set_dispersion</span><span class="p">(</span><span class="n">func</span><span class="p">):</span>
<span class="n">disp_map</span> <span class="o">=</span> <span class="p">{</span>
Expand Down Expand Up @@ -429,6 +431,22 @@ <h1>Source code for tcutility.data.functionals</h1><div class="highlight"><pre>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">j</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;available_functionals.txt&#39;</span><span class="p">))</span> <span class="k">as</span> <span class="n">file</span><span class="p">:</span>
<span class="n">lines</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">readlines</span><span class="p">()</span>

<span class="c1"># read the references first</span>
<span class="c1"># references are given as </span>
<span class="c1"># [refname] doi</span>
<span class="c1"># and in-line</span>
<span class="c1"># - xcname {options} [refname1][refname2]...</span>
<span class="n">dois</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">):</span>
<span class="k">continue</span>

<span class="n">line</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;#&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>

<span class="n">ref</span><span class="p">,</span> <span class="n">doi</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
<span class="n">ref</span> <span class="o">=</span> <span class="n">ref</span><span class="p">[</span><span class="mi">1</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">dois</span><span class="p">[</span><span class="n">ref</span><span class="p">]</span> <span class="o">=</span> <span class="n">doi</span>

<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
<span class="c1"># there can be empty lines</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">():</span>
Expand All @@ -438,21 +456,27 @@ <h1>Source code for tcutility.data.functionals</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;#&#39;</span><span class="p">):</span>
<span class="k">continue</span>

<span class="c1"># we don&#39;t read the references here</span>
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">):</span>
<span class="k">continue</span>

<span class="c1"># functional names are given starting with -</span>
<span class="c1"># category names without -</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;- &#39;</span><span class="p">):</span>
<span class="n">curr_category</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="k">continue</span>

<span class="n">line</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;#&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>

<span class="c1"># store data about the func in a dict</span>
<span class="n">func</span> <span class="o">=</span> <span class="n">results</span><span class="o">.</span><span class="n">Result</span><span class="p">()</span>
<span class="n">func</span><span class="o">.</span><span class="n">category</span> <span class="o">=</span> <span class="n">curr_category</span>
<span class="c1"># separate the functional name from the line</span>
<span class="n">functional_name</span> <span class="o">=</span> <span class="n">line</span><span class="p">[</span><span class="mi">2</span><span class="p">:]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;!&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;,&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="n">functional_name</span> <span class="o">=</span> <span class="n">line</span><span class="p">[</span><span class="mi">2</span><span class="p">:]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;!&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;,&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;[&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="n">func</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">functional_name</span>
<span class="n">func</span><span class="o">.</span><span class="n">name_latex</span> <span class="o">=</span> <span class="n">functional_name</span>
<span class="n">func</span><span class="o">.</span><span class="n">name_html</span> <span class="o">=</span> <span class="n">functional_name</span>
<span class="n">func</span><span class="o">.</span><span class="n">path_safe_name</span> <span class="o">=</span> <span class="n">functional_name</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="s1">&#39;s&#39;</span><span class="p">)</span>
<span class="n">func</span><span class="o">.</span><span class="n">path_safe_name</span> <span class="o">=</span> <span class="n">functional_name</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="s1">&#39;s&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">,</span> <span class="s1">&#39;-&#39;</span><span class="p">)</span>

<span class="k">if</span> <span class="n">functional_name</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;WB&#39;</span><span class="p">):</span>
<span class="n">func</span><span class="o">.</span><span class="n">name_latex</span> <span class="o">=</span> <span class="n">func</span><span class="o">.</span><span class="n">name_latex</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">&#39;WB&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;$\omega$B&#39;</span><span class="p">)</span>
Expand All @@ -476,14 +500,19 @@ <h1>Source code for tcutility.data.functionals</h1><div class="highlight"><pre>

<span class="c1"># check if custom params were given for dispersion</span>
<span class="k">if</span> <span class="s1">&#39;GRIMME&#39;</span> <span class="ow">in</span> <span class="n">line</span><span class="p">:</span>
<span class="n">func</span><span class="o">.</span><span class="n">disp_params</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;!&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;,&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s2">&quot;&#39;&quot;</span><span class="p">)</span>
<span class="c1"># func.disp_params = line.split(&#39;!&#39;)[0].split(&#39;,&#39;)[1].strip().strip(&quot;&#39;&quot;)</span>
<span class="n">func</span><span class="o">.</span><span class="n">disp_params</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;&#39;(.*)&#39;&quot;</span><span class="p">,</span> <span class="n">line</span><span class="p">)</span>

<span class="n">func</span><span class="o">.</span><span class="n">use_libxc</span> <span class="o">=</span> <span class="s1">&#39;!libxc&#39;</span> <span class="ow">in</span> <span class="n">line</span>
<span class="n">func</span><span class="o">.</span><span class="n">includes_disp</span> <span class="o">=</span> <span class="s1">&#39;!includesdisp&#39;</span> <span class="ow">in</span> <span class="n">line</span>
<span class="n">func</span><span class="o">.</span><span class="n">available_in_adf</span> <span class="o">=</span> <span class="s1">&#39;!noadf&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">line</span>
<span class="n">func</span><span class="o">.</span><span class="n">available_in_band</span> <span class="o">=</span> <span class="s1">&#39;!band&#39;</span> <span class="ow">in</span> <span class="n">line</span>
<span class="n">func</span><span class="o">.</span><span class="n">available_in_orca</span> <span class="o">=</span> <span class="s1">&#39;!orca&#39;</span> <span class="ow">in</span> <span class="n">line</span>

<span class="c1"># get references</span>
<span class="n">refs</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;\[([a-zA-Z0-9]+)\]&#39;</span><span class="p">,</span> <span class="n">line</span><span class="p">)</span>
<span class="n">func</span><span class="o">.</span><span class="n">dois</span> <span class="o">=</span> <span class="p">[</span><span class="n">dois</span><span class="p">[</span><span class="n">ref</span><span class="p">]</span> <span class="k">for</span> <span class="n">ref</span> <span class="ow">in</span> <span class="n">refs</span><span class="p">]</span>

<span class="n">set_dispersion</span><span class="p">(</span><span class="n">func</span><span class="p">)</span>
<span class="n">set_functional</span><span class="p">(</span><span class="n">func</span><span class="p">)</span>

Expand All @@ -498,10 +527,6 @@ <h1>Source code for tcutility.data.functionals</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">functional</span> <span class="ow">in</span> <span class="n">functionals</span><span class="p">:</span>
<span class="k">if</span> <span class="n">get</span><span class="p">(</span><span class="n">functional</span><span class="p">)</span><span class="o">.</span><span class="n">category</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">categories</span><span class="p">:</span>
<span class="n">categories</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">get</span><span class="p">(</span><span class="n">functional</span><span class="p">)</span><span class="o">.</span><span class="n">category</span><span class="p">)</span>

<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
<span class="c1"># log.log(get(&#39;OLYP_D3BJ&#39;))</span>
<span class="nb">print</span><span class="p">(</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;VWN&#39;</span><span class="p">))</span>
</pre></div>

</article>
Expand Down
8 changes: 8 additions & 0 deletions docs/_build/html/_sources/api/tcutility.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ tcutility.cache module
:undoc-members:
:show-inheritance:

tcutility.cite module
---------------------

.. automodule:: tcutility.cite
:members:
:undoc-members:
:show-inheritance:

tcutility.constants module
--------------------------

Expand Down
4 changes: 4 additions & 0 deletions docs/_build/html/api/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ <h1>tcutility<a class="headerlink" href="#tcutility" title="Link to this heading
<li class="toctree-l3"><a class="reference internal" href="tcutility.html#tcutility.cache.cache"><code class="docutils literal notranslate"><span class="pre">cache()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="tcutility.html#module-tcutility.cite">tcutility.cite module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="tcutility.html#tcutility.cite.cite"><code class="docutils literal notranslate"><span class="pre">cite()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="tcutility.html#module-tcutility.constants">tcutility.constants module</a></li>
<li class="toctree-l2"><a class="reference internal" href="tcutility.html#module-tcutility.formula">tcutility.formula module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="tcutility.html#tcutility.formula.parse_molecule"><code class="docutils literal notranslate"><span class="pre">parse_molecule()</span></code></a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/_build/html/api/tcutility.data.html
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
<li><p><code class="docutils literal notranslate"><span class="pre">adf_settings</span></code> <strong>(:class:`Result &lt;tcutility.results.result.Result&gt;`)</strong> - the settings that are used to select the functional in the ADF input.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">name_latex</span></code> <strong>(str)</strong> - the name of the functional formatted to be used with LaTeX renderers.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">name_html</span></code> <strong>(str)</strong> - the name of the functional formatted to be used with HTML renderers.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">dois</span></code> <strong>(List[str])</strong> - a list of relevant dois for this functional.</p></li>
</ul>
</div></blockquote>
</dd>
Expand Down
Loading

0 comments on commit f3a5d97

Please sign in to comment.