Other fixes
This commit is contained in:
committed by
Nicola Demo
parent
ae796ce34c
commit
f587c3bf65
@@ -89,15 +89,15 @@ class Condition:
|
||||
Create a new condition object based on the keyword arguments passed.
|
||||
|
||||
- `input` and `target`:
|
||||
:class:`pina.condition.input_target_condition.InputTargetCondition`
|
||||
:class:`~pina.condition.input_target_condition.InputTargetCondition`
|
||||
- `domain` and `equation`:
|
||||
:class:`pina.condition.domain_equation_condition.
|
||||
:class:`~pina.condition.domain_equation_condition.
|
||||
DomainEquationCondition`
|
||||
- `input` and `equation`: :class:`pina.condition.
|
||||
- `input` and `equation`: :class:`~pina.condition.
|
||||
input_equation_condition.InputEquationCondition`
|
||||
- `input`: :class:`pina.condition.data_condition.DataCondition`
|
||||
- `input`: :class:`~pina.condition.data_condition.DataCondition`
|
||||
- `input` and `conditional_variables`:
|
||||
:class:`pina.condition.data_condition.DataCondition`
|
||||
:class:`~pina.condition.data_condition.DataCondition`
|
||||
|
||||
:raises ValueError: No valid condition has been found.
|
||||
:return: A new condition instance belonging to the proper class.
|
||||
|
||||
@@ -35,7 +35,7 @@ class DataCondition(ConditionInterface):
|
||||
pina.condition.data_condition.GraphDataCondition
|
||||
|
||||
:raises ValueError: If input is not of type :class:`torch.Tensor`,
|
||||
:class:`pina.label_tensor.LabelTensor`, :class:`pina.graph.Graph`,
|
||||
:class:`~pina.label_tensor.LabelTensor`, :class:`~pina.graph.Graph`,
|
||||
or :class:`~torch_geometric.data.Data`.
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class DataCondition(ConditionInterface):
|
||||
:type conditional_variables: torch.Tensor or LabelTensor
|
||||
|
||||
.. note::
|
||||
If either `input` is composed by a list of :class:`pina.graph.Graph`
|
||||
If either `input` is 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)
|
||||
"""
|
||||
@@ -80,12 +80,12 @@ class DataCondition(ConditionInterface):
|
||||
class TensorDataCondition(DataCondition):
|
||||
"""
|
||||
DataCondition for :class:`torch.Tensor` or
|
||||
:class:`pina.label_tensor.LabelTensor` input data
|
||||
:class:`~pina.label_tensor.LabelTensor` input data
|
||||
"""
|
||||
|
||||
|
||||
class GraphDataCondition(DataCondition):
|
||||
"""
|
||||
DataCondition for :class:`pina.graph.Graph` or
|
||||
DataCondition for :class:`~pina.graph.Graph` or
|
||||
:class:`~torch_geometric.data.Data` input data
|
||||
"""
|
||||
|
||||
@@ -35,7 +35,7 @@ class InputEquationCondition(ConditionInterface):
|
||||
pina.condition.input_equation_condition.InputGraphEquationCondition
|
||||
|
||||
:raises ValueError: If input is not of type
|
||||
:class:`pina.label_tensor.LabelTensor`, :class:`pina.graph.Graph`.
|
||||
:class:`~pina.label_tensor.LabelTensor`, :class:`~pina.graph.Graph`.
|
||||
"""
|
||||
|
||||
# If the class is already a subclass, return the instance
|
||||
@@ -62,15 +62,16 @@ class InputEquationCondition(ConditionInterface):
|
||||
Initialize the InputEquationCondition by storing the input and equation.
|
||||
|
||||
:param input: Input data for the condition.
|
||||
:type input: LabelTensor | Graph | list[Graph] | tuple[Graph]
|
||||
:type input: pina.label_tensor.LabelTensor | pina.graph.Graph |
|
||||
list[pina.graph.Graph] | tuple[pina.graph.Graph]
|
||||
:param EquationInterface equation: Equation object containing the
|
||||
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`.
|
||||
:class:`~pina.label_tensor.LabelTensor`.
|
||||
"""
|
||||
|
||||
super().__init__()
|
||||
@@ -90,21 +91,21 @@ class InputEquationCondition(ConditionInterface):
|
||||
|
||||
class InputTensorEquationCondition(InputEquationCondition):
|
||||
"""
|
||||
InputEquationCondition subclass for :class:`pina.label_tensor.LabelTensor`
|
||||
InputEquationCondition subclass for :class:`~pina.label_tensor.LabelTensor`
|
||||
input data.
|
||||
"""
|
||||
|
||||
|
||||
class InputGraphEquationCondition(InputEquationCondition):
|
||||
"""
|
||||
InputEquationCondition subclass for :class:`pina.graph.Graph` input data.
|
||||
InputEquationCondition subclass for :class:`~pina.graph.Graph` input data.
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def _check_label_tensor(input):
|
||||
"""
|
||||
Check if at least one :class:`pina.label_tensor.LabelTensor` is present
|
||||
in the :class:`pina.graph.Graph` object.
|
||||
Check if at least one :class:`~pina.label_tensor.LabelTensor` is present
|
||||
in the :class:`~pina.graph.Graph` object.
|
||||
|
||||
:param input: Input data.
|
||||
:type input: torch.Tensor | Graph | Data
|
||||
|
||||
@@ -44,8 +44,8 @@ class InputTargetCondition(ConditionInterface):
|
||||
pina.condition.input_target_condition.GraphInputGraphTargetCondition
|
||||
|
||||
: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`.
|
||||
:class:`torch.Tensor`, :class:`~pina.label_tensor.LabelTensor`,
|
||||
:class:`~pina.graph.Graph`, or :class:`~torch_geometric.data.Data`.
|
||||
"""
|
||||
if cls != InputTargetCondition:
|
||||
return super().__new__(cls)
|
||||
@@ -97,7 +97,7 @@ class InputTargetCondition(ConditionInterface):
|
||||
|
||||
.. note::
|
||||
If either `input` or `target` are composed by a list of
|
||||
:class:`pina.graph.Graph` or :class:`~torch_geometric.data.Data`
|
||||
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data`
|
||||
objects, all elements must have the same structure (keys and data
|
||||
types)
|
||||
"""
|
||||
@@ -122,29 +122,29 @@ 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.graph.Graph` or :class:`~torch_geometric.data.Data` target
|
||||
:class:`~pina.label_tensor.LabelTensor` input and
|
||||
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data` target
|
||||
data.
|
||||
"""
|
||||
|
||||
|
||||
class GraphInputTensorTargetCondition(InputTargetCondition):
|
||||
"""
|
||||
InputTargetCondition subclass for :class:`pina.graph.Graph` o
|
||||
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:`~pina.label_tensor.LabelTensor` target data.
|
||||
"""
|
||||
|
||||
|
||||
class GraphInputGraphTargetCondition(InputTargetCondition):
|
||||
"""
|
||||
InputTargetCondition subclass for :class:`pina.graph.Graph`/
|
||||
InputTargetCondition subclass for :class:`~pina.graph.Graph`/
|
||||
:class:`~torch_geometric.data.Data` input and target data.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user