docstr: Test with mismatching peak and / or prominence data.
docstr_tok: ["Test","with","mismatching","peak","and","\/","or","prominence","data","."]
code: def test_mismatching_prominence_data(self):
      """Test with mismatching peak and / or prominence data."""
      for xp, scp in [(cupy, cupyx.scipy), (np, scipy)]:
          x = xp.asarray([0, 1, 0])
          peak = [1]
          for i, (prominences, left_bases, right_bases) in enumerate(
              [
                  ((1.0,), (-1,), (2,)),  # left base not in x
                  ((1.0,), (0,), (3,)),  # right base not in x
                  ((1.0,), (2,), (0,)),  # swapped bases same as peak
                  (
                      (1.0, 1.0),
                      (0, 0),
                      (2, 2),
                  ),  # array shapes don't match peaks
                  (
                      (1.0, 1.0),
                      (0,),
                      (2,),
                  ),  # arrays with different shapes
                  (
                      (1.0,),
                      (0, 0),
                      (2,),
                  ),  # arrays with different shapes
                  (
                      (1.0,),
                      (0,),
                      (2, 2),
                  ),  # arrays with different shapes
              ]
          ):
              # Make sure input is matches output of signal.peak_prominences
              prominence_data = (
                  xp.array(prominences, dtype=xp.float64),
                  xp.array(left_bases, dtype=xp.intp),
                  xp.array(right_bases, dtype=xp.intp),
              )
              # Test for correct exception
              if i < 3:
                  match = "prominence data is invalid"
              else:
                  match = (
                      "arrays in `prominence_data` must have the "
                      "same shape"
                  )
              with pytest.raises(ValueError, match=match):
                  scp.signal.peak_widths(
                      x, peak, prominence_data=prominence_data
                  )
  
imports: import pytest
  import cupy
  from cupy.cuda import driver
  from cupy.cuda import runtime
  from cupy import testing
  import cupyx.scipy.signal
  import numpy
label_desc: Use image node_id 5 for calling the TestPeakWidths obj's underlying member method code with example usage: obj.test_mismatching_prominence_data() without return types