def test_ProductPSpace():
    X = Normal('X', 0, 1)
    Y = Normal('Y', 0, 1)
    px = X.pspace
    py = Y.pspace
    assert pspace(X + Y) == ProductPSpace(px, py)
    assert pspace(X + Y) == ProductPSpace(py, px)
Exemple #2
0
def test_pspace():
    X, Y = Normal('X', 0, 1), Normal('Y', 0, 1)

    assert not pspace(5 + 3)
    assert pspace(X) == X.pspace
    assert pspace(2 * X + 1) == X.pspace
    assert pspace(2 * X + Y) == ProductPSpace(Y.pspace, X.pspace)
def test_pspace():
    X, Y = Normal('X', 0, 1), Normal('Y', 0, 1)

    raises(ValueError, lambda: pspace(5 + 3))
    raises(ValueError, lambda: pspace(x < 1))
    assert pspace(X) == X.pspace
    assert pspace(2*X + 1) == X.pspace
    assert pspace(2*X + Y) == ProductPSpace(Y.pspace, X.pspace)