Fix codacy

This commit is contained in:
FilippoOlivo
2025-03-12 16:30:03 +01:00
parent f420b09960
commit 2c9e980c7f
3 changed files with 15 additions and 12 deletions

View File

@@ -68,10 +68,12 @@ class DataCondition(ConditionInterface):
:type conditional_variables: torch.Tensor or LabelTensor
.. note::
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)
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)
"""
super().__init__()
self.input = input
self.conditional_variables = conditional_variables

View File

@@ -20,8 +20,8 @@ class Graph(Data):
**kwargs,
):
"""
Create a new instance of the :class:`~pina.graph.Graph` class by checking
the consistency of the input data and storing the attributes.
Create a new instance of the :class:`~pina.graph.Graph` class by
checking the consistency of the input data and storing the attributes.
:param kwargs: Parameters used to initialize the
:class:`~pina.graph.Graph` object.
@@ -339,8 +339,8 @@ class KNNGraph(GraphBuilder):
def __new__(cls, pos, neighbours, **kwargs):
"""
Extends the :class:`~pina.graph.GraphBuilder` class to compute edge_index
based on a K-nearest neighbors algorithm.
Extends the :class:`~pina.graph.GraphBuilder` class to compute
edge_index based on a K-nearest neighbors algorithm.
:param pos: A tensor of shape (N, D) representing the positions of N
points in D-dimensional space.

View File

@@ -275,7 +275,8 @@ class LabelTensor(torch.Tensor):
def __str__(self):
"""
The string representation of the :class:`~pina.label_tensor.LabelTensor`.
The string representation of the
:class:`~pina.label_tensor.LabelTensor`.
:return: String representation of the
:class:`~pina.label_tensor.LabelTensor` instance.
@@ -295,8 +296,8 @@ class LabelTensor(torch.Tensor):
Concatenate a list of tensors along a specified dimension. For more
details, see :meth:`torch.cat`.
:param list[LabelTensor] tensors: :class:`~pina.label_tensor.LabelTensor`
instances to concatenate
:param list[LabelTensor] tensors:
:class:`~pina.label_tensor.LabelTensor` instances to concatenate
:param int dim: dimensions on which you want to perform the operation
(default is 0)
:return: A new :class:`LabelTensor' instance obtained by concatenating
@@ -472,8 +473,8 @@ class LabelTensor(torch.Tensor):
Stack tensors vertically. For more details, see :meth:`torch.vstack`.
:param list of LabelTensor label_tensors: The
:class:`~pina.label_tensor.LabelTensor` instances to stack. They need
to have equal labels.
:class:`~pina.label_tensor.LabelTensor` instances to stack. They
need to have equal labels.
:return: A new :class:`~pina.label_tensor.LabelTensor` instance obtained
by stacking the input tensors vertically.
:rtype: LabelTensor