Skip to content

Commit 180f947

Browse files
update documentation
1 parent 429a505 commit 180f947

10 files changed

Lines changed: 23 additions & 25 deletions

File tree

pina/_src/condition/data_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from torch_geometric.data.batch import Batch
88
from pina import LabelTensor
99
from pina._src.core.graph import Graph, LabelBatch
10-
from ..equation.equation_interface import EquationInterface
10+
from pina._src.equation.base_equation import BaseEquation
1111
from .batch_manager import _BatchManager
1212

1313

@@ -39,7 +39,7 @@ def __new__(cls, **kwargs):
3939

4040
# Does the data contain only tensors/LabelTensors/Equations?
4141
is_tensor_only = all(
42-
isinstance(v, (torch.Tensor, LabelTensor, EquationInterface))
42+
isinstance(v, (torch.Tensor, LabelTensor, BaseEquation))
4343
for v in kwargs.values()
4444
)
4545
# Choose the appropriate subclass, GraphDataManager or TensorDataManager

pina/_src/condition/domain_equation_condition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pina._src.condition.condition_base import ConditionBase
44
from pina._src.domain.domain_interface import DomainInterface
5-
from pina._src.equation.equation_interface import EquationInterface
5+
from pina._src.equation.base_equation import BaseEquation
66

77

88
class DomainEquationCondition(ConditionBase):
@@ -32,7 +32,7 @@ class DomainEquationCondition(ConditionBase):
3232
__fields__ = ["domain", "equation"]
3333

3434
_avail_domain_cls = (DomainInterface, str)
35-
_avail_equation_cls = EquationInterface
35+
_avail_equation_cls = BaseEquation
3636

3737
def __new__(cls, domain, equation):
3838
"""
@@ -52,7 +52,7 @@ def __new__(cls, domain, equation):
5252

5353
if not isinstance(equation, cls._avail_equation_cls):
5454
raise ValueError(
55-
"The equation must be an instance of EquationInterface."
55+
"The equation must be an instance of BaseEquation."
5656
)
5757

5858
return super().__new__(cls)

pina/_src/condition/input_equation_condition.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pina._src.condition.condition_base import ConditionBase
44
from pina._src.core.label_tensor import LabelTensor
55
from pina._src.core.graph import Graph
6-
from pina._src.equation.equation_interface import EquationInterface
6+
from pina._src.equation.base_equation import BaseEquation
77
from pina._src.condition.data_manager import _DataManager
88

99

@@ -32,7 +32,7 @@ class InputEquationCondition(ConditionBase):
3232
# Available input data types
3333
__fields__ = ["input", "equation"]
3434
_avail_input_cls = (LabelTensor, Graph)
35-
_avail_equation_cls = EquationInterface
35+
_avail_equation_cls = BaseEquation
3636

3737
def __new__(cls, input, equation):
3838
"""
@@ -41,7 +41,7 @@ def __new__(cls, input, equation):
4141
4242
:param input: The input data for the condition.
4343
:type input: LabelTensor | Graph | list[Graph] | tuple[Graph]
44-
:param EquationInterface equation: The equation to be satisfied over the
44+
:param BaseEquation equation: The equation to be satisfied over the
4545
specified ``input`` data.
4646
:return: The subclass of InputEquationCondition.
4747
:rtype: pina.condition.input_equation_condition.
@@ -61,7 +61,7 @@ def __new__(cls, input, equation):
6161
# Check equation type
6262
if not isinstance(equation, cls._avail_equation_cls):
6363
raise ValueError(
64-
"The equation must be an instance of EquationInterface."
64+
"The equation must be an instance of BaseEquation."
6565
)
6666

6767
return super().__new__(cls)
@@ -90,7 +90,7 @@ def equation(self):
9090
Return the equation associated with this condition.
9191
9292
:return: Equation associated with this condition.
93-
:rtype: EquationInterface
93+
:rtype: BaseEquation
9494
"""
9595
return self._equation
9696

@@ -99,11 +99,9 @@ def equation(self, value):
9999
"""
100100
Set the equation associated with this condition.
101101
102-
:param EquationInterface value: The equation to associate with this
102+
:param BaseEquation value: The equation to associate with this
103103
condition
104104
"""
105-
if not isinstance(value, EquationInterface):
106-
raise TypeError(
107-
"The equation must be an instance of EquationInterface."
108-
)
105+
if not isinstance(value, BaseEquation):
106+
raise TypeError("The equation must be an instance of BaseEquation.")
109107
self._equation = value

pina/_src/solver/ensemble_solver/ensemble_pinn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def loss_phys(self, samples, equation):
145145
model. This method should not be overridden, if not intentionally.
146146
147147
:param LabelTensor samples: The samples to evaluate the physics loss.
148-
:param EquationInterface equation: The governing equation.
148+
:param BaseEquation equation: The governing equation.
149149
:return: The computed physics loss.
150150
:rtype: LabelTensor
151151
"""
@@ -161,7 +161,7 @@ def _residual_loss(self, samples, equation):
161161
method.
162162
163163
:param LabelTensor samples: The samples to evaluate the loss.
164-
:param EquationInterface equation: The governing equation.
164+
:param BaseEquation equation: The governing equation.
165165
:return: The residual loss.
166166
:rtype: torch.Tensor
167167
"""

pina/_src/solver/physics_informed_solver/causal_pinn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def loss_phys(self, samples, equation):
120120
provided samples and equation.
121121
122122
:param LabelTensor samples: The samples to evaluate the physics loss.
123-
:param EquationInterface equation: The governing equation.
123+
:param BaseEquation equation: The governing equation.
124124
:return: The computed physics loss.
125125
:rtype: LabelTensor
126126
"""

pina/_src/solver/physics_informed_solver/competitive_pinn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def loss_phys(self, samples, equation):
146146
provided samples and equation.
147147
148148
:param LabelTensor samples: The samples to evaluate the physics loss.
149-
:param EquationInterface equation: The governing equation.
149+
:param BaseEquation equation: The governing equation.
150150
:return: The computed physics loss.
151151
:rtype: LabelTensor
152152
"""

pina/_src/solver/physics_informed_solver/gradient_pinn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def loss_phys(self, samples, equation):
110110
provided samples and equation.
111111
112112
:param LabelTensor samples: The samples to evaluate the physics loss.
113-
:param EquationInterface equation: The governing equation.
113+
:param BaseEquation equation: The governing equation.
114114
:return: The computed physics loss.
115115
:rtype: LabelTensor
116116
"""

pina/_src/solver/physics_informed_solver/pinn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def loss_phys(self, samples, equation):
105105
provided samples and equation.
106106
107107
:param LabelTensor samples: The samples to evaluate the physics loss.
108-
:param EquationInterface equation: The governing equation.
108+
:param BaseEquation equation: The governing equation.
109109
:return: The computed physics loss.
110110
:rtype: LabelTensor
111111
"""

pina/_src/solver/physics_informed_solver/pinn_interface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def loss_phys(self, samples, equation):
176176
subclasses. It distinguishes different types of PINN solvers.
177177
178178
:param LabelTensor samples: The samples to evaluate the physics loss.
179-
:param EquationInterface equation: The governing equation.
179+
:param BaseEquation equation: The governing equation.
180180
:return: The computed physics loss.
181181
:rtype: LabelTensor
182182
"""
@@ -186,7 +186,7 @@ def compute_residual(self, samples, equation):
186186
Compute the residuals of the equation.
187187
188188
:param LabelTensor samples: The samples to evaluate the loss.
189-
:param EquationInterface equation: The governing equation.
189+
:param BaseEquation equation: The governing equation.
190190
:return: The residual of the solution of the model.
191191
:rtype: LabelTensor
192192
"""
@@ -204,7 +204,7 @@ def _residual_loss(self, samples, equation):
204204
205205
206206
:param LabelTensor samples: The samples to evaluate the loss.
207-
:param EquationInterface equation: The governing equation.
207+
:param BaseEquation equation: The governing equation.
208208
:return: The residual loss.
209209
:rtype: torch.Tensor
210210
"""

pina/_src/solver/physics_informed_solver/self_adaptive_pinn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def loss_phys(self, samples, equation):
258258
provided samples and equation.
259259
260260
:param LabelTensor samples: The samples to evaluate the physics loss.
261-
:param EquationInterface equation: The governing equation.
261+
:param BaseEquation equation: The governing equation.
262262
:return: The computed physics loss.
263263
:rtype: LabelTensor
264264
"""

0 commit comments

Comments
 (0)