docstr: Test if x == eval_height counts as an intersection.
docstr_tok: ["Test","if","x","==","eval_height","counts","as","an","intersection","."]
code: def test_intersection_rules(self):
      """Test if x == eval_height counts as an intersection."""
      # Flatt peak with two possible intersection points if evaluated at 1
      x = [0, 1, 2, 1, 3, 3, 3, 1, 2, 1, 0]
      # relative height is 0 -> width is 0 as well, raises warning
      assert_allclose(
          peak_widths(x, peaks=[5], rel_height=0),
          [(0.0,), (3.0,), (5.0,), (5.0,)],
      )
      # width_height == x counts as intersection -> nearest 1 is chosen
      assert_allclose(
          peak_widths(x, peaks=[5], rel_height=2 / 3),
          [(4.0,), (1.0,), (3.0,), (7.0,)],
      )
  
imports: import copy
  import numpy
  from numpy.testing import assert_, assert_equal, assert_allclose, assert_array_equal
  import pytest
  from pytest import raises, warns
  from scipy.signal._peak_finding import argrelmax, argrelmin, peak_prominences, peak_widths, _unpack_condition_args, find_peaks, find_peaks_cwt, _identify_ridge_lines
  from scipy.signal.windows import gaussian
  from scipy.signal._peak_finding_utils import _local_maxima_1d, PeakPropertyWarning
label_desc: Use image node_id 7 for calling the TestPeakWidths obj's underlying member method code with example usage: obj.test_intersection_rules() without return types