コード例 #1
0
def test_simple_setter():
    weights_1 = np.array([1, 2, 3])
    simple_asf = SimpleASF(weights_1)
    weights_2 = np.array([1, 2, 4])

    assert np.all(np.isclose(simple_asf.weights, weights_1))
    assert not np.all(np.isclose(simple_asf.weights, weights_2))

    simple_asf.weights = weights_2

    assert np.all(np.isclose(simple_asf.weights, weights_2))
    assert not np.all(np.isclose(simple_asf.weights, weights_1))
コード例 #2
0
def test_change_asf_parameters(SimpleASFCylinderSolver):
    weights = np.array([1, 1, 1])
    solver = SimpleASFCylinderSolver
    asf = SimpleASF(weights)
    solver.asf = asf

    before = solver.asf.weights
    asf.weights = np.array([2, 2, 2])
    after = solver.asf.weights

    assert np.all(np.isclose(after, np.array([2, 2, 2])))
    assert np.all(np.not_equal(before, after))