예제 #1
0
 def setUpClass(cls):
     cls.d = {
         'temperature': [1, 2],
         'doping': [10, 100],
         'zt': [[1, 2], [4, 8]]
     }
     cls.fig, cls.ax = one_colourbar()
     cls.ax, cls.cbar = heatmap.add_ztmap(cls.ax, cls.d)
예제 #2
0
    def test_precalculated(self, mock_colourbar, mock_resolve, mock_zt):
        mock_resolve.return_value = self.data2
        cbar = heatmap.add_ztmap(self.ax, self.data2, xinterp=None,
                                 yinterp=None)

        self.ax.pcolormesh.assert_called_once()
        self.ax.set_xscale.assert_called_once_with('linear')
        self.ax.set_yscale.assert_called_once_with('log')
        self.ax.set_xlim.assert_called_once_with(1, 3)
        self.ax.set_ylim.assert_called_once_with(10, 1000)
        mock_colourbar.assert_called_once()
        cbar.ax.set_yscale.assert_called_once_with('linear')
        mock_resolve.assert_not_called()
        mock_zt.assert_not_called()
예제 #3
0
 def setUpClass(cls):
     c = [[[[2.]], [[4.]]], [[[8.]], [[16.]]]]
     s = [[[[3e6]], [[6e6]]], [[[9e6]], [[12e6]]]]
     etc = [[[[3.]], [[3.]]], [[[3.]], [[3.]]]]
     ltc = [[6.], [6.]]
     t = [2., 4.]
     d = [10., 100.]
     cls.d = {
         'conductivity': c,
         'seebeck': s,
         'electronic_thermal_conductivity': etc,
         'lattice_thermal_conductivity': ltc,
         'temperature': t,
         'doping': d,
         'meta': {
             'units': {}
         }
     }
     cls.fig, cls.ax = one_colourbar()
     cls.ax, cls.cbar = heatmap.add_ztmap(cls.ax, cls.d, direction='x')