2f374baea50c75542ac44770c83fffc127680584,tests/test_bbox.py,,test_bbox_3,#,24

Before Change



@raises(NotImplementedError)
def test_bbox_3():
    mahotas.bbox(np.arange(3*3*3).reshape((3,3,3)))

After Change


    YXZ = np.indices((32,32,64), float)
    YXZ -= 8
    Y,X,Z = YXZ
    ball = ((X**2+Y**2+Z**2) < 64).astype(np.uint8)
    m0,M0,m1,M1,m2,M2 = mahotas.bbox(ball)

    Y,X,Z = np.where(ball)
    assert np.all(m0 <= Y)
    assert np.all(m1 <= X)
    assert np.all(m2 <= Z)
    assert np.all(M0 > Y)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: luispedro/mahotas
Commit Name: 2f374baea50c75542ac44770c83fffc127680584
Time: 2010-09-10
Author: lpc@cmu.edu
File Name: tests/test_bbox.py
Class Name:
Method Name: test_bbox_3


Project Name: PIQuIL/QuCumber
Commit Name: a3645eada1fd6b0dc2f262033a93b81a6ca84b55
Time: 2019-12-23
Author: emerali@users.noreply.github.com
File Name: qucumber/utils/unitaries.py
Class Name:
Method Name: rotate_psi_inner_prod


Project Name: tensorflow/models
Commit Name: 5e854f25098ca40a4ac80197607bf883feaeb375
Time: 2018-02-13
Author: lzc@google.com
File Name: research/object_detection/utils/learning_schedules.py
Class Name:
Method Name: manual_stepping