registry.RegistryCallback

registry.RegistryCallback(registry, session_id)

Helper for recording CLI results in the registry.

This class helps record the results of CLI executions in the registry, tracking run starts and completions.

Attributes

Name Type Description
registry RunRegistry The RunRegistry to record runs in.
session_id str The session ID for the current sweep.

Examples

>>> from joshpy.cli import JoshCLI
>>> from joshpy.jobs import JobExpander, to_run_config
>>> registry = RunRegistry("experiment.duckdb")
>>> session_id = registry.create_session(...)
>>> callback = RegistryCallback(registry, session_id)
>>> cli = JoshCLI()
>>> for job in job_set:
...     run_config = to_run_config(job)
...     result = cli.run(run_config)
...     callback.record(job, result)

Methods

Name Description
record Record a job execution result in the registry.

record

registry.RegistryCallback.record(job, result)

Record a job execution result in the registry.

Parameters

Name Type Description Default
job Any ExpandedJob that was executed. required
result Any CLIResult from the CLI execution. required

Returns

Name Type Description
str The run_id for the recorded run.