nomad_camels.loop_steps package

Submodules

nomad_camels.loop_steps.api_call module

class nomad_camels.loop_steps.api_call.API_Call(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

A loop step that makes an API call. You can perform a CAMELS API call with more sophisticated control and better handling. Or you can perform an arbitrary API call. You always need to specify the host (ip address) and the port of the web server supplying the API.

get_protocol_string(n_tabs=1)

This function executes the API call and returns the results.

class nomad_camels.loop_steps.api_call.API_Call_Config(loop_step: API_Call, parent=None)

Bases: Loop_Step_Config

A class to configure the API Call loop step.

api_type_changed()
authentication_type_changed()
extract_all_api_functionality_from_json()
load_camels_function_on_bootup(index)
rows_removed_parameters_table()

Update the parameters table.

staticMetaObject = PySide6.QtCore.QMetaObject("API_Call_Config" inherits "Loop_Step_Config": )
update_api_url()

Update the API URL.

update_authentication_string()

Update the authentication string.

update_camels_function_parameters(index=None)
update_generic_api_method()
update_host()

Update the host address.

update_message_body()

Update the post body. Keeps the formatting.

update_parameter_value(parameter_name, value)
update_parameters_table()

Update the parameters table.

update_port()

Update the port.

class nomad_camels.loop_steps.api_call.Combobox_CAMELS_functions

Bases: QComboBox

popupAboutToBeShown
showPopup(self) None
staticMetaObject = PySide6.QtCore.QMetaObject("Combobox_CAMELS_functions" inherits "QComboBox": Methods:   #46 type=Signal, signature=popupAboutToBeShown() )

nomad_camels.loop_steps.call_function module

class nomad_camels.loop_steps.call_function.Call_Function(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

get_protocol_short_string(n_tabs=0)

Gives a short overview of the step to quickly understand what the protocol does.

Parameters:

n_tabs (int) – (Default value = 0) Number of tabs for indentation inside the overview

Returns:

short_string – The string representing the step

Return type:

str

get_protocol_string(n_tabs=1)

Returns the string that is written into the protocol-file. To make use of the time_weight and status bar, it should start with printing, that the loop_step starts.

Parameters:

n_tabs (int) – (Default value = 1) Number of tabs for indentation inside the script

Returns:

protocol_string – The string representing the step

Return type:

str

update_used_devices()

Should update used_devices to include all necessary devices.

class nomad_camels.loop_steps.call_function.Call_Function_Config(loop_step: Call_Function, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Call_Function_Config" inherits "Loop_Step_Config": )
update_step_config()

Overwrite this for specific step-configuration. It should provide the loop_step object with all necessary data.

nomad_camels.loop_steps.change_device_config module

class nomad_camels.loop_steps.change_device_config.Change_DeviceConf(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

With this step, one can change the config-attributes of a device.

device

The name of the device that has the config changed.

Type:

str

config_dict

The dictionary with the new config-attributes of the device.

Type:

dict

get_protocol_short_string(n_tabs=0)

Includes the configured device in the short string.

get_protocol_string(n_tabs=1)

Creates an instance of self.device and uses self.config_dict to get a complete config_dict from the instance. The string consists of calling dev.configure(config), where config is the config_dict.

update_used_devices()

Includes self.device to the used devices.

class nomad_camels.loop_steps.change_device_config.Change_DeviceConf_Config(loop_step: Change_DeviceConf, parent=None)

Bases: Loop_Step_Config

device_changed()
staticMetaObject = PySide6.QtCore.QMetaObject("Change_DeviceConf_Config" inherits "Loop_Step_Config": )
update_step_config()

nomad_camels.loop_steps.execute_python_file module

class nomad_camels.loop_steps.execute_python_file.AddRemoveTable_Returned_Variables(addLabel='+', removeLabel='-', horizontal=True, editables=None, checkables=(), headerLabels=None, orderBy=None, parent=None, tableData=None, title='', comboBoxes=None, subtables=None, growsize=False, checkstrings=None, askdelete=False, fixedsize=False, enableds=None, default_values=None)

Bases: AddRemoveTable

Subclasses AddRemoveTable and changes the remove method to also remove the variable from the loop step variable dict.

remove()
staticMetaObject = PySide6.QtCore.QMetaObject("AddRemoveTable_Returned_Variables" inherits "AddRemoveTable": )
class nomad_camels.loop_steps.execute_python_file.Execute_Python_File(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

A loop step to execute a python file. The python.exe path as well as the python file path must be given.

get_protocol_short_string(n_tabs=0)

Gives a short overview of the step to quickly understand what the protocol does.

Parameters:

n_tabs (int) – (Default value = 0) Number of tabs for indentation inside the overview

Returns:

short_string – The string representing the step

Return type:

str

get_protocol_string(n_tabs=1)

This function runs the python file with the python exe using the subprocess module. The the cwd of the subprocess is changed to the python files location.

update_variables()
class nomad_camels.loop_steps.execute_python_file.Execute_Python_File_Config(loop_step: Execute_Python_File, parent=None)

Bases: Loop_Step_Config

The configuration settings for the Execute_Python_File loop step.

handle_radio_button_clicked(button)
on_rows_removed_packages(parent, first, last)
on_rows_removed_passing(parent, first, last)
on_rows_removed_returned(parent, first, last)
staticMetaObject = PySide6.QtCore.QMetaObject("Execute_Python_File_Config" inherits "Loop_Step_Config": )
toggle_add_remove_table(checked)
toggle_python_exe_path(checked)
update_exe_path(path)
update_file_path(path)
update_python_packages()
update_returned_value_variables()
update_variables_passing()

nomad_camels.loop_steps.export_data module

class nomad_camels.loop_steps.export_data.Export_Data_Step(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

A loopstep to export the measurement data at fixed points. Convenient to already start evaluation during long measurements.

get_protocol_string(n_tabs=1)

The protocol just calls bps.wait(`wait_time)`, where wait_time is evaluated by the protocol’s evaluator.

class nomad_camels.loop_steps.export_data.Export_Data_Step_Config(loop_step: Export_Data_Step, parent=None)

Bases: Loop_Step_Config

Displaying only what the step does.

staticMetaObject = PySide6.QtCore.QMetaObject("Export_Data_Step_Config" inherits "Loop_Step_Config": )

nomad_camels.loop_steps.for_while_loops module

class nomad_camels.loop_steps.for_while_loops.For_Loop_Step(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step_Container

Loop_Step representing a For Loop. It offers several ways of defining the sweep.

loop_type

can be one of the following: - “start - stop” the loop goes from min_val to max_val - “start - min - max - stop” or “start - max - min - stop” goes from start over min/max, max/min to stop - “Value-List” the loop uses the values inside val_list - “Text-File” the loop uses the values of a single-column text file given by file_path

Type:

str

sweep_mode

only relevant if not using “Value-List” or “Text-File” mode can be: - “linear” the loop goes over a simple linear space - “logarithmic” the steps increase logarithmically - “exponential” the steps increase exponentially - “1/x” the steps increase with 1/x

Type:

str

start_val

the first value for the loop

Type:

float

stop_val

the last value for the loop

Type:

float

min_val

the minimum value for the loop

Type:

float

max_val

the maximum value for the loop

Type:

float

n_points

the number of points the loop iterates over. If using the max and min-vals, the distance between those is used, thus in total creating more steps

Type:

int

n_iterations

number of runs the loop will do

Type:

int

val_list

a list of all the steps, the loop iterates over, used if “Value-List” is chosen

Type:

list of float

file_path

the path where the file for “Text-File” is lying

Type:

str or path

include_end_points

whether to include the stop_val into the iteration

Type:

bool

get_protocol_short_string(n_tabs=0)

Shows the type of loop and the range in the short string as well

get_protocol_string(n_tabs=1)

The loop is enumerating over the selected points. When using a range, the get_range helper function is used.

update_time_weight()

Multiplies the children time_weight (-1 for the step itself) by the number of iterations and adds 1 (for the step itself).

update_variables()

Includes the value and iteration-count of the loop.

class nomad_camels.loop_steps.for_while_loops.For_Loop_Step_Config(loop_step: For_Loop_Step, parent=None)

Bases: Loop_Step_Config

Configuration-Widget for the for-loop step.

staticMetaObject = PySide6.QtCore.QMetaObject("For_Loop_Step_Config" inherits "Loop_Step_Config": )
class nomad_camels.loop_steps.for_while_loops.For_Loop_Step_Config_Sub(loop_step: For_Loop_Step, parent=None)

Bases: Ui_for_loop_config, QWidget

Provides the main config for the For Loop.

add_point()

Used to add a point when using the “Value-List” loop-type.

build_preview_array()

Builds the displayed array to preview the steps, the for loop will make.

change_dist_n_mode()
change_n_points()

Updates the displayed distance between the points when their number is changed.

change_point_dist()

Updates the number of points when the distance between them is changed.

change_sweep_mode()

Enables / disables the point-distance widget corresponding to the selected sweep mode.

del_point()

Used to remove a point when using the “Value-List” loop-type.

load_data()

Loads the data from the loop_step into the UI-widgets.

loop_type_change()

Enables / disables the respective elements that are used for the single loop-types, then builds the preview.

staticMetaObject = PySide6.QtCore.QMetaObject("For_Loop_Step_Config_Sub" inherits "QWidget": )
value_list_changed(row)

Updates the val_list of the loopstep when it is changed.

Parameters:

row

class nomad_camels.loop_steps.for_while_loops.While_Loop_Step(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step_Container

A loopstep that adds a simple While Loop with a condition, that may be just written as python-code.

condition

The condition which is used for the loop. It should be interpretable python-code within the namespace of the protocol.

Type:

str

expected_iterations

The expected number of iterations, used for the steps time weight for the progress bar. Ideally rather too large than to small (otherwise the progress bar reaches 100% too early).

Type:

int, default 1

get_protocol_short_string(n_tabs=0)

Adds the condition to the string

get_protocol_string(n_tabs=1)

The string consists of declaring the count-variable. Then the while loop with the desired condition is started. After all the children-steps, the count-variable increased by 1.

update_time_weight()

Multiplies the time_weight of the children with the expected iterations + 5

update_variables()

Here the Count of the while-loop is included as a variable.

class nomad_camels.loop_steps.for_while_loops.While_Loop_Step_Config(loop_step: While_Loop_Step, parent=None)

Bases: Loop_Step_Config

Configuration-Widget for the while-loop step.

staticMetaObject = PySide6.QtCore.QMetaObject("While_Loop_Step_Config" inherits "Loop_Step_Config": )
class nomad_camels.loop_steps.for_while_loops.While_Loop_Step_Config_Sub(loop_step: While_Loop_Step, parent=None)

Bases: QWidget

Sub-config for the while-loop. It consists only of a single line that takes the condition for the while loop.

staticMetaObject = PySide6.QtCore.QMetaObject("While_Loop_Step_Config_Sub" inherits "QWidget": )
update_condition()

Saves the condition into the loop_step.

nomad_camels.loop_steps.gradient_descent module

class nomad_camels.loop_steps.gradient_descent.Gradient_Descent_Config(loop_step: Gradient_Descent_Step, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Gradient_Descent_Config" inherits "Loop_Step_Config": )
update_step_config()
class nomad_camels.loop_steps.gradient_descent.Gradient_Descent_Config_Sub(loop_step: Gradient_Descent_Step, parent=None)

Bases: Ui_Grad_Desc, QWidget

staticMetaObject = PySide6.QtCore.QMetaObject("Gradient_Descent_Config_Sub" inherits "QWidget": )
update_step_config()
class nomad_camels.loop_steps.gradient_descent.Gradient_Descent_Step(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

A step performing a gradient descent with a given channel to optimize a given function.

read_channels

A list of all the channels which are read for the optimization.

Type:

list[str]

extremum

The extremum type that should be found.

Type:

str (‘Minimum’, ‘Maximum’)

out_channel

The channel which is used for the optimization.

Type:

str

opt_func

This string is evaluated by the given to give the target function.

Type:

str

start_val

Representation of where to start the algorithm.

Type:

str, float

min_val

The minimum value that should be given to the set_channel.

Type:

str, float

max_val

The maximum value that should be given to the set_channel.

Type:

str, float

learning_rate

A weight for the learning of the gradient descent. The next shift delta_w is calculated as: delta_w = -learning_rate * <current_gradient> + momentum * <last_delta_w>

Type:

str, float

threshold

If the difference between two measurements is smaller than this threshold, the algorithm recognizes the value as the optimum and stops.

Type:

str, float

momentum

(Default value = 0.8) A momentum to keep up the last direction. The next shift delta_w is calculated as: delta_w = -learning_rate * <current_gradient> + momentum * <last_delta_w>

Type:

str, float

min_step

The minimum step size.

Type:

str, float

max_step

The maximum step size.

Type:

str, float

n_steps

The maximum number of iterations until the algorithm should stop if it did not arrive at the threshold yet.

Type:

str, int

plot_steps

Whether to plot the single steps of the algorithm at runtime.

Type:

bool

get_add_main_string()

Adds the call of creating the plots if self.plot_steps.

get_outer_string()

Adds the plot, if self.plot_steps is True. The plot displays the formula to be optimized vs the out_channel.

get_protocol_short_string(n_tabs=0)

Describes the kind of extremum, the opt_func and the out_channel.

get_protocol_string(n_tabs=1)

Evaluates all / most of the values with the protocol’s evaluator and calls the helper function gradient_descent to perform the algorithm.

update_used_devices()

Uses all devices in self.read_channels and of self.out_channel

nomad_camels.loop_steps.if_step module

class nomad_camels.loop_steps.if_step.Elif_Sub_Step(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: If_Sub_Step

Simple sub-step that represents an elif-condition.

class nomad_camels.loop_steps.if_step.Else_Sub_Step(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: If_Sub_Step

Simple sub-step that represents the else-condition.

class nomad_camels.loop_steps.if_step.If_Loop_Step(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step_Container

A loopstep providing an if-case selection with a variable number of elif.

condition

The condition which is used for the if-conditional (should be valid python code)

Type:

str

use_else

whether to add an else-case

Type:

bool

elifs

string-list of the conditions for a variable number of elif cases

Type:

list of str

append_to_model(item_model: QStandardItemModel, parent=None)

Overwritten, so that nothing can be dropped into the main step.

get_protocol_short_string(n_tabs=0)

Shows all the conditions and the steps’ children

get_protocol_string(n_tabs=1)

Putting together the children of all if-substeps and the conditions

update_children()

Updates the if-substeps provided by this step, giving them the names corresponding to the conditions.

class nomad_camels.loop_steps.if_step.If_Step_Config(loop_step: If_Loop_Step, parent=None)

Bases: Loop_Step_Config

Configuration-Widget for the if-loop step.

staticMetaObject = PySide6.QtCore.QMetaObject("If_Step_Config" inherits "Loop_Step_Config": )
update_step_config()

Overwritten, so that the loopstep updates its substeps for correctly building the protocol sequence.

class nomad_camels.loop_steps.if_step.If_Step_Config_Sub(loop_step: If_Loop_Step, parent=None)

Bases: QWidget

This widget consists of a line for the if-condition an AddRemoveTable for the elif-conditions and a checkbox for whether to use an else-case.

else_change()

When removing the else-case, first ask the user if they are sure, since substeps will be deleted as well.

staticMetaObject = PySide6.QtCore.QMetaObject("If_Step_Config_Sub" inherits "QWidget": Methods:   #33 type=Signal, signature=update_config() )
update_condition(called=False)

Updating the loopstep. The signal is not emitted if the function is called from outside, so there is no infinite loop.

Parameters:

called – (Default value = False)

update_config
update_end_protocol_checkbox()

Update the end protocol checkbox

class nomad_camels.loop_steps.if_step.If_Sub_Step(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step_Container

Simple sub-step that represents the if-condition.

append_to_model(item_model: QStandardItemModel, parent=None)

Overwritten, so that nothing can be dropped into the main step. The Sub-Step cannot be dragged out from the main step.

class nomad_camels.loop_steps.if_step.Sub_Step_Config(loop_step: Loop_Step_Container, parent=None)

Bases: Loop_Step_Config

Configuration for the substeps, disabling the name-widget.

staticMetaObject = PySide6.QtCore.QMetaObject("Sub_Step_Config" inherits "Loop_Step_Config": )

nomad_camels.loop_steps.make_step_of_type module

This module provides a way to produce all possible protocol steps from the UI

nomad_camels.loop_steps.make_step_of_type.get_config(step: Loop_Step)

Returns the Loop_Step_Config belonging to the given step.

Parameters:

step (Loop_Step) – The step for which the config-widget should be opened.

Returns:

The Loop_Step_Config corresponding to the given step.

Return type:

step_config

nomad_camels.loop_steps.make_step_of_type.get_device_steps()

Goes through all the devices and checks, whether they provide their own types of loop-steps.

Returns:

dictionary of the possible steps provided by the devices

Return type:

device_steps

nomad_camels.loop_steps.make_step_of_type.make_step(step_type, step_info=None, children=None, protocol=None)

Checks whether the given step_type is supported, if yes, then a step of that type with the given info and children will be created. If there is no step_info, a new step is made.

Parameters:
  • step_type (str) – A string representing the type of the step. Should correspond to one of the keys of step_type_config or a device specific step.

  • step_info (dict, None) – (Default value = None) The information for the step’s configuration

  • children (list[Loop_Step], None) – (Default value = None) The produced step’s children. Handed over to it’s constructor.

  • protocol (Measurement_Protocol) – (Default value = None) The protocol, in which the step should be.

Returns:

The produced step.

Return type:

step

nomad_camels.loop_steps.nd_sweep module

class nomad_camels.loop_steps.nd_sweep.ND_Sweep(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

An n-dimensional sweep with the read values. Useful for e.g. an xy-scan.

sweep_channels

From outer to inner sweep, the names of the channels that should be sweeped through.

Type:

list[str]

data_output

Whether the data is put into its own stream(‘sub-stream’) or the primary stream (‘main-stream’).

Type:

str

plots

List of the plots that should be created for the sweep.

Type:

list[Plot_Info]

read_channels

List of the channels that should be read during the sweep.

Type:

list[str]

sweep_values

List of sub-steps containing the information about the sweeps.

Type:

list[Sweep_Step]

get_add_main_string()

Calling the plot_creator from steps_add_main

get_outer_string()

Gives the string to create the plots of the sweeps

get_protocol_short_string(n_tabs=0)

The read channels and the sweeps are specified.

get_protocol_string(n_tabs=1)

The channels to be read are set up. Then a for loop for each sweep is started, with the channels each being set inside it.

update_used_devices()

Includes the devices from the read_channels and the sweep_channels

update_variables()

Adds the fit variables from the plots.

class nomad_camels.loop_steps.nd_sweep.ND_Sweep_Config(loop_step: ND_Sweep, parent=None)

Bases: Loop_Step_Config

add_sweep_channel(sweep_info=None)
Parameters:

sweep_info – (Default value = None)

change_tab_name()
move_tab(direction=1)
Parameters:

direction – (Default value = 1)

remove_sweep_channel()
staticMetaObject = PySide6.QtCore.QMetaObject("ND_Sweep_Config" inherits "Loop_Step_Config": )
update_step_config()
class nomad_camels.loop_steps.nd_sweep.Single_Sweep_Tab(loop_step: Sweep_Step, parent=None)

Bases: QWidget

get_info()
get_name(pos)
Parameters:

pos

signal_change_sweep
signal_move_left
signal_move_right
signal_remove
staticMetaObject = PySide6.QtCore.QMetaObject("Single_Sweep_Tab" inherits "QWidget": Methods:   #33 type=Signal, signature=signal_remove()   #34 type=Signal, signature=signal_move_left()   #35 type=Signal, signature=signal_move_right()   #36 type=Signal, signature=signal_change_sweep(QString), parameters=QString )
class nomad_camels.loop_steps.nd_sweep.Sweep_Step(step_info=None)

Bases: For_Loop_Step

One single sweep for the ND sweep. Inherits from For_Loop_Step regarding the steps of the sweep.

sweep_channel

The channel which is used in this sweep-part.

Type:

str

wait_time

The time in seconds, how long to wait after setting the channel.

Type:

str, float

get_protocol_short_string(n_tabs=0)

Specifies the same way as the foor loop.

get_protocol_string(n_tabs=1)

Creates a for loop over the sweep_channel and waits for wait_time after setting the channel.

nomad_camels.loop_steps.prompt_loop_step module

class nomad_camels.loop_steps.prompt_loop_step.Prompt_Loop_Step(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

This step displays a prompt (QMessageBox) at runtime and pauses the execution of the protocol until the user clicks “ok” in the prompt. This may be used for example to prompt the user to do something at the setup.

short_test

This will be the window title of the prompt.

Type:

str

long_test

This will be the full text, displayed inside the window.

Type:

str

icon

If ‘Error’, the QMessagebox.Critical icon is displayed, if ‘Warning’, then QMessagebox.Warning is used, otherwise QMessagebox.Information.

Type:

str

get_add_main_string()

Adds the setup of the box to the steps_add_main function of the protocol.

get_protocol_string(n_tabs=1)

Sets the prompt’s done_flag to False, then starts execution of the prompt and waits until it is done_flag.

class nomad_camels.loop_steps.prompt_loop_step.Prompt_Loop_Step_Config(loop_step: Prompt_Loop_Step, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Prompt_Loop_Step_Config" inherits "Loop_Step_Config": )
class nomad_camels.loop_steps.prompt_loop_step.Prompt_Loop_Step_Config_Sub(loop_step: Prompt_Loop_Step, parent=None)

Bases: QWidget

The QLineEdit and labels to make everything clear are provided.

staticMetaObject = PySide6.QtCore.QMetaObject("Prompt_Loop_Step_Config_Sub" inherits "QWidget": )
update_info()

nomad_camels.loop_steps.read_channels module

class nomad_camels.loop_steps.read_channels.Read_Channels(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

This step represents the bluesky plan stub trigger_and_read. It may also be split into an additional step for triggering, then doing something else and then reading.

read_all

If True, the step will read all available channels.

Type:

bool

split_trigger

If True, an additional trigger channels step may be used. This read step will then not use trigger_and_read, but only read the channels.

Type:

bool

channel_list

The list of channels that should be read in this step.

Type:

list[str]

get_channels_set()

Provides a set of self.channel_list to remove possible duplicates. Includes all available channels if self.read_all.

get_channels_string(tabs)

Gives a string of the channels that should be read. This may also be used by the Trigger_Channels step.

Parameters:

tabs (str) – A string including the tabs for intendation.

get_protocol_short_string(n_tabs=0)

Includes the channel list in the string.

get_protocol_string(n_tabs=1)

In the protocol, at first a list channels is defined, including all the channels, that are selected to be read. Then bps.trigger_and_read (or helper_functions.read_wo_trigger) is called on these channels. The stream in which the data is written will be numbered if there are other read_channels that are reading different channels, since bluesky only allows reading the same channels inside one stream.

update_used_devices()

All devices that should be read are added to the used_devices.

variable_name()

Returns the name of this step as a valid variable name, to specify the channels for this read.

class nomad_camels.loop_steps.read_channels.Read_Channels_Config(loop_step: Read_Channels, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Read_Channels_Config" inherits "Loop_Step_Config": )
update_step_config()
class nomad_camels.loop_steps.read_channels.Read_Channels_Config_Sub(loop_step: Read_Channels, parent=None)

Bases: Ui_read_channels_config, QWidget

Config for the Read_Channels it provides a table of channels with a checkbox, whether to read them. Also there is a checkbox whether to simply read all available channels.

build_channels_table()

This creates the table for all channels.

load_data()

Putting the data from the loop_step into the widgets.

read_type_changed()

If the read-all checkbox is checked, disables the table, if not, enables it.

staticMetaObject = PySide6.QtCore.QMetaObject("Read_Channels_Config_Sub" inherits "QWidget": )
table_check_changed(pos)

If a checkbox inside the table is clicked, the value is stored into the loopstep.

Parameters:

pos

update_step_config()
use_trigger()
class nomad_camels.loop_steps.read_channels.Trigger_Channels_Config(loop_step: Trigger_Channels_Step, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Trigger_Channels_Config" inherits "Loop_Step_Config": )
update_step_config()
class nomad_camels.loop_steps.read_channels.Trigger_Channels_Step(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

This step provides a split between triggering and reading channels.

read_step

The name of the Read Channels step, for which this step should do the triggering.

Type:

str

get_protocol_short_string(n_tabs=0)

The corresponding read step is displayed.

get_protocol_string(n_tabs=1)

In the protocol, at first a list channels is defined, including all the channels, that are selected to be read. Then these channels are triggered with helper_functions.trigger_multi.

nomad_camels.loop_steps.read_channels.get_channel_string(channel)

Gives the string of a channel in the way it is written inside the protocol, i.e. “devs[“<device_name>”].<component/channel_name>”.

Parameters:

channel (str) – The channel that should be converted.

nomad_camels.loop_steps.run_subprotocol module

class nomad_camels.loop_steps.run_subprotocol.Run_Subprotocol(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

With this step, one may select another protocol to run inside the main one.

prot_path

Path to the file of the subprotocol.

Type:

str, path

vars_in

Variables of the subprotocol’s namespace and the values they should get before the subprotocol is run. This can be used to e.g. give the subprotocol a new value for each run inside a loop.

Type:

dict

vars_out

Variables of the subprotocol and the name in the main protocol’s namespace where they should be put. This can be used to e.g. store some value determined by the subprotocol for later use in the main protocol.

Type:

dict

data_output

Whether the data is put into its own stream(‘sub-stream’) or the primary stream (‘main-stream’).

Type:

str

own_plots

If True, the plots specified by the protocol will also be shown.

Type:

bool

get_add_main_string()

If using its own plots, adds them to the steps. In any case, the added steps from the subprotocol are added here as well.

get_outer_string()

Imports the subprotocol as <protocol_name>_mod.

get_protocol_short_string(n_tabs=0)

Specifies the name / path of the subprotocol.

get_protocol_string(n_tabs=1)

Overwrites the signal for the progressbar and the number of steps in the subprotocol’s module. Evaluates the input variables, then writes them into the subprotocol’s namespace and starts the subprotocol’s _plan_inner function. Afterwards the output variables are written to the main namespace.

update_time_weight()

The time weight in the end is the weight of the subprotocol + 1.

update_used_devices()

Uses the devices that are used in the subprotocol.

class nomad_camels.loop_steps.run_subprotocol.Run_Subprotocol_Config(loop_step: Run_Subprotocol, parent=None)

Bases: Loop_Step_Config

load_sub_vars()
staticMetaObject = PySide6.QtCore.QMetaObject("Run_Subprotocol_Config" inherits "Loop_Step_Config": )
update_step_config()
update_sub_vars()

nomad_camels.loop_steps.set_channels module

class nomad_camels.loop_steps.set_channels.Set_Channels(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

Simple step to set several channels to a given value. Uses bps.abs_set.

channels_values

This dictionary provides a list of the names of the channels that are to be set and a list of the values they should get. The values are strings, since they will be evaluated at runtime, thus providing the ability to set some variable at runtime.

Type:

dict{‘Channels’: list[str], ‘Values’: list[str]}

wait_for_set

Whether to wait after setting for the set channels to have the finished status.

Type:

bool, default True

get_protocol_short_string(n_tabs=0)

Displays the channels and their values.

get_protocol_string(n_tabs=1)

If wait_for_set is True, then after setting, bps.wait for the set group is called. In any case, all the channels are set to their specified value

update_used_devices()

All devices with a channel that is to be set are added.

class nomad_camels.loop_steps.set_channels.Set_Channels_Config(loop_step: Set_Channels, parent=None)

Bases: Loop_Step_Config

The configuration consists of the checkbox for waiting and a simple AddRemoveTable that works with the channels.

check_change()
staticMetaObject = PySide6.QtCore.QMetaObject("Set_Channels_Config" inherits "Loop_Step_Config": )
update_step_config()

nomad_camels.loop_steps.set_value_popup module

class nomad_camels.loop_steps.set_value_popup.Set_Value_Popup(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

This step provides the possibility for the user to set a channel or variable to a specific value at runtime with a popup. The protocol execution is paused until the user is finished.

variables

A list of the variables that should be set by the user.

Type:

list[str]

channels

A list of the channels that should be set by the user.

Type:

list[str]

free_variables

If True, the user has the possibility to set any variable freely.

Type:

bool

free_channels

If True, the user has the possibility to set any channel freely.

Type:

bool

get_add_main_string()

Adds the setup of the box.

get_protocol_string(n_tabs=1)

The value popup box is executed. The protocol waits until its completion. Then all the variables and then the channels are set to the given values.

class nomad_camels.loop_steps.set_value_popup.Set_Value_Popup_Config(loop_step: Set_Value_Popup, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Set_Value_Popup_Config" inherits "Loop_Step_Config": )
update_step_config()

nomad_camels.loop_steps.set_variables module

class nomad_camels.loop_steps.set_variables.Set_Variables(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

This step enables setting variables to a different value during the protocol.

variables_values

Contains a list of the variables and a list of the respective values to which they should be set.

Type:

dict{‘Variable’: list[str], ‘Value’: list[str]}

get_protocol_short_string(n_tabs=0)

Shows the variables and values.

get_protocol_string(n_tabs=1)

Evaluates the values for the variables, then updates the namespace.

class nomad_camels.loop_steps.set_variables.Set_Variables_Config(loop_step: Set_Variables, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Set_Variables_Config" inherits "Loop_Step_Config": )
update_step_config()

nomad_camels.loop_steps.simple_sweep module

class nomad_camels.loop_steps.simple_sweep.Simple_Sweep(name='', children=None, parent_step=None, step_info=None, **kwargs)

Bases: For_Loop_Step

A sweep over a single channel reading arbitrary other channels. The information about which values to sweep through are inherited from For_Loop_Step.

sweep_channel

The name of the channel that should be sweeped.

Type:

str

data_output

Whether the data is put into its own stream(‘sub-stream’) or the primary stream (‘main-stream’).

Type:

str

plots

List of the plots that should be created for the sweep.

Type:

list[Plot_Info]

read_channels

List of the channels that should be read during the sweep.

Type:

list[str]

get_add_main_string()

Calling the plot_creator from steps_add_main

get_outer_string()

Gives the string to create the plots of the sweeps

get_protocol_short_string(n_tabs=0)

The read and sweep channels and the sweep values are specified.

get_protocol_string(n_tabs=1)

The channels to be read are set up. Then a for loop for the sweep is started, setting the channel, then reading.

update_used_devices()

Includes the devices from the read_channels and the sweep_channel.

update_variables()

Adds the fit variables from the plots.

class nomad_camels.loop_steps.simple_sweep.Simple_Sweep_Config(loop_step: Simple_Sweep, parent=None)

Bases: Loop_Step_Config

staticMetaObject = PySide6.QtCore.QMetaObject("Simple_Sweep_Config" inherits "Loop_Step_Config": )
update_step_config()

nomad_camels.loop_steps.wait_loop_step module

class nomad_camels.loop_steps.wait_loop_step.Wait_Loop_Step(name='', parent_step=None, step_info=None, **kwargs)

Bases: Loop_Step

A loopstep to simply wait some defined time.

wait_time

The how long the protocol execution should pause in seconds.

Type:

str, float

get_add_main_string()

Adds for example a call to the protocol function to the steps_add_main function of the script.

get_channels_string(tabs)

Gives a string of the channels that should be read. This may also be used by the Trigger_Channels step.

Parameters:

tabs (str) – A string including the tabs for intendation.

get_outer_string()

Returns the string for the protocol, where for example special plots for the step are created.

get_protocol_short_string(n_tabs=0)

Tells the wait time.

get_protocol_string(n_tabs=1)

The protocol just calls bps.wait(`wait_time)`, where wait_time is evaluated by the protocol’s evaluator.

update_used_devices()

All devices that should be read are added to the used_devices.

variable_name()

Returns the name of this step as a valid variable name, to specify the channels for this read.

class nomad_camels.loop_steps.wait_loop_step.Wait_Loop_Step_Config(loop_step: Wait_Loop_Step, parent=None)

Bases: Loop_Step_Config

The configuration just provides a line to enter the time to wait.

staticMetaObject = PySide6.QtCore.QMetaObject("Wait_Loop_Step_Config" inherits "Loop_Step_Config": )
update_step_config()
class nomad_camels.loop_steps.wait_loop_step.Wait_Loop_Step_Config_Sub(loop_step: Wait_Loop_Step, parent=None)

Bases: QWidget

The QLineEdit and labels to make everything clear are provided.

staticMetaObject = PySide6.QtCore.QMetaObject("Wait_Loop_Step_Config_Sub" inherits "QWidget": )
type_changed()
update_duration()

Module contents