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.

observablestr (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

Attributes Summary

default_params

Default parameters.

frame

Representation Type.

observable

Observable.

original_potential

Original potential.

representation_type

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.

observablestr or None (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 with default_params (preferring kwargs). See Other Parameters for more details.

Returns:
residualobject

In representation_type.

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.

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.

observablestr or None (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 with default_params (preferring kwargs).

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_potentialPotentialWrapper or sequence thereof

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.

observablestr or None (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 with default_params (preferring kwargs).

Returns:
residualobject

In representation_type.

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.