fix connection issue
This commit is contained in:
committed by
Giovanni Canali
parent
09596a912c
commit
4ad939fdb9
@@ -1,12 +1,25 @@
|
||||
from pina.problem.zoo import InversePoisson2DSquareProblem
|
||||
from pina.problem import InverseProblem, SpatialProblem
|
||||
import pytest
|
||||
|
||||
|
||||
def test_constructor():
|
||||
problem = InversePoisson2DSquareProblem()
|
||||
@pytest.mark.parametrize("load", [True, False])
|
||||
@pytest.mark.parametrize("data_size", [0.01, 0.05])
|
||||
def test_constructor(load, data_size):
|
||||
|
||||
# Define the problem with or without loading data
|
||||
problem = InversePoisson2DSquareProblem(load=load, data_size=data_size)
|
||||
|
||||
# Discretise the domain
|
||||
problem.discretise_domain(n=10, mode="random", domains="all")
|
||||
|
||||
# Check if the problem is correctly set up
|
||||
assert problem.are_all_domains_discretised
|
||||
assert isinstance(problem, InverseProblem)
|
||||
assert isinstance(problem, SpatialProblem)
|
||||
assert hasattr(problem, "conditions")
|
||||
assert isinstance(problem.conditions, dict)
|
||||
|
||||
# Should fail if data_size is not in the range [0.0, 1.0]
|
||||
with pytest.raises(ValueError):
|
||||
problem = InversePoisson2DSquareProblem(load=load, data_size=3.0)
|
||||
|
||||
Reference in New Issue
Block a user