update doc

This commit is contained in:
Dario Coscia
2025-03-17 12:23:26 +01:00
committed by Nicola Demo
parent e917753702
commit 2526da36bf
33 changed files with 265 additions and 196 deletions

View File

@@ -47,7 +47,7 @@ class AbstractProblem(metaclass=ABCMeta):
Get batching dimension.
:return: The batching dimension.
:rtype int
:rtype: int
"""
return self._batching_dimension
@@ -85,7 +85,7 @@ class AbstractProblem(metaclass=ABCMeta):
points.
:return: The discretised domains.
:rtype dict
:rtype: dict
"""
return self._discretised_domains
@@ -178,13 +178,28 @@ class AbstractProblem(metaclass=ABCMeta):
chebyshev sampling, ``chebyshev``; grid sampling ``grid``.
:param domains: The domains from which to sample. Default is ``all``.
:type domains: str | list[str]
:param dict sample_rules: A dictionary of custom sampling rules.
:param dict sample_rules: A dictionary defining custom sampling rules
for input variables. If provided, it must contain a dictionary
specifying the sampling rule for each variable, overriding the
``n`` and ``mode`` arguments. Each key must correspond to the
input variables from
:meth:~pina.problem.AbstractProblem.input_variables, and its value
should be another dictionary with
two keys: ``n`` (number of points to sample) and ``mode``
(sampling method). Defaults to None.
:raises RuntimeError: If both ``n`` and ``sample_rules`` are specified.
:raises RuntimeError: If neither ``n`` nor ``sample_rules`` are set.
:Example:
>>> problem.discretise_domain(n=10, mode='grid')
>>> problem.discretise_domain(n=10, mode='grid', domains=['gamma1'])
>>> problem.discretise_domain(
... sample_rules={
... 'x': {'n': 10, 'mode': 'grid'},
... 'y': {'n': 100, 'mode': 'grid'}
... },
... domains=['D']
... )
.. warning::
``random`` is currently the only implemented ``mode`` for all
@@ -197,6 +212,11 @@ class AbstractProblem(metaclass=ABCMeta):
:class:`~pina.domain.intersection_domain.Intersection`.
The modes ``latin`` or ``lh``, ``chebyshev``, ``grid`` are only
implemented for :class:`~pina.domain.cartesian.CartesianDomain`.
.. warning::
If custom discretisation is applied by setting ``sample_rules`` not
to ``None``, then the discretised domain must be of class
:class:`~pina.domain.cartesian.CartesianDomain`
"""
# check consistecy n, mode, variables, locations