Skip to content

Commit

Permalink
Merge pull request #90 from SMTG-Bham/bug-fix
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
kbspooner authored Mar 20, 2024
2 parents 0ea5463 + 3183cfe commit eec1082
Show file tree
Hide file tree
Showing 105 changed files with 170 additions and 737 deletions.
8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ while contributions can be made using the `fork and pull`_ approach.
Contributions should include comprehensive docstrings, and where
appropriate `examples`_, further `documentation`_ and `tests`_ are greatly
appreciated. Documentation uses the `sphinx`_ package, and can be built from
the ``docs`` directory with ``sphinx-build -b html src/ .``.
the ``docs`` directory with ``sphinx-build -b html src/ .``. In order to build
the docs, download the extra dependencies with, e.g., ``pip install .[docs]``
from the ThermoParser directory.

.. _issue tracker: https://github.com/smtg-bham/ThermoParser/issues
.. _fork and pull: https://guides.github.com/activities/forking
Expand All @@ -173,7 +175,9 @@ Testing
-------

Tests use the `unittest`_ package, and can be run from the test directory
with ``python3 -m unittest``.
with ``python3 -m unittest``. If you don't already have unittest installed, it
can be directly with ``pip install unitest`` or, e.g., ``pip install .[tests]``
from the ThermoParser directory.

.. _unittest: https://docs.python.org/3/library/unittest.html

Expand Down
Binary file modified docs/.doctrees/avg-rates.doctree
Binary file not shown.
Binary file modified docs/.doctrees/cumkappa.doctree
Binary file not shown.
Binary file modified docs/.doctrees/dos.doctree
Binary file not shown.
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/prophon.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tutorial-01.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tutorial-02.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tutorial-03.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tutorial-04.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tutorial-05.doctree
Binary file not shown.
Binary file modified docs/.doctrees/waterfalls.doctree
Binary file not shown.
File renamed without changes
Binary file modified docs/_images/tutorial-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/tutorial-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/tutorial-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/tutorial-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/tutorial-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ztmap1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 22 additions & 25 deletions docs/_sources/gallery.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ from either a python script or the command line, such as the classic

Click on the plot to see the script, or one could use

.. code-block:: bash
tp plot ztmap boltztrap.hdf5 -k kappa-m<xxx>.hdf5 -c '#800080' -d x
.. literalinclude:: ../../examples/heatmaps/plot-zt.sh
:language: bash

A related plot we hope people find useful for screening materials to
run three+ phonon calculations on is the ``kappa-target`` plot, which
Expand All @@ -67,9 +66,8 @@ ZT, in this case 2.
:alt: A heatmap of target lattice thermal conductivity against carrier concentration and temperature
:target: https://smtg-bham.github.io/ThermoParser/heatmaps.html

.. code-block:: bash
tp plot kappa-target boltztrap.hdf5 -c '#008080' -d x
.. literalinclude:: ../../examples/heatmaps/plot-kappa-target.sh
:language: bash

Or on the analytical end of the process, ``zdiff`` and ``pfdiff`` allow
comparison among different datasets.
Expand All @@ -78,9 +76,8 @@ comparison among different datasets.
:alt: A heatmap of differentce in ZT against carrier concentration and temperature
:target: https://smtg-bham.github.io/ThermoParser/heatmaps.html

.. code-block:: bash
tp plot ztdiff <x>/boltztrap.hdf5 <y>/boltztrap.hdf5 -k <x>/kappa-m<xxx>.hdf5 <y>/kappa-m<yyy>.hdf5 -l <x> <y>
.. literalinclude:: ../../examples/heatmaps/plot-ztdiff.sh
:language: bash

Slightly more complex plots also with command line scripts are the
phonon dispersions, which can be overlayed and plotted with DoSs.
Expand All @@ -89,17 +86,15 @@ phonon dispersions, which can be overlayed and plotted with DoSs.
:alt: A plot converging phonon dispersions against supercell size
:target: https://smtg-bham.github.io/ThermoParser/phonons.html

.. code-block:: bash
tp plot phonons <list of band.yamls> -l <list of labels> -t 'Supercell\ Size'
.. literalinclude:: ../../examples/phonons/plot-multiphon.sh
:language: bash

.. image:: figures/phonons.png
:alt: A phonon dispersion and DoS
:target: https://smtg-bham.github.io/ThermoParser/phonons.html

