def setUpClass(cls):
     f = 'data/boltztrap.hdf5'
     cls.qs = [
         'doping', 'conductivity', 'electronic_thermal_conductivity',
         'seebeck', 'temperature', 'power_factor'
     ]
     cls.d = load.boltztrap(f, cls.qs)
     cls.ts = len(cls.d['temperature'])
     cls.ds = len(cls.d['doping'])
Example #2
0
    def test_thermal_conductivity(self, mock_h5py):
        q = 'electronic_thermal_conductivity'
        data = {'thermal_conductivity': {'n': np.zeros((2, 2, 3, 3))},
                'temperature':          [0, 1],
                'doping':               [1, 2]}
        mock_h5py.return_value = data

        data2 = load.boltztrap('mock', q)
        mock_h5py.assert_called_once()
        for q2 in [q, 'temperature', 'doping', 'meta']:
            self.assertIn(q2, data2)
Example #3
0
    def test_seebeck(self, mock_h5py):
        q = 'seebeck'
        data = {q:             {'n': np.zeros((2, 2, 3, 3))},
                'temperature': [0, 1],
                'doping':      [1, 2]}
        mock_h5py.return_value = data

        data2 = load.boltztrap('mock', q)
        mock_h5py.assert_called_once()
        for q2 in [q, 'temperature', 'doping', 'meta']:
            self.assertIn(q2, data2)