nvalchemi.dynamics.Hook#
- class nvalchemi.dynamics.Hook(*args, **kwargs)[source]#
Protocol defining the interface for dynamics hooks.
Hooks are callable objects that can be registered with a dynamics engine to perform custom operations at specific stages of the simulation. They are executed in-place and can modify the batch.
Users are expected to be able to develop their own hooks either by subclassing the Hook protocol class, or simply by ensuring that the class they intend to use as a hook provides the expected signature.
- frequency#
Execute the hook every N steps. A frequency of 1 means every step, 2 means every other step, etc.
- Type:
int
- stage#
The stage at which this hook should be fired.
- Type:
- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)Attributes