Skip to content

Commit

Permalink
deploy: 2edb8ae
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Oct 11, 2023
1 parent c593ec5 commit 75a804b
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 68 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/index.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-bandplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-bandstats.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-dosplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-kgen.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-optplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-phonon-bandplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo.plotting.doctree
Binary file not shown.
34 changes: 25 additions & 9 deletions _modules/sumo/cli/bandplot.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">warnings</span>

<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">importlib.resources</span> <span class="kn">import</span> <span class="n">files</span> <span class="k">as</span> <span class="n">ilr_files</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span> <span class="c1"># Python &lt; 3.9</span>
<span class="kn">from</span> <span class="nn">importlib_resources</span> <span class="kn">import</span> <span class="n">files</span> <span class="k">as</span> <span class="n">ilr_files</span>
<span class="kn">import</span> <span class="nn">matplotlib</span> <span class="k">as</span> <span class="nn">mpl</span>
<span class="kn">from</span> <span class="nn">pkg_resources</span> <span class="kn">import</span> <span class="n">Requirement</span><span class="p">,</span> <span class="n">resource_filename</span>
<span class="kn">from</span> <span class="nn">pymatgen.electronic_structure.bandstructure</span> <span class="kn">import</span> <span class="n">get_reconstructed_band_structure</span>
<span class="kn">from</span> <span class="nn">pymatgen.electronic_structure.bandstructure</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">get_reconstructed_band_structure</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">pymatgen.electronic_structure.core</span> <span class="kn">import</span> <span class="n">Spin</span>
<span class="kn">from</span> <span class="nn">pymatgen.io.vasp.outputs</span> <span class="kn">import</span> <span class="n">BSVasprun</span>

Expand Down Expand Up @@ -372,6 +377,7 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>

<span class="c1"># currently not supported as it is a pain to make subplots within subplots,</span>
<span class="c1"># although need to check this is still the case</span>
<span class="c1"># FIXME: is this necessary if mode can only be &quot;rgb&quot; and &quot;stacked&quot;?</span>
<span class="k">if</span> <span class="s2">&quot;split&quot;</span> <span class="ow">in</span> <span class="n">mode</span> <span class="ow">and</span> <span class="n">dos_file</span><span class="p">:</span>
<span class="n">logging</span><span class="o">.</span><span class="n">error</span><span class="p">(</span>
<span class="s2">&quot;ERROR: Plotting split projected band structure with DOS&quot;</span>
Expand Down Expand Up @@ -420,7 +426,9 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="k">else</span><span class="p">:</span>
<span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Found PDOS file </span><span class="si">{</span><span class="n">pdos_file</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Cell file </span><span class="si">{</span><span class="n">cell_file</span><span class="si">}</span><span class="s2"> does not exist, cannot plot PDOS.&quot;</span><span class="p">)</span>
<span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Cell file </span><span class="si">{</span><span class="n">cell_file</span><span class="si">}</span><span class="s2"> does not exist, cannot plot PDOS.&quot;</span>
<span class="p">)</span>

<span class="n">dos</span><span class="p">,</span> <span class="n">pdos</span> <span class="o">=</span> <span class="n">read_castep_dos</span><span class="p">(</span>
<span class="n">dos_file</span><span class="p">,</span>
Expand Down Expand Up @@ -649,7 +657,8 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="s2">&quot;-c&quot;</span><span class="p">,</span>
<span class="s2">&quot;--code&quot;</span><span class="p">,</span>
<span class="n">default</span><span class="o">=</span><span class="s2">&quot;vasp&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Electronic structure code (default: vasp).&quot;</span> <span class="s1">&#39;&quot;questaal&quot; also supported.&#39;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Electronic structure code (default: vasp).&quot;</span>
<span class="s1">&#39;&quot;questaal&quot; also supported.&#39;</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
<span class="s2">&quot;-p&quot;</span><span class="p">,</span> <span class="s2">&quot;--prefix&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;P&quot;</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">&quot;prefix for the files generated&quot;</span>
Expand Down Expand Up @@ -790,7 +799,10 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="s2">&quot;--orbitals&quot;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="n">_el_orb</span><span class="p">,</span>
<span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;O&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="p">(</span><span class="s2">&quot;orbitals to split into lm-decomposed &quot;</span> <span class="s1">&#39;contributions (e.g. &quot;Ru.d&quot;)&#39;</span><span class="p">),</span>
<span class="n">help</span><span class="o">=</span><span class="p">(</span>
<span class="s2">&quot;orbitals to split into lm-decomposed &quot;</span>
<span class="s1">&#39;contributions (e.g. &quot;Ru.d&quot;)&#39;</span>
<span class="p">),</span>
<span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
<span class="s2">&quot;--atoms&quot;</span><span class="p">,</span>
Expand Down Expand Up @@ -854,7 +866,9 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
<span class="s2">&quot;--height&quot;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">float</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">&quot;height of the graph&quot;</span>
<span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--width&quot;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">float</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">&quot;width of the graph&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
<span class="s2">&quot;--width&quot;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">float</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">&quot;width of the graph&quot;</span>
<span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span>
<span class="s2">&quot;--ymin&quot;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">float</span><span class="p">,</span> <span class="n">default</span><span class="o">=-</span><span class="mf">6.0</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s2">&quot;minimum energy on the y-axis&quot;</span>
<span class="p">)</span>
Expand Down Expand Up @@ -905,16 +919,18 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">console</span><span class="p">)</span>

<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">config</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">config_path</span> <span class="o">=</span> <span class="n">resource_filename</span><span class="p">(</span>
<span class="n">Requirement</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="s2">&quot;sumo&quot;</span><span class="p">),</span> <span class="s2">&quot;sumo/plotting/orbital_colours.conf&quot;</span>
<span class="n">config_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">ilr_files</span><span class="p">(</span><span class="s2">&quot;sumo.plotting&quot;</span><span class="p">),</span> <span class="s2">&quot;orbital_colours.conf&quot;</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">config_path</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">config</span>
<span class="n">colours</span> <span class="o">=</span> <span class="n">configparser</span><span class="o">.</span><span class="n">ConfigParser</span><span class="p">()</span>
<span class="n">colours</span><span class="o">.</span><span class="n">read</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">abspath</span><span class="p">(</span><span class="n">config_path</span><span class="p">))</span>

<span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">&quot;ignore&quot;</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="ne">UserWarning</span><span class="p">,</span> <span class="n">module</span><span class="o">=</span><span class="s2">&quot;matplotlib&quot;</span><span class="p">)</span>
<span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">&quot;ignore&quot;</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="ne">UnicodeWarning</span><span class="p">,</span> <span class="n">module</span><span class="o">=</span><span class="s2">&quot;matplotlib&quot;</span><span class="p">)</span>
<span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span>
<span class="s2">&quot;ignore&quot;</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="ne">UnicodeWarning</span><span class="p">,</span> <span class="n">module</span><span class="o">=</span><span class="s2">&quot;matplotlib&quot;</span>
<span class="p">)</span>
<span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">&quot;ignore&quot;</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="ne">UserWarning</span><span class="p">,</span> <span class="n">module</span><span class="o">=</span><span class="s2">&quot;pymatgen&quot;</span><span class="p">)</span>

<span class="n">bandplot</span><span class="p">(</span>
Expand Down
Loading

0 comments on commit 75a804b

Please sign in to comment.