quantlab.runs.directory.read_record#

quantlab.runs.directory.read_record(directory, kinds=None)[source]#

Return the run.json of the run in directory, after checking its header.

Parameters:
directoryPath or str

The run’s directory.

kindscollection of str, optional

The kinds the caller reads; any kind when not given.

Returns:
dict

The whole record, header included.

Raises:
ValueError

If directory has no run.json, it was written in a format_version other than FORMAT_VERSION, or its kind is not one of kinds.

Examples

>>> read_record(unit)["kind"]
'model'