.. code-block:: bash
tp plot phonons band.yaml -c '#ff8000' -d projected_dos.dat --doscolour '#ffff00' '#00ffff'
.. literalinclude:: ../../examples/phonons/plot-phonons.sh
:language: bash

This is where some of the more useful functions of ``ThermoParser``
come in, e.g. the rescaling of the x axis in the former plot, and the
Expand All @@ -111,11 +106,15 @@ e.g. Phonopy or maintain multiple data files.
:alt: A DoS plot without and with gaussian smearing (sigma=0.2)
:target: https://smtg-bham.github.io/ThermoParser/dos.html

The right-hand plot can be plotted with:
The left-hand plot can be plotted with:

.. literalinclude:: ../../examples/dos/plot-dos-total.sh
:language: bash

.. code-block:: bash
And the right-hand plot can be plotted with:

tp plot dos projected_dos.dat --atoms "Ba Sn O O_2 2" --sigma 0.2 --location 1 -c magenta -c cyan -c red -c orange
.. literalinclude:: ../../examples/dos/plot-dos-smeared.sh
:language: bash

There are command-line scripts, but the main functionality is
intended as a python package, which enables much more customisable
Expand All @@ -141,9 +140,8 @@ latter shows the same data, but in a more quantitative way.
:alt: A phonon dispersion where widened bands show phonon scattering
:target: https://smtg-bham.github.io/ThermoParser/prophon.html

.. code-block:: bash
tp plot wideband band.yaml kappa-m<xxx>.hdf5 -c '#000000' '#ff0000' -s dark_background
.. literalinclude:: ../../examples/projected-phonons/plot-wideband.sh
:language: bash

.. image:: figures/prophon.png
:alt: A phonon dispersion where dark colours show phonn scattering
Expand All @@ -157,13 +155,12 @@ because thats long... many of these outlined in the `tutorials`_, and some are
demonstrated in this line plot, which is not available as a python command,
but is easily scripted or plotted at the command line:

.. image:: avg-rates.png
.. image:: ../../examples/avg-rates/avg-rates.png
:alt: A plot of weighted average scattering rates against temperature and carrier concnetration.
:target: https://smtg-bham.github.io/ThermoParser/avg-rates.html

.. code-block::
tp plot avg-rates ../data/basno3/mesh_75x75x75.h5 -t 1000 -n -1e19 --location 2 --large -c red -c blue -c magenta
.. literalinclude:: ../../examples/avg-rates/plot-avg-rates.sh
:language: bash

It shows the k-point and Fermi-Dirac weighted scattering rates against
temperature and carrier concentration, to give an accurate picture of their
Expand Down
4 changes: 2 additions & 2 deletions docs/avg-rates.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@

