ResidualMethod¶
- class discO.ResidualMethod(*args, method: str | None = None, **kwargs)[source]¶
Bases:
CommonBase
Calculate Residual.
- Parameters:
- original_potentialobject or
PotentialWrapper
The original potential. In order to evaluate on a grid with a frame, should be a
PotentialWrapper
.- observable
str
(optional) The quantity on which to calculate the residual. Must be method of
PotentialWrapper
.- representation_typerepresentation-resolvable (optional, keyword-only)
The output representation type. If None, resolves to
PotentialWrapper.base_representation
- original_potentialobject or
Attributes Summary
Default parameters.
Representation Type.
Observable.
Original potential.
Representation Type.
Methods Summary
__call__
(fit_potential[, ...])Calculate Residual.
evaluate_potential
(potential[, observable, ...])Evaluate method on potential.
run
(fit_potential[, original_potential, ...])Calculate Residual.
Attributes Documentation
- default_params¶
Default parameters.
- frame¶
Representation Type.
- observable¶
Observable.
- original_potential¶
Original potential.
- representation_type¶
Representation Type.
Methods Documentation
- __call__(fit_potential: Any, original_potential: Any | None = None, observable: str | None = None, *, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs) object [source]¶
Calculate Residual.
- Parameters:
- fit_potentialobject or
PotentialWrapper
The fitted potential. If not already a PotentialWrapper, it is wrapped: this means that the frame is
UnFrame
.- original_potentialobject or
PotentialWrapper
(optional) The original potential. If not already a PotentialWrapper, it is wrapped: this means that the frame is
UnFrame
.- observable
str
orNone
(optional) The quantity on which to calculate the residual. Must be method of
PotentialWrapper
. None (default) becomes the default value at initialization.- representation_type: representation-resolvable (optional, keyword-only)
The output representation type. If None (default), uses default representation point.
- **kwargs
Passed to method in
PotentialWrapper
. First mixed in withdefault_params
(preferringkwargs
). See Other Parameters for more details.
- fit_potentialobject or
- Returns:
- residualobject
- Other Parameters:
- pointsframe-like or
BaseRepresentation
(optional, keyword-only) Not recommended, but allowed, to force the points on which the residual is calculated. The points can only be frame-like if the frame of the potentials is not
UnFrame
. If not specified, and it shouldn’t be, uses points determined by the class at initialization.
- pointsframe-like or
- abstract evaluate_potential(potential: PotentialWrapper | Any, observable: str | None = None, *, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs) object [source]¶
Evaluate method on potential.
- Parameters:
- potentialobject or
PotentialWrapper
The potential. If not already a PotentialWrapper, it is wrapped: this means that the frame is
UnFrame
.- observable
str
orNone
(optional) name of method in
PotentialWrapper
. If None (default), uses default value –.observable
.- representation_type: representation-resolvable (optional, keyword-only)
The output representation type. If None (default), uses default representation point.
- **kwargs
Passed to method in
PotentialWrapper
. First mixed in withdefault_params
(preferringkwargs
).
- potentialobject or
- Returns:
- object
- Other Parameters:
- pointsframe-like or (optional, keyword-only)
Not recommended, but allowed, to force the points on which the residual is calculated. The points can only be frame-like if the frame of the potentials is not
UnFrame
. If not specified, and it shouldn’t be, uses points determined by the class at initialization.
- run(fit_potential: PotentialWrapper | Sequence[PotentialWrapper], original_potential: Any | None = None, observable: str | None = None, *, representation_type: BaseRepresentation | str | None | ellipsis = None, batch: bool = False, progress: bool = True, **kwargs) object [source]¶
Calculate Residual.
- Parameters:
- fit_potential
PotentialWrapper
or sequencethereof
The fitted potential. If not already a PotentialWrapper, it is wrapped: this means that the frame is
UnFrame
.- original_potentialobject or
PotentialWrapper
(optional) The original potential. If not already a PotentialWrapper, it is wrapped: this means that the frame is
UnFrame
.- observable
str
orNone
(optional) The quantity on which to calculate the residual. Must be method of
PotentialWrapper
. None (default) becomes the default value at initialization.- representation_type: representation-resolvable (optional, keyword-only)
The output representation type. If None (default), uses default representation point.
- **kwargs
Passed to method in
PotentialWrapper
. First mixed in withdefault_params
(preferringkwargs
).
- fit_potential
- Returns:
- residualobject
- Other Parameters:
- pointsframe-like or
BaseRepresentation
(optional, keyword-only) Not recommended, but allowed, to force the points on which the residual is calculated. The points can only be frame-like if the frame of the potentials is not
UnFrame
. If not specified, and it shouldn’t be, uses points determined by the class at initialization.
- pointsframe-like or