Skip to content

Commit 04ef78e

Browse files
GiovanniCanalidario-coscia
authored andcommitted
fix doc loss and codacy
1 parent e7c8710 commit 04ef78e

15 files changed

+115
-109
lines changed

pina/domain/cartesian.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ def is_inside(self, point, check_border=False):
270270
:param LabelTensor point: Point to be checked.
271271
:param bool check_border: If ``True``, the border is considered inside
272272
the hypercube. Default is ``False``.
273-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
273+
:return: ``True`` if the point is inside the domain,
274+
``False`` otherwise.
274275
:rtype: bool
275276
"""
276277
is_inside = []

pina/domain/difference_domain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def is_inside(self, point, check_border=False):
4545
:param LabelTensor point: Point to be checked.
4646
:param bool check_border: If ``True``, the border is considered inside
4747
the domain. Default is ``False``.
48-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
48+
:return: ``True`` if the point is inside the domain,
49+
``False`` otherwise.
4950
:rtype: bool
5051
"""
5152
for geometry in self.geometries[1:]:

pina/domain/ellipsoid.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ def __init__(self, ellipsoid_dict, sample_surface=False):
1818
:param dict ellipsoid_dict: A dictionary where the keys are the variable
1919
names and the values are the domain extrema.
2020
:param bool sample_surface: A flag to choose the sampling strategy.
21-
If ``True``, samples are taken only from the surface of the ellipsoid.
21+
If ``True``, samples are taken from the surface of the ellipsoid.
2222
If ``False``, samples are taken from the interior of the ellipsoid.
2323
Default is ``False``.
2424
:raises TypeError: If the input dictionary is not correctly formatted.
2525
2626
.. warning::
2727
Sampling for dimensions greater or equal to 10 could result in a
2828
shrinkage of the ellipsoid, which degrades the quality of the
29-
samples. For dimensions higher than 10, use other sampling algorithms.
29+
samples. For dimensions higher than 10, use other sampling
30+
algorithms.
3031
.. seealso::
3132
**Original reference**: Dezert, Jean, and Musso, Christian.
3233
*An efficient method for generating points uniformly distributed
@@ -101,7 +102,8 @@ def is_inside(self, point, check_border=False):
101102
the ellipsoid. Default is ``False``.
102103
:raises ValueError: If the labels of the point are different from those
103104
passed in the ``__init__`` method.
104-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
105+
:return: ``True`` if the point is inside the domain,
106+
``False`` otherwise.
105107
:rtype: bool
106108
107109
.. note::
@@ -147,7 +149,6 @@ def is_inside(self, point, check_border=False):
147149
return bool(eqn < 0)
148150

149151
def _sample_range(self, n, mode, variables):
150-
""""""
151152
"""
152153
Rescale the samples to fit within the specified bounds.
153154

pina/domain/exclusion_domain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def is_inside(self, point, check_border=False):
4444
:param LabelTensor point: Point to be checked.
4545
:param bool check_border: If ``True``, the border is considered inside
4646
the domain. Default is ``False``.
47-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
47+
:return: ``True`` if the point is inside the domain,
48+
``False`` otherwise.
4849
:rtype: bool
4950
"""
5051
flag = 0

pina/domain/intersection_domain.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def __init__(self, geometries):
2424
Initialization of the :class:`Intersection` class.
2525
2626
:param list[DomainInterface] geometries: A list of instances of the
27-
:class:`~pina.domain.DomainInterface` class on which the intersection
28-
operation is performed.
27+
:class:`~pina.domain.DomainInterface` class on which the
28+
intersection operation is performed.
2929
3030
:Example:
3131
>>> # Create two ellipsoid domains
@@ -43,7 +43,8 @@ def is_inside(self, point, check_border=False):
4343
:param LabelTensor point: Point to be checked.
4444
:param bool check_border: If ``True``, the border is considered inside
4545
the domain. Default is ``False``.
46-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
46+
:return: ``True`` if the point is inside the domain,
47+
``False`` otherwise.
4748
:rtype: bool
4849
"""
4950
flag = 0

pina/domain/operation_interface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def is_inside(self, point, check_border=False):
7070
:param LabelTensor point: Point to be checked.
7171
:param bool check_border: If ``True``, the border is considered inside
7272
the resulting domain. Default is ``False``.
73-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
73+
:return: ``True`` if the point is inside the domain,
74+
``False`` otherwise.
7475
:rtype: bool
7576
"""
7677

pina/domain/simplex.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _build_cartesian(self, vertices):
9898
"""
9999
Build the cartesian border for a simplex domain to be used in sampling.
100100
101-
:param list[LabelTensor] vertices: Matrix of vertices defining the domain.
101+
:param list[LabelTensor] vertices: list of vertices defining the domain.
102102
:return: The cartesian border for the simplex domain.
103103
:rtype: CartesianDomain
104104
"""
@@ -124,7 +124,8 @@ def is_inside(self, point, check_border=False):
124124
the simplex. Default is ``False``.
125125
:raises ValueError: If the labels of the point are different from those
126126
passed in the ``__init__`` method.
127-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
127+
:return: ``True`` if the point is inside the domain,
128+
``False`` otherwise.
128129
:rtype: bool
129130
"""
130131

pina/domain/union_domain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def is_inside(self, point, check_border=False):
5151
:param LabelTensor point: Point to be checked.
5252
:param bool check_border: If ``True``, the border is considered inside
5353
the domain. Default is ``False``.
54-
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
54+
:return: ``True`` if the point is inside the domain,
55+
``False`` otherwise.
5556
:rtype: bool
5657
"""
5758
for geometry in self.geometries:

pina/equation/system_equation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def residual(self, input_, output_, params_=None):
5353
aggregate it according to the ``reduction`` specified in the
5454
``__init__`` method.
5555
56-
:param LabelTensor input_: Input points where each equation is evaluated.
56+
:param LabelTensor input_: Input points where each equation of the
57+
system is evaluated.
5758
:param LabelTensor output_: Output tensor, eventually produced by a
5859
:class:`~torch.nn.Module` instance.
5960
:param dict params_: Dictionary of unknown parameters, associated with a

pina/loss/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Module for loss functions and weighting functions.
3-
"""
1+
"""Module for loss functions and weighting functions."""
42

53
__all__ = [
64
"LossInterface",

0 commit comments

Comments
 (0)