Tmp fixes

This commit is contained in:
FilippoOlivo
2025-03-14 10:20:56 +01:00
committed by Nicola Demo
parent c164db874b
commit 10ccae3a33
8 changed files with 74 additions and 69 deletions

View File

@@ -32,7 +32,7 @@ class Condition:
The class ``Condition`` is used to represent the constraints (physical
equations, boundary conditions, etc.) that should be satisfied in the
problem at hand. Condition objects are used to formulate the
PINA :obj:`pina.problem.abstract_problem.AbstractProblem` object.
PINA :class:`~pina.problem.abstract_problem.AbstractProblem` object.
Conditions can be specified in four ways:
1. By specifying the input and target of the condition; in such a
@@ -61,7 +61,7 @@ class Condition:
input, there are different implementations of the condition. For more
details, see :class:`~pina.condition.data_condition.DataCondition`.
Example::
:Example:
>>> from pina import Condition
>>> condition = Condition(

View File

@@ -28,7 +28,7 @@ class DataCondition(ConditionInterface):
def __new__(cls, input, conditional_variables=None):
"""
Instantiate the appropriate subclass of :class:`DataCondition` based on
the type of `input`.
the type of ``input``.
:param input: Input data for the condition.
:type input: torch.Tensor | LabelTensor | Graph |
@@ -72,7 +72,7 @@ class DataCondition(ConditionInterface):
:type conditional_variables: torch.Tensor or LabelTensor
.. note::
If either `input` is composed by a list of
If either ``input`` is composed by a list of
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data`,
all elements must have the same structure (keys and data
types)

View File

@@ -29,7 +29,7 @@ class InputEquationCondition(ConditionInterface):
def __new__(cls, input, equation):
"""
Instantiate the appropriate subclass of :class:`InputEquationCondition`
based on the type of `input`.
based on the type of ``input``.
:param input: Input data for the condition.
:type input: LabelTensor | Graph | list[Graph] | tuple[Graph]
@@ -74,7 +74,7 @@ class InputEquationCondition(ConditionInterface):
equation function.
.. note::
If `input` is composed by a list of :class:`~pina.graph.Graph`
If ``input`` is composed by a list of :class:`~pina.graph.Graph`
objects, all elements must have the same structure (keys and data
types). Moreover, at least one attribute must be a
:class:`~pina.label_tensor.LabelTensor`.

View File

@@ -52,7 +52,7 @@ class InputTargetCondition(ConditionInterface):
GraphInputTensorTargetCondition |
pina.condition.input_target_condition.GraphInputGraphTargetCondition
:raises ValueError: If `input` and/or `target` are not of type
:raises ValueError: If ``input`` and/or ``target`` are not of type
:class:`torch.Tensor`, :class:`~pina.label_tensor.LabelTensor`,
:class:`~pina.graph.Graph`, or :class:`~torch_geometric.data.Data`.
"""
@@ -94,7 +94,7 @@ class InputTargetCondition(ConditionInterface):
def __init__(self, input, target):
"""
Initialize the object by storing the `input` and `target` data.
Initialize the object by storing the ``input`` and ``target`` data.
:param input: Input data for the condition.
:type input: torch.Tensor | LabelTensor | Graph | Data | list[Graph] |
@@ -104,7 +104,7 @@ class InputTargetCondition(ConditionInterface):
list[Data] | tuple[Graph] | tuple[Data]
.. note::
If either `input` or `target` are composed by a list of
If either ``input`` or ``target`` are composed by a list of
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data`
objects, all elements must have the same structure (keys and data
types)
@@ -130,14 +130,14 @@ class InputTargetCondition(ConditionInterface):
class TensorInputTensorTargetCondition(InputTargetCondition):
"""
InputTargetCondition subclass for :class:`torch.Tensor` or
:class:`~pina.label_tensor.LabelTensor` `input` and `target` data.
:class:`~pina.label_tensor.LabelTensor` ``input`` and ``target`` data.
"""
class TensorInputGraphTargetCondition(InputTargetCondition):
"""
InputTargetCondition subclass for :class:`torch.Tensor` or
:class:`~pina.label_tensor.LabelTensor` `input` and
:class:`~pina.label_tensor.LabelTensor` ``input`` and
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data` `target`
data.
"""
@@ -146,13 +146,13 @@ class TensorInputGraphTargetCondition(InputTargetCondition):
class GraphInputTensorTargetCondition(InputTargetCondition):
"""
InputTargetCondition subclass for :class:`~pina.graph.Graph` o
:class:`~torch_geometric.data.Data` `input` and :class:`torch.Tensor` or
:class:`~pina.label_tensor.LabelTensor` `target` data.
:class:`~torch_geometric.data.Data` ``input`` and :class:`torch.Tensor` or
:class:`~pina.label_tensor.LabelTensor` ``target`` data.
"""
class GraphInputGraphTargetCondition(InputTargetCondition):
"""
InputTargetCondition subclass for :class:`~pina.graph.Graph`/
:class:`~torch_geometric.data.Data` `input` and `target` data.
:class:`~torch_geometric.data.Data` ``input`` and ``target`` data.
"""