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
| 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
| record |
Record a job execution result in the registry. |
record
registry.RegistryCallback.record(job, result)
Record a job execution result in the registry.
Parameters
| job |
Any |
ExpandedJob that was executed. |
required |
| result |
Any |
CLIResult from the CLI execution. |
required |
Returns
|
str |
The run_id for the recorded run. |