def test_AzimuthalIntegrator_pickle(self):
    spectra = self.ai.integrate1d(self.data, self.npt)
    ais = dumps(self.ai)
    newai = loads(ais)
    self.assertEqual(newai._cached_array.keys(), self.ai._cached_array.keys())
    for key in self.ai._cached_array.keys():
        if isinstance(self.ai._cached_array[key], numpy.ndarray):
            self.assertEqual(abs((newai._cached_array[key] - self.ai._cached_array[key])).max(), 0, ('key %s is the same' % key))
        else:
            self.assertEqual(newai._cached_array[key], self.ai._cached_array[key], ('key %s is the same: %s %s' % (key, newai._cached_array[key], self.ai._cached_array[key])))
    for (first, second) in zip(newai.integrate1d(self.data, self.npt), spectra):
        self.assertEqual(abs((first - second)).max(), 0, 'Spectra are the same')
def test_AzimuthalIntegrator_pickle(self):
    spectra = self.ai.integrate1d(self.data, self.npt)
    ais = dumps(self.ai)
    newai = loads(ais)
    self.assertEqual(newai._cached_array.keys(), self.ai._cached_array.keys())
    for key in self.ai._cached_array.keys():
        if isinstance(self.ai._cached_array[key], numpy.ndarray):
            self.assertEqual(abs((newai._cached_array[key] - self.ai._cached_array[key])).max(), 0, ('key %s is the same' % key))
        else:
            self.assertEqual(newai._cached_array[key], self.ai._cached_array[key], ('key %s is the same: %s %s' % (key, newai._cached_array[key], self.ai._cached_array[key])))
    for (first, second) in zip(newai.integrate1d(self.data, self.npt), spectra):
        self.assertEqual(abs((first - second)).max(), 0, 'Spectra are the same')