Skip to content

Commit 89f8e4e

Browse files
committed
Tmp fixes
1 parent 488af56 commit 89f8e4e

File tree

8 files changed

+74
-69
lines changed

8 files changed

+74
-69
lines changed

pina/collector.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ def __init__(self, problem):
3737
@property
3838
def full(self):
3939
"""
40-
Returns True if the collector is full. The collector is considered full
41-
if all conditions have entries in the data_collection dictionary.
40+
Returns ``True`` if the collector is full. The collector is considered
41+
full if all conditions have entries in the ``data_collection``
42+
dictionary.
4243
43-
:return: True if all conditions are ready, False otherwise.
44+
:return: ``True`` if all conditions are ready, ``False`` otherwise.
4445
:rtype: bool
4546
"""
4647

@@ -49,9 +50,9 @@ def full(self):
4950
@full.setter
5051
def full(self, value):
5152
"""
52-
Set the full variable.
53+
Set the ``_full`` variable.
5354
54-
:param bool value: The value to set the full property to.
55+
:param bool value: The value to set the ``_full`` variable.
5556
"""
5657

5758
check_consistency(value, bool)
@@ -117,7 +118,8 @@ def store_sample_domains(self):
117118
"""
118119
Store inside data collections the sampled data of the problem. These
119120
comes from the conditions that require sampling (e.g.
120-
DomainEquationCondition).
121+
:class:`~pina.condition.domain_equation_condition.
122+
DomainEquationCondition`).
121123
"""
122124

123125
for condition_name in self.problem.conditions:

