pydra.utils.messenger module
Messaging of states.
- class pydra.utils.messenger.AuditFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Flag
Auditing flags.
- ALL = 3
Track provenance and resource utilization.
- NONE = 0
Do not track provenance or monitor resources.
- PROV = 1
Track provenance only.
- RESOURCE = 2
Monitor resource utilization only.
- class pydra.utils.messenger.Messenger
Bases:
object
Base messenger class.
- abstract send(message, **kwargs)
Send a message.
- class pydra.utils.messenger.PrintMessenger
Bases:
Messenger
A messenger that redirects to standard output.
- class pydra.utils.messenger.RemoteRESTMessenger
Bases:
Messenger
A messenger that redirects to remote REST endpoint.
- class pydra.utils.messenger.RuntimeHooks(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
Allowed points to hook into the process.
- resource_monitor_post_stop = 4
- resource_monitor_pre_start = 3
- task_execute_post_exit = 6
- task_execute_pre_entry = 5
- task_run_entry = 1
- task_run_exit = 2
- pydra.utils.messenger.collect_messages(collected_path, message_path, ld_op='compact')
Compile all messages into a single provenance graph.
- Parameters:
collected_path (
os.pathlike
) – A place to write all of the collected messages. (?TODO)message_path (
os.pathlike
) – A path with the message file (?TODO)ld_op (
str
, optional) – Option used by pld.jsonld
- pydra.utils.messenger.gen_uuid()
Generate a unique identifier.
- pydra.utils.messenger.make_message(obj, context=None)
Build a message using the specific context
- pydra.utils.messenger.now()
Get a formatted timestamp.
- pydra.utils.messenger.send_message(message, messengers=None, **kwargs)
Send NIDM messages for logging provenance and auditing.