Skip to content

[AGIPD] [Correct] Reuse previously found constants

Thomas Kluyver requested to merge agipd-reuse-constants into master

Description

This goes along with !544 (merged) (machinery for re-running calibration jobs). If we are re-running a calibration, it should use the same constants as on the previous run, from the information in calibration_metadata.yml. This makes repeating the work independent of the calibration DB (both the data in the calibration DB, and interfaces for accessing it).

Having looked at the code for retrieving constants, I'd like to also do some cleanup, but I'll keep this PR small.

How Has This Been Tested?

Copied this notebook into the !544 (merged) branch, ran an AGIPD correction from the CLI and then repeated it (using the snippets in that MR). In the 'retrieving constants' step of the report, we see:

Constant for AGIPD00 already in calibration_metadata.yml, won't query again.
Constant for AGIPD01 already in calibration_metadata.yml, won't query again.

The pre step also runs in 18 seconds the first time and 6 seconds the second time, because it needs fewer database queries.

diff-ing the calibration-metadata.yml files shows differences only in when jobs ran, not in the constants used.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.

Reviewers

@ahmedk @hammerd

Edited by Philipp Schmidt

Merge request reports