<div class="section" id="average-rates">
<h1>Average Rates<a class="headerlink" href="#average-rates" title="Permalink to this headline"></a></h1>
<img alt="A plot of weighted average scattering rates against temperature and carrier concnetration." src="_images/avg-rates.png" />
<img alt="A plot of weighted average scattering rates against temperature and carrier concnetration." src="_images/avg-rates1.png" />
<p>This shows the average scattering rates against temperature, averaged
across k-points and weighted by the derivative of the Fermi-Dirac
distribution, as they are when calculating the conductivity, thereby
giving a representative image of the effect the scattering processes
play in the material. This can be plotted at the command line with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tp</span> <span class="n">plot</span> <span class="n">avg</span><span class="o">-</span><span class="n">rates</span> <span class="o">../</span><span class="n">data</span><span class="o">/</span><span class="n">basno3</span><span class="o">/</span><span class="n">mesh_75x75x75</span><span class="o">.</span><span class="n">h5</span> <span class="o">-</span><span class="n">t</span> <span class="mi">1000</span> <span class="o">-</span><span class="n">n</span> <span class="o">-</span><span class="mf">1e19</span> <span class="o">--</span><span class="n">location</span> <span class="mi">2</span> <span class="o">--</span><span class="n">large</span> <span class="o">-</span><span class="n">c</span> <span class="n">red</span> <span class="o">-</span><span class="n">c</span> <span class="n">blue</span> <span class="o">-</span><span class="n">c</span> <span class="n">magenta</span>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot avg-rates ../data/basno3/mesh_75x75x75.h5 -t <span class="m">1000</span> -n -1e19 --location <span class="m">2</span> --large -c red -c blue -c magenta
</pre></div>
</div>
<p>If rates are included in the file but are very low, you may want to
Expand Down
2 changes: 1 addition & 1 deletion docs/cumkappa.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h1>Cumulative Lattice Thermal Conductivity<a class="headerlink" href="#cumulati
to 100 nanometers may reduce the lattice thermal conductivity by around
40 %.</p>
<p>The right plot can be plotted at the command line with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tp</span> <span class="n">plot</span> <span class="n">cumkappa</span> <span class="o">../</span><span class="n">data</span><span class="o">/</span><span class="n">zno</span><span class="o">/</span><span class="n">kappa</span><span class="o">-</span><span class="n">m404021</span><span class="o">.</span><span class="n">hdf5</span> <span class="o">--</span><span class="n">mfp</span> <span class="o">--</span><span class="n">percent</span> <span class="o">-</span><span class="n">d</span> <span class="n">x</span> <span class="o">-</span><span class="n">d</span> <span class="n">y</span> <span class="o">-</span><span class="n">c</span> <span class="s1">&#39;#59c605&#39;</span> <span class="o">-</span><span class="n">c</span> <span class="s1">&#39;#ffcf06&#39;</span> <span class="o">--</span><span class="n">nofill</span> <span class="o">--</span><span class="n">xmarkers</span> <span class="mf">1e-7</span> <span class="o">-</span><span class="n">l</span> <span class="n">x</span> <span class="o">-</span><span class="n">l</span> <span class="n">y</span> <span class="o">--</span><span class="n">location</span> <span class="ow">in</span>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot cumkappa ../data/zno/kappa-m404021.hdf5 --mfp --percent -d x -d y -c <span class="s1">&#39;#59c605&#39;</span> -c <span class="s1">&#39;#ffcf06&#39;</span> --nofill --xmarkers 1e-7 -l x -l y --location in
</pre></div>
</div>
<p>And while the layering of the DoS plot is not yet supported at the
Expand Down
4 changes: 2 additions & 2 deletions docs/dos.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ <h1>Density of States (DoS)<a class="headerlink" href="#density-of-states-dos" t
<p>This shows a two densities of states (DoSs), which show the density of phonon
modes at particular frequencies.</p>
<p>The left plot can be generated by:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tp</span> <span class="n">plot</span> <span class="n">dos</span> <span class="o">../</span><span class="n">data</span><span class="o">/</span><span class="n">basno3</span><span class="o">/</span><span class="n">projected_dos</span><span class="o">.</span><span class="n">dat</span> <span class="o">--</span><span class="n">total</span> <span class="o">--</span><span class="n">nolegend</span> <span class="o">-</span><span class="n">c</span> <span class="n">pink</span> <span class="o">-</span><span class="n">c</span> <span class="n">cyan</span> <span class="o">-</span><span class="n">c</span> <span class="n">red</span> <span class="o">-</span><span class="n">p</span> <span class="o">../</span><span class="n">data</span><span class="o">/</span><span class="n">basno3</span><span class="o">/</span><span class="n">POSCAR</span>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot dos ../data/basno3/projected_dos.dat --total --nolegend -c pink -c cyan -c red -p ../data/basno3/POSCAR
</pre></div>
</div>
<p>And the right plot by:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tp</span> <span class="n">plot</span> <span class="n">dos</span> <span class="o">../</span><span class="n">data</span><span class="o">/</span><span class="n">basno3</span><span class="o">/</span><span class="n">projected_dos</span><span class="o">.</span><span class="n">dat</span> <span class="o">--</span><span class="n">atoms</span> <span class="s2">&quot;Ba Sn O O_2 2&quot;</span> <span class="o">--</span><span class="n">sigma</span> <span class="mf">0.2</span> <span class="o">--</span><span class="n">location</span> <span class="mi">1</span> <span class="o">-</span><span class="n">c</span> <span class="n">magenta</span> <span class="o">-</span><span class="n">c</span> <span class="n">cyan</span> <span class="o">-</span><span class="n">c</span> <span class="n">red</span> <span class="o">-</span><span class="n">c</span> <span class="n">orange</span>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tp plot dos ../data/basno3/projected_dos.dat --atoms <span class="s2">&quot;Ba Sn O O_2 2&quot;</span> --sigma <span class="m">0</span>.2 --location <span class="m">1</span> -c magenta -c cyan -c red -c orange
</pre></div>
</div>
<p>Or the whole thing in python with:</p>
Expand Down
Loading

0 comments on commit eec1082

Please sign in to comment.