def test_panzoom_constraints_y():
    pz = PanZoom()
    pz.ymin, pz.ymax = -2, 2

    # Pan beyond the bounds.
    pz.pan_delta((2, -2))
    assert pz.pan == [2, -1]
    pz.reset()

    # Zoom beyond the bounds.
    pz.zoom_delta((-2, -1))
    assert pz.pan == [0, 0]
    assert pz.zoom[0] < .5
    assert pz.zoom[1] == .5
dataset/ETHPy150Open kwikteam/phy/phy/plot/tests/test_panzoom.py/test_panzoom_constraints_y/original