pina/condition/condition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Condition:
3232
The class ``Condition`` is used to represent the constraints (physical
3333
equations, boundary conditions, etc.) that should be satisfied in the
3434
problem at hand. Condition objects are used to formulate the
35-
PINA :obj:`pina.problem.abstract_problem.AbstractProblem` object.
35+
PINA :class:`~pina.problem.abstract_problem.AbstractProblem` object.
3636
Conditions can be specified in four ways:
3737
3838
1. By specifying the input and target of the condition; in such a
@@ -61,7 +61,7 @@ class Condition:
6161
input, there are different implementations of the condition. For more
6262
details, see :class:`~pina.condition.data_condition.DataCondition`.
6363
64-
Example::
64+
:Example:
6565
6666
>>> from pina import Condition
6767
>>> condition = Condition(

pina/condition/data_condition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DataCondition(ConditionInterface):
2828
def __new__(cls, input, conditional_variables=None):
2929
"""
3030
Instantiate the appropriate subclass of :class:`DataCondition` based on
31-
the type of `input`.
31+
the type of ``input``.
3232
3333
:param input: Input data for the condition.
3434
:type input: torch.Tensor | LabelTensor | Graph |
@@ -72,7 +72,7 @@ def __init__(self, input, conditional_variables=None):
7272
:type conditional_variables: torch.Tensor or LabelTensor
7373
7474
.. note::
75-
If either `input` is composed by a list of
75+
If either ``input`` is composed by a list of
7676
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data`,
7777
all elements must have the same structure (keys and data
7878
types)

pina/condition/input_equation_condition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class InputEquationCondition(ConditionInterface):
2929
def __new__(cls, input, equation):
3030
"""
3131
Instantiate the appropriate subclass of :class:`InputEquationCondition`
32-
based on the type of `input`.
32+
based on the type of ``input``.
3333
3434
:param input: Input data for the condition.
3535
:type input: LabelTensor | Graph | list[Graph] | tuple[Graph]
@@ -74,7 +74,7 @@ def __init__(self, input, equation):
7474
equation function.
7575
7676
.. note::
77-
If `input` is composed by a list of :class:`~pina.graph.Graph`
77+
If ``input`` is composed by a list of :class:`~pina.graph.Graph`
7878
objects, all elements must have the same structure (keys and data
7979
types). Moreover, at least one attribute must be a
8080
:class:`~pina.label_tensor.LabelTensor`.

pina/condition/input_target_condition.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __new__(cls, input, target):
5252
GraphInputTensorTargetCondition |
5353
pina.condition.input_target_condition.GraphInputGraphTargetCondition
5454
55-
:raises ValueError: If `input` and/or `target` are not of type
55+
:raises ValueError: If ``input`` and/or ``target`` are not of type
5656
:class:`torch.Tensor`, :class:`~pina.label_tensor.LabelTensor`,
5757
:class:`~pina.graph.Graph`, or :class:`~torch_geometric.data.Data`.
5858
"""
@@ -94,7 +94,7 @@ def __new__(cls, input, target):
9494

9595
def __init__(self, input, target):
9696
"""
97-
Initialize the object by storing the `input` and `target` data.
97+
Initialize the object by storing the ``input`` and ``target`` data.
9898
9999
:param input: Input data for the condition.
100100
:type input: torch.Tensor | LabelTensor | Graph | Data | list[Graph] |
@@ -104,7 +104,7 @@ def __init__(self, input, target):
104104
list[Data] | tuple[Graph] | tuple[Data]
105105
106106
.. note::
107-
If either `input` or `target` are composed by a list of
107+
If either ``input`` or ``target`` are composed by a list of
108108
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data`
109109
objects, all elements must have the same structure (keys and data
110110
types)
@@ -130,14 +130,14 @@ def _check_input_target_len(input, target):
130130
class TensorInputTensorTargetCondition(InputTargetCondition):
131131
"""
132132
InputTargetCondition subclass for :class:`torch.Tensor` or
133-
:class:`~pina.label_tensor.LabelTensor` `input` and `target` data.
133+
:class:`~pina.label_tensor.LabelTensor` ``input`` and ``target`` data.
134134
"""
135135

136136

137137
class TensorInputGraphTargetCondition(InputTargetCondition):
138138
"""
139139
InputTargetCondition subclass for :class:`torch.Tensor` or
140-
:class:`~pina.label_tensor.LabelTensor` `input` and
140+
:class:`~pina.label_tensor.LabelTensor` ``input`` and
141141
:class:`~pina.graph.Graph` or :class:`~torch_geometric.data.Data` `target`
142142
data.
143143
"""
@@ -146,13 +146,13 @@ class TensorInputGraphTargetCondition(InputTargetCondition):
146146
class GraphInputTensorTargetCondition(InputTargetCondition):
147147
"""
148148
InputTargetCondition subclass for :class:`~pina.graph.Graph` o
149-
:class:`~torch_geometric.data.Data` `input` and :class:`torch.Tensor` or
150-
:class:`~pina.label_tensor.LabelTensor` `target` data.
149+
:class:`~torch_geometric.data.Data` ``input`` and :class:`torch.Tensor` or
150+
:class:`~pina.label_tensor.LabelTensor` ``target`` data.
151151
"""
152152

153153

154154
class GraphInputGraphTargetCondition(InputTargetCondition):
155155
"""
156156
InputTargetCondition subclass for :class:`~pina.graph.Graph`/
157-
:class:`~torch_geometric.data.Data` `input` and `target` data.
157+
:class:`~torch_geometric.data.Data` ``input`` and ``target`` data.
158158
"""

pina/data/data_module.py

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

1818
class DummyDataloader:
1919
"""
20-
Dataloader used when batch size is `None`. It returns the entire dataset
20+
Dataloader used when batch size is ``None``. It returns the entire dataset
2121
in a single batch.
2222
"""
2323

@@ -38,7 +38,7 @@ def __init__(self, dataset):
3838
:param dataset: The dataset object to be processed.
3939
:type dataset: PinaDataset
4040
41-
.. note:: This data loader is used when the batch size is `None`.
41+
.. note:: This data loader is used when the batch size is ``None``.
4242
"""
4343

4444
if (
@@ -273,7 +273,7 @@ def __init__(
273273
be in the range [0, 1].
274274
:param float val_size: Fraction of elements in the validation split. It
275275
must be in the range [0, 1].
276-
:param batch_size: The batch size used for training. If `None`, the
276+
:param batch_size: The batch size used for training. If ``None``, the
277277
entire dataset is returned in a single batch.
278278
:type batch_size: int | None
279279
:param bool shuffle: Whether to shuffle the dataset before splitting.

pina/data/dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def __new__(cls, conditions_dict, **kwargs):
3333
:param dict conditions_dict: Dictionary containing all the conditions
3434
to be included in the dataset instance.
3535
:return: A subclass of :class:`~pina.data.dataset.PinaDataset`.
36-
:rtype: :class:`~pina.data.dataset.PinaTensorDataset` |
37-
:class:`~pina.data.dataset.PinaGraphDataset`
36+
:rtype: pina.data.dataset.PinaTensorDataset |
37+
pina.data.dataset.PinaGraphDataset
3838
3939
:raises ValueError: If an empty dictionary is provided.
4040
"""
@@ -255,7 +255,7 @@ def _create_graph_batch(self, data):
255255

256256
def _create_tensor_batch(self, data):
257257
"""
258-
Reshape properly `data` tensor to be processed handle by the graph
258+
Reshape properly ``data`` tensor to be processed handle by the graph
259259
based models.
260260
261261
:param data: torch.Tensor object of shape (N, ...) where N is the

0 commit comments

Comments
 (0)