Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix #96

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| | |___ ___ |___ |_____ ___ :|___/ ___ |___ ___ ___ |___ \
| | | | / \ | \ | | | / \:| / | | \ / / \ | \/
| | | | |___/ | | | | | |:| | | | \___ |___/ | \_____
| | | | \___ | | | | \___/:| \___|_ | \ \___ | :3.1.3\
| | | | \___ | | | | \___/:| \___|_ | \ \___ | :3.1.4\
|____________________________________:_______________________/____________:_____/


Expand Down Expand Up @@ -197,6 +197,13 @@ Roughly chronologically, they are so far:
* Katarina Brlec
* Joe Willis

Thanks also to the `JOSS`_ reviewers, Evan Walter Clarke
Spotte-Smith, Enric Tomás Grau-Luque, and Francesco Nattino; and the
editor Mojtaba Barzegari. An unintimidating and productive review
process, which I would recommend if the opportunity arises!

.. _JOSS: https://joss.theoj.org/

License
-------

Expand Down
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/gallery.doctree
Binary file not shown.
Binary file modified docs/.doctrees/heatmaps.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/phonons.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tp.cli.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tutorial-00.doctree
Binary file not shown.
Binary file modified docs/_images/wideband.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/_modules/tp.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ <h1>Source code for tp</h1><div class="highlight"><pre>
<span class="c1"># default values and metadata</span>
<span class="c1">#&quot;&quot;&quot;</span>

<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;3.1.4&#39;</span>

<div class="viewcode-block" id="docstring_replace"><a class="viewcode-back" href="../tp.html#tp.docstring_replace">[docs]</a><span class="k">def</span> <span class="nf">docstring_replace</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">d</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
<span class="n">f</span><span class="o">.</span><span class="vm">__doc__</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="vm">__doc__</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
Expand Down
217 changes: 119 additions & 98 deletions docs/_modules/tp/cli/options.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_modules/tp/plot/frequency.html
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ <h1>Source code for tp.plot.frequency</h1><div class="highlight"><pre>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_alpha</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_label</span><span class="p">(</span><span class="n">axlabels</span><span class="p">[</span><span class="n">projected</span><span class="p">])</span>
<span class="n">tp</span><span class="o">.</span><span class="n">plot</span><span class="o">.</span><span class="n">utilities</span><span class="o">.</span><span class="n">set_locators</span><span class="p">(</span><span class="n">cbar</span><span class="o">.</span><span class="n">ax</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">cbar</span><span class="o">.</span><span class="n">ax</span><span class="o">.</span><span class="n">yaxis</span><span class="o">.</span><span class="n">get_scale</span><span class="p">())</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">draw_all</span><span class="p">()</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">_draw_all</span><span class="p">()</span>

<span class="k">if</span> <span class="n">main</span><span class="p">:</span>
<span class="n">data</span><span class="p">[</span><span class="n">xquantity</span><span class="p">]</span> <span class="o">=</span> <span class="n">x</span>
Expand Down
15 changes: 7 additions & 8 deletions docs/_modules/tp/plot/heatmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,16 @@ <h1>Source code for tp.plot.heatmap</h1><div class="highlight"><pre>
<span class="c1"># plotting</span>
<span class="k">if</span> <span class="n">discrete</span><span class="p">:</span>
<span class="n">kwargs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;rasterized&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">levels</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">levels</span> <span class="o">==</span> <span class="p">():</span>
<span class="n">heat</span> <span class="o">=</span> <span class="n">ax</span><span class="o">.</span><span class="n">contourf</span><span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">y</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">c</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">colours</span><span class="p">,</span> <span class="n">norm</span><span class="o">=</span><span class="n">cnorm</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">if</span> <span class="n">levels</span> <span class="ow">in</span> <span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">(),</span> <span class="p">[</span><span class="kc">None</span><span class="p">],</span> <span class="p">(</span><span class="kc">None</span><span class="p">,)]:</span>
<span class="n">levels</span> <span class="o">=</span> <span class="mi">10</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">levels</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">))</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">levels</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">levels</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">levels</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">levels</span><span class="p">,</span> <span class="nb">float</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s1">&#39;levels must be an int or array-like, not float&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">levels</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">levels</span> <span class="o">!=</span> <span class="p">():</span>
<span class="n">heat</span> <span class="o">=</span> <span class="n">ax</span><span class="o">.</span><span class="n">contourf</span><span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">y</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">c</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">colours</span><span class="p">,</span> <span class="n">norm</span><span class="o">=</span><span class="n">cnorm</span><span class="p">,</span>
<span class="n">levels</span><span class="o">=</span><span class="n">levels</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span>
<span class="s1">&#39;levels must be an int or array-like, not float&#39;</span><span class="p">)</span>
<span class="n">heat</span> <span class="o">=</span> <span class="n">ax</span><span class="o">.</span><span class="n">contourf</span><span class="p">(</span><span class="n">x</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">y</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">c</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">colours</span><span class="p">,</span> <span class="n">norm</span><span class="o">=</span><span class="n">cnorm</span><span class="p">,</span>
<span class="n">levels</span><span class="o">=</span><span class="n">levels</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">heat</span> <span class="o">=</span> <span class="n">ax</span><span class="o">.</span><span class="n">pcolormesh</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">colours</span><span class="p">,</span> <span class="n">norm</span><span class="o">=</span><span class="n">cnorm</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">ax</span><span class="o">.</span><span class="n">get_figure</span><span class="p">()</span>
Expand All @@ -342,7 +341,7 @@ <h1>Source code for tp.plot.heatmap</h1><div class="highlight"><pre>
<span class="n">cbar</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">colorbar</span><span class="p">(</span><span class="n">heat</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">,</span> <span class="n">extend</span><span class="o">=</span><span class="n">extend</span><span class="p">)</span>

<span class="c1"># contours</span>
<span class="k">if</span> <span class="n">contours</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">contours</span> <span class="o">!=</span> <span class="p">():</span>
<span class="k">if</span> <span class="n">contours</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">[</span><span class="kc">None</span><span class="p">],</span> <span class="p">(),</span> <span class="p">(</span><span class="kc">None</span><span class="p">,)]:</span>
<span class="k">if</span> <span class="n">contourkwargs</span> <span class="o">==</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">contourkwargs</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">contours</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)):</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/_modules/tp/plot/phonons.html
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ <h1>Source code for tp.plot.phonons</h1><div class="highlight"><pre>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_alpha</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_label</span><span class="p">(</span><span class="n">axlabels</span><span class="p">[</span><span class="n">quantity</span><span class="p">])</span>
<span class="n">tp</span><span class="o">.</span><span class="n">plot</span><span class="o">.</span><span class="n">utilities</span><span class="o">.</span><span class="n">set_locators</span><span class="p">(</span><span class="n">cbar</span><span class="o">.</span><span class="n">ax</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">cbar</span><span class="o">.</span><span class="n">ax</span><span class="o">.</span><span class="n">yaxis</span><span class="o">.</span><span class="n">get_scale</span><span class="p">())</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">draw_all</span><span class="p">()</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">_draw_all</span><span class="p">()</span>

<span class="k">if</span> <span class="n">main</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">round</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">amin</span><span class="p">(</span><span class="n">f</span><span class="p">),</span> <span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
Expand Down Expand Up @@ -1120,7 +1120,7 @@ <h1>Source code for tp.plot.phonons</h1><div class="highlight"><pre>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_alpha</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_label</span><span class="p">(</span><span class="n">axlabels</span><span class="p">[</span><span class="n">projected</span><span class="p">])</span>
<span class="n">tp</span><span class="o">.</span><span class="n">plot</span><span class="o">.</span><span class="n">utilities</span><span class="o">.</span><span class="n">set_locators</span><span class="p">(</span><span class="n">cbar</span><span class="o">.</span><span class="n">ax</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">cbar</span><span class="o">.</span><span class="n">ax</span><span class="o">.</span><span class="n">yaxis</span><span class="o">.</span><span class="n">get_scale</span><span class="p">())</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">draw_all</span><span class="p">()</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">_draw_all</span><span class="p">()</span>

<span class="k">if</span> <span class="n">main</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="n">ymin</span><span class="p">,</span> <span class="n">ymax</span><span class="p">)</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h2>Note:<a class="headerlink" href="#note" title="Permalink to this headline">
<code class="docutils literal notranslate"><span class="pre">ztmap</span></code> heatmap (the power factor <code class="docutils literal notranslate"><span class="pre">pfmap</span></code> is also available):</p>
<a class="reference external image-reference" href="https://smtg-bham.github.io/ThermoParser/heatmaps.html"><img alt="A heatmap of ZT against carrier concentration and temperature" src="_images/ztmap1.png" /></a>
<p>Click on the plot to see the script, or one could use</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="sb">`</span>tp plot ztmap ../data/zno/boltztrap.hdf5 -k ../data/zno/kappa-m404021.hdf5 -c <span class="s1">&#39;#800080&#39;</span> -d x --discrete
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot ztmap ../data/zno/boltztrap.hdf5 -k ../data/zno/kappa-m404021.hdf5 -c <span class="s1">&#39;#800080&#39;</span> -d x --discrete
</pre></div>
</div>
<p>A related plot we hope people find useful for screening materials to
Expand All @@ -153,7 +153,7 @@ <h2>Note:<a class="headerlink" href="#note" title="Permalink to this headline">
</pre></div>
</div>
<a class="reference external image-reference" href="https://smtg-bham.github.io/ThermoParser/phonons.html"><img alt="A phonon dispersion and DoS" src="_images/phonons1.png" /></a>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot phonons ../data/zno/band.yaml --dos ../data/zno/projected_dos.dat --poscar ../data/zno/POSCAR -doscolour <span class="s1">&#39;#d46ef9&#39;</span> --doscolour <span class="s1">&#39;#7b8eff&#39;</span> -c <span class="s1">&#39;#f0901f&#39;</span>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot phonons ../data/zno/band.yaml --dos ../data/zno/projected_dos.dat --poscar ../data/zno/POSCAR --doscolour <span class="s1">&#39;#d46ef9&#39;</span> --doscolour <span class="s1">&#39;#7b8eff&#39;</span> -c <span class="s1">&#39;#f0901f&#39;</span>
</pre></div>
</div>
<p>This is where some of the more useful functions of <code class="docutils literal notranslate"><span class="pre">ThermoParser</span></code>
Expand Down
6 changes: 4 additions & 2 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ <h2 id="A">A</h2>
</li>
<li><a href="tp.plot.html#tp.plot.phonons.add_multi">add_multi() (in module tp.plot.phonons)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="tp.plot.html#tp.plot.heatmap.add_pfdiff">add_pfdiff() (in module tp.plot.heatmap)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="tp.plot.html#tp.plot.heatmap.add_pfmap">add_pfmap() (in module tp.plot.heatmap)</a>
</li>
<li><a href="tp.plot.html#tp.plot.phonons.add_projected_dispersion">add_projected_dispersion() (in module tp.plot.phonons)</a>
Expand All @@ -142,6 +142,8 @@ <h2 id="A">A</h2>
<li><a href="tp.plot.html#tp.plot.heatmap.add_ztdiff">add_ztdiff() (in module tp.plot.heatmap)</a>
</li>
<li><a href="tp.plot.html#tp.plot.heatmap.add_ztmap">add_ztmap() (in module tp.plot.heatmap)</a>
</li>
<li><a href="tp.cli.html#tp.cli.options.adminsitrative_options">adminsitrative_options() (in module tp.cli.options)</a>
</li>
<li><a href="tp.axes.html#tp.axes.legend.alphabetise">alphabetise() (in module tp.axes.legend)</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/heatmaps.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h1>Heatmaps<a class="headerlink" href="#heatmaps" title="Permalink to this head
<img alt="ZT against carrier concentration and temperature." src="_images/ztmap1.png" />
<p>This shows the classic ZT against carrier concentration and temperature
heatmap. This can be plotted at the command line with:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="sb">`</span>tp plot ztmap ../data/zno/boltztrap.hdf5 -k ../data/zno/kappa-m404021.hdf5 -c <span class="s1">&#39;#800080&#39;</span> -d x --discrete
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot ztmap ../data/zno/boltztrap.hdf5 -k ../data/zno/kappa-m404021.hdf5 -c <span class="s1">&#39;#800080&#39;</span> -d x --discrete
</pre></div>
</div>
<p>and in python with:</p>
Expand Down
Loading
Loading