Beispiel #1
0
 def test_mean_hologram_value(self):
     accumulator = Accumulator()
     data = _load_example_data_backgrounds()
     for holo in data:
         accumulator.push(holo)
     numpy_mean = np.mean([holo.values for holo in data], axis=0)
     self.assertTrue(np.allclose(numpy_mean, accumulator.mean().values))
Beispiel #2
0
 def test_mean_hologram_type(self):
     import xarray
     expected_type = xarray.core.dataarray.DataArray
     accumulator = Accumulator()
     data = _load_example_data_backgrounds()
     for holo in data:
         accumulator.push(holo)
     self.assertTrue(isinstance(accumulator.mean(), expected_type))
Beispiel #3
0
 def test_cv(self):
     accumulator = Accumulator()
     data = np.arange(10)
     for point in data:
         accumulator.push(point)
     self.assertTrue(accumulator.cv() == np.std(data) / np.mean(data))
Beispiel #4
0
 def test_push_hologram(self):
     accumulator = Accumulator()
     data = _load_example_data_backgrounds()
     for holo in data:
         accumulator.push(holo)
     self.assertTrue(accumulator._n == 3)
Beispiel #5
0
 def test_push(self):
     accumulator = Accumulator()
     data = np.arange(10)
     for point in data:
         accumulator.push(point)
     self.assertTrue(accumulator._n == 10)