mxcubecore.queuelib.builder#
QueueBuilder: constructs queue model nodes (and, indirectly, their matching QueueEntry objects - see QueueModel.queue_model_child_added) from client task data.
Classes
Creates queue models the creation of queue entries are handled in queue_model_child_added event handler |
- class mxcubecore.queuelib.builder.QueueBuilder[source]#
Bases:
objectCreates queue models the creation of queue entries are handled in queue_model_child_added event handler
- add_characterisation(node_id: int, task: dict) int[source]#
Add a data characterisation task to the sample with id: <id>.
- add_data_collection(node_id: int, task: dict) int[source]#
Add a data collection task to the sample with id: <id>.
- add_energy_scan(node_id: int, task: dict) int[source]#
Add a energy scan task to the sample with id: <id>.
- add_interleaved(node_id: int, task: dict) int[source]#
Add a interleaved data collection task to the sample with id: <id>.
- add_queue_entry(node_id: int, task: dict, task_name: str)[source]#
Add a queue entry to the sample with id <node_id>.
- add_sample(sample_id: str, item)[source]#
Add a sample with sample id <sample_id> the queue.
- Parameters:
sample_id (str) – Sample id (often sample changer location)
- Returns:
SampleQueueEntry
- add_workflow(node_id: int, task: dict) int[source]#
Add a worklfow task to the parent node with id: <id>.
For adding GPhL Auto workflow, call with node_id==parent_node_id and all required parameters in task[“parameters”]
- add_xrf_scan(node_id: int, task: dict) int[source]#
Add a XRF Scan task to the sample with id: <id>.
- get_default_prefix(sample_data, generic_name=False)[source]#
Thin pass-through to HWR.beamline.session.get_default_prefix.
Kept as its own method (rather than called inline) so apply_template can call it as self.get_default_prefix(…).
- get_default_subdir(sample_data)[source]#
Thin pass-through to HWR.beamline.session.get_default_subdir.
- set_char_params(model: Characterisation, entry: BaseQueueEntry, task_data: dict, sample_model)[source]#
Helper method that sets the characterisation parameters.
Helper method that sets the characterisation parameters for a Characterisation.
- Parameters:
model (Characterisation) – The mode to set parameters of
entry (BaseQueueEntry) – The queue entry of the model
task_data (dict) – Dictionary with new parameters
- set_dc_params(model: DataCollection, entry: BaseQueueEntry, task_data: dict, sample_model)[source]#
Helper method that sets the data collection parameters for a DataCollection.
- Parameters:
model (DataCollection) – The model to set parameters of
entry (BaseQueueEntry) – The queue entry of the model
task_data (dict) – Dictionary with new parameters
- set_energy_scan_params(model: EnergyScan, entry: BaseQueueEntry, task_data: dict, sample_model)[source]#
Helper method that sets the xrf scan parameters for a XRF spectrum Scan.
- Parameters:
model (EnergyScan) – The model to set parameters of
entry (BaseQueueEntry) – The queue entry of the model
task_data (dict) – Dictionary with new parameters
- set_gphl_wf_params(model: GphlWorkflow, entry: BaseQueueEntry, task_data: dict, sample_model)[source]#
Helper method that sets the parameters for a GPhL workflow task.
- Parameters:
model (GphlWorkflow) – The model to set parameters of
entry (BaseQueueEntry) – The queue entry of the model
task_data (dict) – Dictionary with new parameters
sample_model – The Sample queueModelObject
- set_wf_params(model: Workflow, entry: BaseQueueEntry, task_data: dict, sample_model)[source]#
Helper method that sets the parameters for a workflow task.
- Parameters:
model (Workflow) – The model to set parameters of
entry (BaseQueueEntry) – The queue entry of the model
task_data (dict) – Dictionary with new parameters
- set_xrf_params(model: XRFSpectrum, entry: BaseQueueEntry, task_data: dict, sample_model)[source]#
Helper method that sets the xrf scan parameters for a XRF spectrum Scan.
- Parameters:
model (XRFSpectrum) – The model to set parameters of
entry (BaseQueueEntry) – The queue entry of the model
task_data (dict) – Dictionary with new parameters
- strip_prefix(pt, prefix)[source]#
Strip the reference, wedge and mad prefix from a given prefix.
For example, remove
ref-from the beginning and_w[n]and-pk,-ip,-ippfrom the end.- Parameters:
pt (PathTemplate) – path template used to create the prefix
prefix (str) – prefix from the client
- Returns:
stripped prefix