Skip to content

Commit

Permalink
Merge pull request #43 from SMTG-UCL/develop
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
kbspooner authored Oct 25, 2022
2 parents ea0c140 + fd7b994 commit aa304e8
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 76 deletions.
Binary file modified docs/src/_build/doctrees/environment.pickle
Binary file not shown.
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-00.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-01.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-02.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-03.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-04.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-05.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-06.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorial-0X.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
8 changes: 0 additions & 8 deletions docs/src/_build/html/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@
<li class="toctree-l1"><a class="reference internal" href="index.html#contributors">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#requirements">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id2">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id4">Command Line Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id5">Python Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id12">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id17">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id19">Contributors</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id20">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#id21">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Python Package</a></li>
</ul>

Expand Down
4 changes: 2 additions & 2 deletions tests/test_plot/test_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def test_default(self, mock_colourbar, mock_resolve, mock_interpolate, mock_zt):
mock_zt.return_value = self.data2
mock_interpolate.return_value = (self.data, self.data)
mock_resolve.return_value = self.data
cbar = heatmap.add_ztmap(self.ax, self.data, xinterp=None,
yinterp=None)
cbar = heatmap.add_ztmap(self.ax, self.data, kdata=self.data,
xinterp=None, yinterp=None)

self.ax.pcolormesh.assert_called_once()
self.ax.set_xscale.assert_called_once_with('linear')
Expand Down
8 changes: 6 additions & 2 deletions tp/plot/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def add_pfdiff(ax, data1, data2, direction='avg', xinterp=200, yinterp=200,

return cbar, h, l

def add_ztmap(ax, data, kdata=None, direction='avg', xinterp=200,
def add_ztmap(ax, data, kdata=1., direction='avg', xinterp=200,
yinterp=200, kind='linear', xmin=None, xmax=None, ymin=None,
ymax=None, cmin=None, cmax=None, colour='viridis', **kwargs):
"""Convenience wrapper for plotting ZT heatmaps.
Expand Down Expand Up @@ -562,6 +562,8 @@ def add_ztmap(ax, data, kdata=None, direction='avg', xinterp=200,
data = tp.data.utilities.resolve(data, 'zt', direction=direction)
else:
data = tp.data.utilities.resolve(data, equants, direction=direction)
if kdata is None:
kdata = 1.

if not isinstance(kdata, (int, float)):
kdata = tp.data.utilities.resolve(kdata, ltc, direction=direction)
Expand Down Expand Up @@ -592,7 +594,7 @@ def add_ztmap(ax, data, kdata=None, direction='avg', xinterp=200,

return cbar

def add_ztdiff(ax, data1, data2, kdata1=None, kdata2=None, direction='avg',
def add_ztdiff(ax, data1, data2, kdata1=1., kdata2=1., direction='avg',
xinterp=200, yinterp=200, kind='linear', xmin=None, xmax=None,
ymin=None, ymax=None, cmin=None, cmax=None, colour1='#800080',
colour2='#FF8000', midcolour='#FFFFFF', label1=None,
Expand Down Expand Up @@ -692,6 +694,8 @@ def add_ztdiff(ax, data1, data2, kdata1=None, kdata2=None, direction='avg',
else:
data[i] = tp.data.utilities.resolve(data[i], equants,
direction=direction)
if kdata[i] is None:
kdata[i] = 1.
if not isinstance(kdata[i], (int, float)):
kdata[i] = tp.data.utilities.resolve(kdata[i], ltc,
direction=direction)
Expand Down

0 comments on commit aa304e8

Please sign in to comment.