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

fix uniform colour bug, update website #54

Merged
merged 1 commit into from
Mar 28, 2023
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
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/prophon.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tp.data.doctree
Binary file not shown.
Binary file modified docs/.doctrees/tp.plot.doctree
Binary file not shown.
116 changes: 99 additions & 17 deletions docs/_modules/tp/data/load.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_modules/tp/plot/colour.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h1>Source code for tp.plot.colour</h1><div class="highlight"><pre>
<span class="n">cmid</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">to_rgba</span><span class="p">(</span><span class="n">cmid</span><span class="p">,</span> <span class="n">alpha</span><span class="p">))</span>
<span class="n">cnorm</span> <span class="o">=</span> <span class="p">(</span><span class="n">cmid</span><span class="p">[:</span><span class="mi">3</span><span class="p">]</span> <span class="o">-</span> <span class="n">cmin</span><span class="p">[:</span><span class="mi">3</span><span class="p">])</span> <span class="o">/</span> <span class="p">(</span><span class="n">cmax</span><span class="p">[:</span><span class="mi">3</span><span class="p">]</span> <span class="o">-</span> <span class="n">cmin</span><span class="p">[:</span><span class="mi">3</span><span class="p">])</span>
<span class="c1"># pythagoras</span>
<span class="n">midpoint</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">((</span><span class="n">cnorm</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">cnorm</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">cnorm</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">)</span>
<span class="n">midpoint</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">cnorm</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">cnorm</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">cnorm</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span>
<span class="n">x</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="n">midpoint</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="n">cmin</span><span class="p">,</span> <span class="n">cmid</span><span class="p">,</span> <span class="n">cmax</span><span class="p">]</span>
<span class="n">x2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">density</span><span class="p">)</span>
Expand Down
20 changes: 13 additions & 7 deletions docs/_modules/tp/plot/phonons.html
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ <h1>Source code for tp.plot.phonons</h1><div class="highlight"><pre>
<div class="viewcode-block" id="add_alt_dispersion"><a class="viewcode-back" href="../../../tp.plot.html#tp.plot.phonons.add_alt_dispersion">[docs]</a><span class="nd">@tp</span><span class="o">.</span><span class="n">docstring_replace</span><span class="p">(</span><span class="n">workers</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">workers</span><span class="p">))</span>
<span class="k">def</span> <span class="nf">add_alt_dispersion</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">pdata</span><span class="p">,</span> <span class="n">quantity</span><span class="p">,</span> <span class="n">bandmin</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">bandmax</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">temperature</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span> <span class="n">direction</span><span class="o">=</span><span class="s1">&#39;avg&#39;</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;Longitudinal&#39;</span><span class="p">,</span>
<span class="s1">&#39;Transverse_1&#39;</span><span class="p">,</span> <span class="s1">&#39;Transverse_2&#39;</span><span class="p">,</span> <span class="s1">&#39;Optic&#39;</span><span class="p">],</span>
<span class="n">poscar</span><span class="o">=</span><span class="s1">&#39;POSCAR&#39;</span><span class="p">,</span> <span class="n">main</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">log</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="s1">&#39;Transverse$_1$&#39;</span><span class="p">,</span> <span class="s1">&#39;Transverse$_2$&#39;</span><span class="p">,</span> <span class="s1">&#39;Optic&#39;</span><span class="p">],</span>
<span class="n">poscar</span><span class="o">=</span><span class="s1">&#39;POSCAR&#39;</span><span class="p">,</span> <span class="n">scatter</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">main</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">log</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">interpolate</span><span class="o">=</span><span class="mi">10000</span><span class="p">,</span> <span class="n">smoothing</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">colour</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;#44ffff&#39;</span><span class="p">,</span>
<span class="s1">&#39;#ff8044&#39;</span><span class="p">,</span> <span class="s1">&#39;#ff4444&#39;</span><span class="p">,</span> <span class="s1">&#39;#00000010&#39;</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s1">&#39;-&#39;</span><span class="p">,</span>
<span class="n">marker</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">workers</span><span class="o">=</span><span class="n">workers</span><span class="p">,</span> <span class="n">xmarkkwargs</span><span class="o">=</span><span class="p">{},</span> <span class="n">verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
Expand Down Expand Up @@ -487,8 +487,10 @@ <h1>Source code for tp.plot.phonons</h1><div class="highlight"><pre>
<span class="sd"> labels per line. A single dataset could have a single label,</span>
<span class="sd"> or the default labels the lines by type. You&#39;ll want to</span>
<span class="sd"> change this if a minimum band index is set.</span>
<span class="sd"> Default: [&#39;Longitudinal&#39;, &#39;Transverse_1&#39;, &#39;Transverse_2&#39;,</span>
<span class="sd"> Default: [&#39;Longitudinal&#39;, &#39;Transverse$_1$&#39;, &#39;Transverse$_2$&#39;,</span>
<span class="sd"> &#39;Optic&#39;].</span>
<span class="sd"> scatter : bool, optional</span>
<span class="sd"> plot scatter rather than line graph. Default: False.</span>

<span class="sd"> poscar : str, optional</span>
<span class="sd"> VASP POSCAR filepath. Default: POSCAR.</span>
Expand Down Expand Up @@ -625,8 +627,8 @@ <h1>Source code for tp.plot.phonons</h1><div class="highlight"><pre>
<span class="n">y2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">yinterp</span><span class="p">(</span><span class="n">x2</span><span class="p">))</span>
<span class="n">ysort</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel</span><span class="p">(</span><span class="n">y2</span><span class="p">)</span>
<span class="n">ysort</span> <span class="o">=</span> <span class="n">ysort</span><span class="p">[</span><span class="n">ysort</span><span class="o">.</span><span class="n">argsort</span><span class="p">()]</span>
<span class="n">ymin</span> <span class="o">=</span> <span class="n">ysort</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">ysort</span><span class="p">)</span><span class="o">/</span><span class="mi">100</span><span class="p">,</span> <span class="mi">0</span><span class="p">))]</span>
<span class="n">ymax</span> <span class="o">=</span> <span class="n">ysort</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">ymin</span> <span class="o">=</span> <span class="n">ysort</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">ysort</span><span class="p">)</span><span class="o">/</span><span class="mi">100</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">))]</span>
<span class="n">ymax</span> <span class="o">=</span> <span class="n">ysort</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">ysort</span><span class="p">)</span><span class="o">*</span><span class="mf">99.9</span><span class="o">/</span><span class="mi">100</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">))]</span>

