Пример #1
0
def test_bounding_box_pass_with_ignored():
    """Test the possiblity of setting ignored variables in bounding box"""

    model = models.Polynomial2D(2)
    bbox = ModelBoundingBox.validate(model, (-1, 1), ignored=['y'])
    model.bounding_box = bbox
    assert model.bounding_box.bounding_box() == (-1, 1)
    assert model.bounding_box == bbox

    model = models.Polynomial2D(2)
    bind_bounding_box(model, (-1, 1), ignored=['y'])
    assert model.bounding_box.bounding_box() == (-1, 1)
    assert model.bounding_box == bbox
Пример #2
0
def test_bind_bounding_box():
    model = models.Polynomial2D(3)
    bbox = ((-1, 1), (-2, 2))

    bind_bounding_box(model, bbox)
    assert model.get_bounding_box() is not None
    assert model.bounding_box == bbox
    assert model.bounding_box['x'] == (-2, 2)
    assert model.bounding_box['y'] == (-1, 1)

    bind_bounding_box(model, bbox, order='F')
    assert model.get_bounding_box() is not None
    assert model.bounding_box == bbox
    assert model.bounding_box['x'] == (-1, 1)
    assert model.bounding_box['y'] == (-2, 2)