Documentation for v0.1 version (#199)
* Adding Equations, solving typos * improve _code.rst * the team rst and restuctore index.rst * fixing errors --------- Co-authored-by: Dario Coscia <dariocoscia@dhcp-015.eduroam.sissa.it>
This commit is contained in:
committed by
Nicola Demo
parent
3f9305d475
commit
8b7b61b3bd
@@ -1,17 +1,19 @@
|
||||
import torch
|
||||
import pytest
|
||||
|
||||
from pina import LabelTensor, Condition, CartesianDomain, PINN
|
||||
from pina import LabelTensor, Condition
|
||||
from pina.solvers import PINN
|
||||
from pina.geometry import CartesianDomain
|
||||
from pina.problem import SpatialProblem
|
||||
from pina.model import FeedForward
|
||||
from pina.operators import laplacian
|
||||
from pina.equation.equation_factory import FixedValue
|
||||
|
||||
|
||||
example_domain = CartesianDomain({'x': [0, 1], 'y': [0, 1]})
|
||||
example_input_pts = LabelTensor(torch.tensor([[0, 0, 0]]), ['x', 'y', 'z'])
|
||||
example_output_pts = LabelTensor(torch.tensor([[1, 2]]), ['a', 'b'])
|
||||
|
||||
|
||||
def test_init_inputoutput():
|
||||
Condition(input_points=example_input_pts, output_points=example_output_pts)
|
||||
with pytest.raises(ValueError):
|
||||
@@ -21,8 +23,9 @@ def test_init_inputoutput():
|
||||
with pytest.raises(TypeError):
|
||||
Condition(input_points=example_domain, output_points=example_domain)
|
||||
|
||||
|
||||
def test_init_locfunc():
|
||||
Condition(location=example_domain, equation=FixedValue(0.0))
|
||||
Condition(location=example_domain, equation=FixedValue(0.0))
|
||||
with pytest.raises(ValueError):
|
||||
Condition(example_domain, FixedValue(0.0))
|
||||
with pytest.raises(TypeError):
|
||||
@@ -30,6 +33,7 @@ def test_init_locfunc():
|
||||
with pytest.raises(TypeError):
|
||||
Condition(location=example_input_pts, equation=example_output_pts)
|
||||
|
||||
|
||||
def test_init_inputfunc():
|
||||
Condition(input_points=example_input_pts, equation=FixedValue(0.0))
|
||||
with pytest.raises(ValueError):
|
||||
|
||||
Reference in New Issue
Block a user