<span class="c1"># line appearance</span>

Expand All @@ -641,8 +643,12 @@ <h1>Source code for tp.plot.phonons</h1><div class="highlight"><pre>
<span class="c1"># plotting</span>

<span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">y2</span><span class="p">[</span><span class="mi">0</span><span class="p">])):</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x2</span><span class="p">,</span> <span class="n">y2</span><span class="p">[:,</span><span class="n">n</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">colour</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="n">linestyle</span><span class="p">[</span><span class="n">n</span><span class="p">],</span>
<span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="n">marker</span><span class="o">=</span><span class="n">marker</span><span class="p">[</span><span class="n">n</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">scatter</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">scatter</span><span class="p">(</span><span class="n">x2</span><span class="p">,</span> <span class="n">y2</span><span class="p">[:,</span><span class="n">n</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">colour</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="n">linestyle</span><span class="p">[</span><span class="n">n</span><span class="p">],</span>
<span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="n">marker</span><span class="o">=</span><span class="n">marker</span><span class="p">[</span><span class="n">n</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">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x2</span><span class="p">,</span> <span class="n">y2</span><span class="p">[:,</span><span class="n">n</span><span class="p">],</span> <span class="n">color</span><span class="o">=</span><span class="n">colour</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="n">linestyle</span><span class="p">[</span><span class="n">n</span><span class="p">],</span>
<span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="n">marker</span><span class="o">=</span><span class="n">marker</span><span class="p">[</span><span class="n">n</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

<span class="c1"># axes formatting</span>

Expand Down
8 changes: 8 additions & 0 deletions docs/_modules/tp/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ <h1>Source code for tp.settings</h1><div class="highlight"><pre>
<span class="s1">&#39;frequency&#39;</span><span class="p">:</span> <span class="s1">&#39;THz&#39;</span><span class="p">,</span>
<span class="s1">&#39;gamma&#39;</span><span class="p">:</span> <span class="s1">&#39;THz&#39;</span><span class="p">,</span>
<span class="s1">&#39;group_velocity&#39;</span><span class="p">:</span> <span class="s1">&#39;m s-1&#39;</span><span class="p">,</span>
<span class="s1">&#39;gruneisen&#39;</span><span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
<span class="s1">&#39;gv_by_gv&#39;</span><span class="p">:</span> <span class="s1">&#39;m2 s-2&#39;</span><span class="p">,</span>
<span class="s1">&#39;hall_carrier_concentration&#39;</span><span class="p">:</span> <span class="s1">&#39;cm-3&#39;</span><span class="p">,</span>
<span class="s1">&#39;heat_capacity&#39;</span><span class="p">:</span> <span class="s1">&#39;J K-1&#39;</span><span class="p">,</span>
Expand Down Expand Up @@ -423,6 +424,7 @@ <h1>Source code for tp.settings</h1><div class="highlight"><pre>
<span class="s1">&#39;frequency&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;qpoint&#39;</span><span class="p">,</span> <span class="s1">&#39;band&#39;</span><span class="p">],</span>
<span class="s1">&#39;gamma&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;temperature&#39;</span><span class="p">,</span> <span class="s1">&#39;qpoint&#39;</span><span class="p">,</span> <span class="s1">&#39;band&#39;</span><span class="p">],</span>
<span class="s1">&#39;group_velocity&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;qpoint&#39;</span><span class="p">,</span> <span class="s1">&#39;band&#39;</span><span class="p">,</span> <span class="mi">3</span><span class="p">],</span>
<span class="s1">&#39;gruneisen&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;qpoint&#39;</span><span class="p">,</span> <span class="s1">&#39;band&#39;</span><span class="p">],</span>
<span class="s1">&#39;gv_by_gv&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;qpoint&#39;</span><span class="p">,</span> <span class="s1">&#39;band&#39;</span><span class="p">,</span> <span class="mi">6</span><span class="p">],</span>
<span class="s1">&#39;hall_carrier_concentration&#39;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s1">&#39;heat_capacity&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;temperature&#39;</span><span class="p">,</span> <span class="s1">&#39;qpoint&#39;</span><span class="p">,</span> <span class="s1">&#39;band&#39;</span><span class="p">],</span>
Expand Down Expand Up @@ -545,6 +547,8 @@ <h1>Source code for tp.settings</h1><div class="highlight"><pre>
<span class="s1">&#39;Imaginary Self Energy (THz)&#39;</span><span class="p">,</span>
<span class="s1">&#39;group_velocity&#39;</span><span class="p">:</span>
<span class="s1">&#39;Group Velocity (m s$\mathregular{^{-1}}$)&#39;</span><span class="p">,</span>
<span class="s1">&#39;gruneisen&#39;</span><span class="p">:</span>
<span class="s1">&#39;Gruneisen Parameter&#39;</span><span class="p">,</span>
<span class="s1">&#39;gv_by_gv&#39;</span><span class="p">:</span>
<span class="s1">&#39;Group Velocity Outer Product (m$\mathregular{^2\ s^{-2}}$)&#39;</span><span class="p">,</span>
<span class="s1">&#39;heat_capacity&#39;</span><span class="p">:</span>
Expand Down Expand Up @@ -623,6 +627,8 @@ <h1>Source code for tp.settings</h1><div class="highlight"><pre>
<span class="s1">&#39;Imaginary Self Energy (THz)&#39;</span><span class="p">,</span>
<span class="s1">&#39;group_velocity&#39;</span><span class="p">:</span>
<span class="s1">&#39;Group Velocity (m s$\mathregular{^{-1}}$)&#39;</span><span class="p">,</span>
<span class="s1">&#39;gruneisen&#39;</span><span class="p">:</span>
<span class="s1">&#39;Gruneisen Parameter&#39;</span><span class="p">,</span>
<span class="s1">&#39;gv_by_gv&#39;</span><span class="p">:</span>
<span class="s1">&#39;Group Vel. Outer Prod. (m$\mathregular{^2\ s^{-2}}$)&#39;</span><span class="p">,</span>
<span class="s1">&#39;heat_capacity&#39;</span><span class="p">:</span>
Expand Down Expand Up @@ -701,6 +707,8 @@ <h1>Source code for tp.settings</h1><div class="highlight"><pre>
<span class="s1">&#39;$\mathregular{\Gamma}$ (THz)&#39;</span><span class="p">,</span>
<span class="s1">&#39;group_velocity&#39;</span><span class="p">:</span>
<span class="s1">&#39;$\mathregular{g_v\ (m\ s^{-1})}$&#39;</span><span class="p">,</span>
<span class="s1">&#39;gruneisen&#39;</span><span class="p">:</span>
<span class="s1">&#39;$\gamma$&#39;</span><span class="p">,</span>
<span class="s1">&#39;gv_by_gv&#39;</span><span class="p">:</span>
<span class="s1">&#39;$\mathregular{g_v \otimes g_v\ (m^2\ s^{-2})}$&#39;</span><span class="p">,</span>
<span class="s1">&#39;heat_capacity&#39;</span><span class="p">:</span>
Expand Down
Loading