[Reproducible-builds] Bug#813932: sunpy: FTBFS: IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

Chris Lamb lamby at debian.org
Sat Feb 6 19:59:19 UTC 2016


Source: sunpy
Version: 0.6.1-2
Severity: serious
Justification: fails to build from source
User: reproducible-builds at lists.alioth.debian.org
Usertags: ftbfs
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Dear Maintainer,

sunpy fails to build from source in unstable/amd64:

  [..]

              ----------
              new_delt : float
                  New delta between consecutive values.
              """
          if self.t_delt == new_delt:
              return self
          factor = self.t_delt / float(new_delt)
      
          # The last data-point does not change!
          new_size = floor((self.shape[1] - 1) * factor + 1) # pylint: disable=E1101
          data = ndimage.zoom(self.data, (1, new_size / self.shape[1])) # pylint: disable=E1101
      
          params = self._get_params()
          params.update({
              'time_axis': np.linspace(
                  self.time_axis[0],
  >               self.time_axis[(new_size - 1) * new_delt / self.t_delt],
                  new_size
              ),
              't_delt': new_delt,
          })
  E       IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
  
  sunpy/spectra/spectrogram.py:960: IndexError
  ______________________________ test_combine_freqs ______________________________
  
      def test_combine_freqs():
          image = np.random.rand(5, 3600)
          spec = LinearTimeSpectrogram(image,
              np.linspace(0, image.shape[1] - 1, image.shape[1]),
              np.array([8, 6, 4, 2, 0]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              0.25
          )
          image = np.random.rand(5, 3600)
          spec2 = LinearTimeSpectrogram(image,
              np.linspace(0, image.shape[1] - 1, image.shape[1]),
              np.array([9, 7, 5, 3, 1]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              0.25
          )
  >       comb = LinearTimeSpectrogram.combine_frequencies([spec, spec2])
  
  sunpy/spectra/tests/test_spectrogram.py:575: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  sunpy/spectra/spectrogram.py:1162: in combine_frequencies
      specs = cls.intersect_time(specs)
  sunpy/spectra/spectrogram.py:1144: in intersect_time
      cut = [sp[:, (start - sp.t_init) / delt:] for sp in specs]
  sunpy/spectra/spectrogram.py:601: in __getitem__
      return self._slice(key[0], key[1])
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <sunpy.spectra.spectrogram.LinearTimeSpectrogram object at 0x7f00513ff790>
  y_range = slice(None, None, None), x_range = slice(0.0, None, None)
  
      def _slice(self, y_range, x_range):
          """Return new spectrogram reduced to the values passed
              as slices. Implementation detail."""
  >       data = self.data[y_range, x_range]
  E       IndexError: invalid slice
  
  sunpy/spectra/spectrogram.py:339: IndexError
  _____________________________ test_intersect_time ______________________________
  
      def test_intersect_time():
          image = np.random.rand(5, 3600)
          spec = LinearTimeSpectrogram(image,
              np.linspace(0, 0.25 * (image.shape[1] - 1), image.shape[1]),
              np.array([8, 6, 4, 2, 0]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              0.25
          )
          image = np.random.rand(5, 3600)
          spec2 = LinearTimeSpectrogram(image,
              np.linspace(0, 0.25 * (image.shape[1] - 1), image.shape[1]),
              np.array([9, 7, 5, 3, 1]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              901,
              0.25
          )
      
          one, other = LinearTimeSpectrogram.intersect_time(
  >           [spec, spec2]
          )
  
  sunpy/spectra/tests/test_spectrogram.py:632: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  sunpy/spectra/spectrogram.py:1144: in intersect_time
      cut = [sp[:, (start - sp.t_init) / delt:] for sp in specs]
  sunpy/spectra/spectrogram.py:601: in __getitem__
      return self._slice(key[0], key[1])
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <sunpy.spectra.spectrogram.LinearTimeSpectrogram object at 0x7f005113dd50>
  y_range = slice(None, None, None), x_range = slice(4.0, None, None)
  
      def _slice(self, y_range, x_range):
          """Return new spectrogram reduced to the values passed
              as slices. Implementation detail."""
  >       data = self.data[y_range, x_range]
  E       IndexError: invalid slice
  
  sunpy/spectra/spectrogram.py:339: IndexError
  ________________________________ test_linearize ________________________________
  
      def test_linearize():
          image = np.random.rand(5, 900)
          spec = LinearTimeSpectrogram(image,
              np.linspace(0, 1 * (image.shape[1] - 1), image.shape[1]),
              np.array([20, 10, 5, 0]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              1
          )
          # 0   1   2   3   4   5  6  7  8
          # -------- ----------- ----- ---
          # 20 17.5 15 12.5 10 7.5 5 2.5 0
      
  >       linear = spec.linearize_freqs()
  
  sunpy/spectra/tests/test_spectrogram.py:723: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <sunpy.spectra.spectrogram.LinearTimeSpectrogram object at 0x7f00512982d0>
  delta_freq = 2.5
  
      def linearize_freqs(self, delta_freq=None):
          """Rebin frequencies so that the frequency axis is linear.
      
              Parameters
              ----------
              delta_freq : float
                  Difference between consecutive values on the new frequency axis.
                  Defaults to half of smallest delta in current frequency axis.
                  Compare Nyquist-Shannon sampling theorem.
              """
          if delta_freq is None:
              # Nyquist–Shannon sampling theorem
              delta_freq = _min_delt(self.freq_axis) / 2.
          nsize = (self.freq_axis.max() - self.freq_axis.min()) / delta_freq + 1
  >       new = np.zeros((nsize, self.shape[1]), dtype=self.data.dtype)
  E       TypeError: 'numpy.float64' object cannot be interpreted as an index
  
  sunpy/spectra/spectrogram.py:804: TypeError
  _______________________________ test_linear_view _______________________________
  
      def test_linear_view():
          image = np.random.rand(5, 900)
          spec = LinearTimeSpectrogram(image,
              np.linspace(0, 1 * (image.shape[1] - 1), image.shape[1]),
              np.array([20, 10, 5, 0]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              1
          )
      
          linear = _LinearView(spec)
          # assert ((linear.freq_axis[:-1] - linear.freq_axis[1:]) == 2.5).all()
      
          assert (linear[0] == image[0, :]).all()
          assert (linear[1] == image[0, :]).all()
          assert (linear[2] == image[0, :]).all()
          assert (linear[3] == image[1, :]).all()
          assert (linear[4] == image[1, :]).all()
  >       assert (linear[5] == image[1, :]).all()
  
  sunpy/spectra/tests/test_spectrogram.py:756: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  sunpy/spectra/spectrogram.py:143: in __getitem__
      return self._find(self.arr, item)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <sunpy.spectra.spectrogram._LinearView object at 0x7f0051601b10>
  arr = <sunpy.spectra.spectrogram.LinearTimeSpectrogram object at 0x7f00516014d0>
  item = 5
  
      def _find(self, arr, item):
          if item < 0:
              item = item % len(self)
          if item >= len(self):
              raise IndexError
      
          freq_offset = item * self.delt
          freq = self.arr.freq_axis[0] - freq_offset
          # The idea is that when we take the biggest delta in the mid points,
          # we do not have to search anything that is between the beginning and
          # the first item that can possibly be that frequency.
          min_mid = max(0, (freq - self.midpoints[0]) // self.max_mp_delt)
  >       for n, mid in enumerate(self.midpoints[min_mid:]):
  E       IndexError: invalid slice
  
  sunpy/spectra/spectrogram.py:137: IndexError
  __________________________ test_linear_view_negative ___________________________
  
      def test_linear_view_negative():
          image = np.random.rand(5, 900)
          spec = LinearTimeSpectrogram(image,
              np.linspace(0, 1 * (image.shape[1] - 1), image.shape[1]),
              np.array([20, 10, 5, 0]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              1
          )
      
          linear = _LinearView(spec)
          # assert ((linear.freq_axis[:-1] - linear.freq_axis[1:]) == 2.5).all()
  >       assert (linear[8] == image[3, :]).all()
  
  sunpy/spectra/tests/test_spectrogram.py:792: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  sunpy/spectra/spectrogram.py:143: in __getitem__
      return self._find(self.arr, item)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <sunpy.spectra.spectrogram._LinearView object at 0x7f0050a60d10>
  arr = <sunpy.spectra.spectrogram.LinearTimeSpectrogram object at 0x7f0050a606d0>
  item = 8
  
      def _find(self, arr, item):
          if item < 0:
              item = item % len(self)
          if item >= len(self):
              raise IndexError
      
          freq_offset = item * self.delt
          freq = self.arr.freq_axis[0] - freq_offset
          # The idea is that when we take the biggest delta in the mid points,
          # we do not have to search anything that is between the beginning and
          # the first item that can possibly be that frequency.
          min_mid = max(0, (freq - self.midpoints[0]) // self.max_mp_delt)
  >       for n, mid in enumerate(self.midpoints[min_mid:]):
  E       IndexError: invalid slice
  
  sunpy/spectra/spectrogram.py:137: IndexError
  ____________________________ test_linear_view_freqs ____________________________
  
      def test_linear_view_freqs():
          image = np.random.rand(5, 900)
          spec = LinearTimeSpectrogram(image,
              np.linspace(0, 1 * (image.shape[1] - 1), image.shape[1]),
              np.array([20, 10, 5, 0]),
              datetime(2010, 1, 1, 0, 15),
              datetime(2010, 1, 1, 0, 30),
              900,
              1
          )
      
          linear = _LinearView(spec)
          # assert ((linear.freq_axis[:-1] - linear.freq_axis[1:]) == 2.5).all()
      
          assert linear.get_freq(0) == 20
          assert linear.get_freq(1) == 20
          assert linear.get_freq(2) == 20
          assert linear.get_freq(3) == 10
          assert linear.get_freq(4) == 10
  >       assert linear.get_freq(5) == 10
  
  sunpy/spectra/tests/test_spectrogram.py:815: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  sunpy/spectra/spectrogram.py:146: in get_freq
      return self._find(self.arr.freq_axis, item)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <sunpy.spectra.spectrogram._LinearView object at 0x7f0050b06150>
  arr = array([20, 10,  5,  0]), item = 5
  
      def _find(self, arr, item):
          if item < 0:
              item = item % len(self)
          if item >= len(self):
              raise IndexError
      
          freq_offset = item * self.delt
          freq = self.arr.freq_axis[0] - freq_offset
          # The idea is that when we take the biggest delta in the mid points,
          # we do not have to search anything that is between the beginning and
          # the first item that can possibly be that frequency.
          min_mid = max(0, (freq - self.midpoints[0]) // self.max_mp_delt)
  >       for n, mid in enumerate(self.midpoints[min_mid:]):
  E       IndexError: invalid slice
  
  sunpy/spectra/spectrogram.py:137: IndexError
  ============ 110 tests deselected by '-knot figure and not online' =============
  = 36 failed, 657 passed, 15 skipped, 110 deselected, 4 error in 27.77 seconds ==
  debian/rules:14: recipe for target 'override_dh_auto_test' failed
  make[1]: *** [override_dh_auto_test] Error 1
  make[1]: Leaving directory '/home/lamby/temp/cdt.20160206205038.UCW69LXJO5/sunpy-0.6.1'
  debian/rules:11: recipe for target 'build' failed
  make: *** [build] Error 2

  [..]

The full build log is attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sunpy.0.6.1-2.unstable.amd64.log.txt.gz
Type: application/octet-stream
Size: 15123 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20160206/7dccc549/attachment.obj>


More information about the Reproducible-builds mailing list