quantlab.runs.record.compare#
- quantlab.runs.record.compare(expected, actual, *, owner, partial=False)[source]#
Compare two provenance records, logging one warning per difference.
A provenance record holds
data_fingerprint(aDataRecorder.records) andcode(acode_record). Each of the two is compared when both sides hold it and neither isNone, so a caller with only the code passes{"code": ...}. Data are compared by digest alone, per key and request: a key or request on one side only, or a differing digest, logs a warning that explains a differing digest from the per-variable digests and dtypes and shows both ranges and sizes. Code is compared by module digest and library version, component modules reported before framework modules; the git commit is context only. Nothing is raised.- Parameters:
- expected, actualmapping
The record of the earlier run and of this one.
- ownerstr
The name that opens every warning.
- partialbool
The failure-path comparison of the data: a key or request expected but not read yet is skipped, since “not read yet” is not “not read”, and every warning says the comparison is partial instead of “continuing”.
Examples
usedis the trained unit a run used andretrainedthe unit a rebuild trained, bothTrainedRun; unchanged data and code log nothing:compare( {"data_fingerprint": used.data_fingerprint, "code": used.code}, {"data_fingerprint": retrained.data_fingerprint, "code": retrained.code}, owner="FirstFeatureHead training", )