fix doc loss and codacy

This commit is contained in:
giovanni
2025-03-12 18:05:42 +01:00
committed by FilippoOlivo
parent 2c9e980c7f
commit da1ac90b99
15 changed files with 114 additions and 108 deletions

View File

@@ -270,7 +270,8 @@ class CartesianDomain(DomainInterface):
:param LabelTensor point: Point to be checked.
:param bool check_border: If ``True``, the border is considered inside
the hypercube. Default is ``False``.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""
is_inside = []

View File

@@ -45,7 +45,8 @@ class Difference(OperationInterface):
:param LabelTensor point: Point to be checked.
:param bool check_border: If ``True``, the border is considered inside
the domain. Default is ``False``.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""
for geometry in self.geometries[1:]:

View File

@@ -18,7 +18,7 @@ class EllipsoidDomain(DomainInterface):
:param dict ellipsoid_dict: A dictionary where the keys are the variable
names and the values are the domain extrema.
:param bool sample_surface: A flag to choose the sampling strategy.
If ``True``, samples are taken only from the surface of the ellipsoid.
If ``True``, samples are taken from the surface of the ellipsoid.
If ``False``, samples are taken from the interior of the ellipsoid.
Default is ``False``.
:raises TypeError: If the input dictionary is not correctly formatted.
@@ -26,7 +26,8 @@ class EllipsoidDomain(DomainInterface):
.. warning::
Sampling for dimensions greater or equal to 10 could result in a
shrinkage of the ellipsoid, which degrades the quality of the
samples. For dimensions higher than 10, use other sampling algorithms.
samples. For dimensions higher than 10, use other sampling
algorithms.
.. seealso::
**Original reference**: Dezert, Jean, and Musso, Christian.
*An efficient method for generating points uniformly distributed
@@ -101,7 +102,8 @@ class EllipsoidDomain(DomainInterface):
the ellipsoid. Default is ``False``.
:raises ValueError: If the labels of the point are different from those
passed in the ``__init__`` method.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
.. note::
@@ -147,7 +149,6 @@ class EllipsoidDomain(DomainInterface):
return bool(eqn < 0)
def _sample_range(self, n, mode, variables):
""""""
"""
Rescale the samples to fit within the specified bounds.

View File

@@ -44,7 +44,8 @@ class Exclusion(OperationInterface):
:param LabelTensor point: Point to be checked.
:param bool check_border: If ``True``, the border is considered inside
the domain. Default is ``False``.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""
flag = 0

View File

@@ -24,8 +24,8 @@ class Intersection(OperationInterface):
Initialization of the :class:`Intersection` class.
:param list[DomainInterface] geometries: A list of instances of the
:class:`~pina.domain.DomainInterface` class on which the intersection
operation is performed.
:class:`~pina.domain.DomainInterface` class on which the
intersection operation is performed.
:Example:
>>> # Create two ellipsoid domains
@@ -43,7 +43,8 @@ class Intersection(OperationInterface):
:param LabelTensor point: Point to be checked.
:param bool check_border: If ``True``, the border is considered inside
the domain. Default is ``False``.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""
flag = 0

View File

@@ -70,7 +70,8 @@ class OperationInterface(DomainInterface, metaclass=ABCMeta):
:param LabelTensor point: Point to be checked.
:param bool check_border: If ``True``, the border is considered inside
the resulting domain. Default is ``False``.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""

View File

@@ -98,7 +98,7 @@ class SimplexDomain(DomainInterface):
"""
Build the cartesian border for a simplex domain to be used in sampling.
:param list[LabelTensor] vertices: Matrix of vertices defining the domain.
:param list[LabelTensor] vertices: list of vertices defining the domain.
:return: The cartesian border for the simplex domain.
:rtype: CartesianDomain
"""
@@ -124,7 +124,8 @@ class SimplexDomain(DomainInterface):
the simplex. Default is ``False``.
:raises ValueError: If the labels of the point are different from those
passed in the ``__init__`` method.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""

View File

@@ -51,7 +51,8 @@ class Union(OperationInterface):
:param LabelTensor point: Point to be checked.
:param bool check_border: If ``True``, the border is considered inside
the domain. Default is ``False``.
:return: ``True`` if the point is inside the domain, ``False`` otherwise.
:return: ``True`` if the point is inside the domain,
``False`` otherwise.
:rtype: bool
"""
for geometry in self.geometries: