autoemx.runners.publish_standards module

Runner: Publish Experimental Standards to the Package

AutoEMX reads and updates the experimental standards of an instrument in its local calibration folder, ~/.autoemx/calibrations/<microscope_ID>/. The standards file in the package (autoemx/calibrations/<microscope_ID>/) only holds the initial values copied to new local folders, and AutoEMX never changes it.

This runner copies the local standards file of a beam energy into the package, and regenerates its details report next to it, so the new values can be committed and distributed as the initial values of the microscope. It only runs in a git checkout of AutoEMX, where the package files can be committed.

Created on Mon Oct 12 2026 @author: Andrea

autoemx.runners.publish_standards.publish_standards(microscope_ID: str, beam_energy: float, meas_type: str = 'EDS') → Path | None[source]

Copy the local standards file of a beam energy into the package, and regenerate its details report there.

Parameters:
  • microscope_ID (str) – Microscope whose standards are published (folder of autoemx/calibrations).

  • beam_energy (float) – Beam energy (keV) of the standards file, e.g. 15 for EDS_Stds_15keV.json.

  • meas_type (str, optional) – Measurement type of the standards file. Default is “EDS”.

Returns:

Path of the standards file in the package, or None if it was already identical to the local one.

Return type:

Path or None

Raises:
  • RuntimeError – If AutoEMX is not a git checkout (an installed package), where published files could not be committed.

  • FileNotFoundError – If the microscope has no folder in the package, or no local standards file for this beam energy.