pytams.diagnostic¶
Diagnostic class for pyTAMS.
Classes¶
A base class for diagnostic plugins. |
|
Triggers when the score function crosses pre-defined levels. |
|
A class to handle analysing diagnostic statistics. |
Functions¶
|
Parse input parameters to generate a list of DiagnosticPlugin. |
Module Contents¶
- class DiagnosticPlugin(dlabel: str, params: dict[Any, Any], tid: int, weight: float, workdir: pathlib.Path, fprocess: collections.abc.Callable[Ellipsis, Any], ddb: pytams.diagdb.DiagDB)[source]¶
A base class for diagnostic plugins.
Plugins are attached to the trajectory objects.
- Variables:
_label – the diagnostic label
_tid – the ID of the trajectory the plugin is attached to
_weight – the weight of the trajectory
- abstractmethod get_crossed_levels(new_snapshot: pytams.snapshot.Snapshot) list[float][source]¶
Test to know if diagnostic is needed.
- update(old_snapshot: pytams.snapshot.Snapshot, new_snapshot: pytams.snapshot.Snapshot) None[source]¶
Standard entry point called after every MCMC step.
- class ScoreThresholdDiagnostic(dlabel: str, params: dict[Any, Any], tid: int, tweight: float, workdir: pathlib.Path, fprocess: collections.abc.Callable[Ellipsis, Any], ddb: pytams.diagdb.DiagDB)[source]¶
Bases:
DiagnosticPluginTriggers when the score function crosses pre-defined levels.
- get_crossed_levels(new_snapshot: pytams.snapshot.Snapshot) list[float][source]¶
Get the list of level crossed during last step.
- Parameters:
new_snapshot – the new (end of the time step) snapshot
- Returns:
the list of score levels crossed
- diagnosticfactory(params: dict[Any, Any], tid: int, tweight: float, workdir: pathlib.Path, fprocess: collections.abc.Callable[Ellipsis, Any], ddb: pytams.diagdb.DiagDB) list[DiagnosticPlugin][source]¶
Parse input parameters to generate a list of DiagnosticPlugin.
- Parameters:
params – the input parameters
tid – the ID of the traj the diagnostic is attached to
tweight – the weight of the traj
workdir – the workdir associated with a trajectory
fprocess – the forward model diagnostic function
ddb – the diagnostic database to add the data to
- class DiagnosticAnalyst(db_path: str)[source]¶
A class to handle analysing diagnostic statistics.
Let’s keep the analysis logic separated from the gathering logic. This class retrieves data from the diagnostic database and perform some computation (mostly conditional statistics on score iso-levels).