Configure#

Export and restore the sample UB matrix and other diffractometer configuration.

Source Code Documentation#

Export and restore diffractometer configurations.

Configuration(diffractometer)

Manage diffractometer configurations.

From hklpy, these TODO items:

  • bluesky runs support

  • stack support

  • set constraints

class hklpy2.operations.configure.Configuration(diffractometer)[source]#

Bases: object

Manage diffractometer configurations.

_asdict()

Return diffractometer's configuration as a dict.

_fromdict(config[, clear, restore_constraints])

Restore diffractometer's configuration from a dict.

_valid(config)

Validate incoming configuration for current diffractometer.

export(file[, comment])

Export the diffractometer configuration to a YAML file.

restore(file[, clear, restore_constraints])

Restore the diffractometer configuration to a YAML file.

_asdict() dict[source]#

Return diffractometer’s configuration as a dict.

_fromdict(config: dict, clear: bool = True, restore_constraints: bool = True)[source]#

Restore diffractometer’s configuration from a dict.

_valid(config)[source]#

Validate incoming configuration for current diffractometer.

export(file, comment='')[source]#

Export the diffractometer configuration to a YAML file.

Example:

import hklpy2

e4cv = hklpy2.SimulatedE4CV(name="e4cv")
e4cv.operator.configuration.export("e4cv-config.yml", comment="example")
restore(file, clear=True, restore_constraints=True)[source]#

Restore the diffractometer configuration to a YAML file.

Example:

import hklpy2

e4cv = hklpy2.SimulatedE4CV(name="e4cv")
e4cv.operator.configuration.restore("e4cv-config.yml")

PARAMETERS

file str or pathlib.Path object:

Name (or pathlib object) of diffractometer configuration YAML file.

clear bool:

If True (default), remove any previous configuration of the diffractometer and reset it to default values before restoring the configuration.

If False, sample reflections will be append with all reflections included in the configuration data for that sample. Existing reflections will not be changed. The user may need to edit the list of reflections after restore(clear=False).

restore_constraints bool:

If True (default), restore any constraints provided.

Note: Can’t name this method “import”, it’s a reserved Python word.