Reconfigure()
Reconfigure can be used to adapt a device’s configuration to new experimental circumstances.
For example, a temperature module in the sequence sweeps a temperature, and a Logger needs to adjust its measurement mode depending on the temperature.
reconfigure() is called whenever signin() is called, which happens when an element higher up in the sequencer varies its sweep value.
Sequencer Example
Temperature - Eurotherm (Sweeps 10-50°C)
└── Logger - Multimeter
    └── SMU - Keithley 4200-SCS (Sweeps 1.0 - 2.0 V)
The temperature module is higher than the logger.
Whenever the temperature sweep value changes, the signin() and reconfigure() functions of the Logger and SMU drivers are called.
When the SMU sweeps, however, the signin() and reconfigure() of the higher-up modules (Temperature and Logger) are not called.
Therefore, it is important to structure your sequencer in a way that signin() and reconfigure() are called only when appropriate.
Variable GUI Parameters
The Parameter system can be used to set dynamic configurations.
Example: Your logger can have a reference temperature, where you can set the set temperature of the temperature module by using
{Temperature1_SweepValue}
This allows a module to adapt automatically to another module’s sweep value in real-time.
Programming
The standard implementation in pysweepme.EmptyDeviceClass is as follows:
def reconfigure(self, parameters={}, keys=[]):
    """Function to be overridden if needed.
    if a GUI parameter changes after replacement with global parameters, the device needs to be reconfigure.
    Default behavior is that all parameters are set again and 'configure' is called.
    The device class maintainer can redefine/overwrite 'reconfigure' with a more individual procedure.
    """
    if self.uses_update_gui_parameters:
        if parameters:
            self.apply_gui_parameters(parameters)
        self.update_gui_parameters(parameters)
    else:
        self.get_GUIparameter(parameters)
    self.configure()
By default, the GUI parameters of the module are read out again and given as parameters.
The keys argument is a list of parameter names that have changed.
This allows the driver to update only those parameters instead of reconfiguring everything.
Example Customization
Developers can overwrite reconfigure() in their own device class for more fine-grained control.
For example, a driver could update only those settings that have changed:
def reconfigure(self, parameters={}, keys=[]):
    if "Range" in keys:
        self.set_range(parameters["Range"])
    if "SamplingRate" in keys:
        self.set_sampling_rate(parameters["SamplingRate"])
This approach improves performance when working with complex devices or time-critical systems, as only the relevant parts of the configuration are updated.