QCoDeS [UNRELEASED DRAFT] (2026-11-21)

Breaking Changes:

  • The cutoff_lo (high-pass) and cutoff_hi (low-pass) parameters of the virtual SR560 driver now only accept the filter cutoffs that the instrument has: cutoff_lo accepts "DC" and 0.03 Hz to 10 kHz, and cutoff_hi 0.03 Hz to 1 MHz. Previously cutoff_lo also accepted 30 kHz to 1 MHz, and cutoff_hi accepted "DC".

    SR86x.external_reference_trigger_input_resistance now returns "50OHMS" or "1MEG" instead of 0 or 1. Setting it to 0 or 1 still works at runtime, but type checkers now reject it since the parameter is annotated as Parameter[str, Self]; set it to "50" / "50OHMS" or "1M" / "1MEG" instead. (#8696)

  • The current, current_range and current_limit parameters of the YokogawaGS200, and its measure parameter in voltage source mode, now use the unit A instead of I. The ramp_rate and ramp_step parameters now start with the units A/s and A instead of V/s and V if the instrument is in current source mode when connecting, as they already did after changing the source mode.

    YokogawaGS200Monitor.delay (measure.delay) is now in seconds, the unit the instrument uses, instead of ms. The value was already sent to the instrument unconverted, so delay(500) set a delay of 500 s despite the ms unit. The parameter now accepts values from 0 to 999.999 s in steps of 1 ms, e.g. delay(0.5) for 500 ms, and returns the delay as a float in seconds instead of an int rounded to whole seconds. (#8697)

  • The InterDependencies_ of a DataSet or DataSetInMem are now frozen once the dataset has been started, also after the measurement has completed and when loading a started dataset, since the parameters of a dataset can not change at that point. dataset.description.interdeps is therefore a FrozenInterDependencies_ for such datasets and modifying it in place raises a TypeError. Methods that return a new object such as extend and remove continue to work, and FrozenInterDependencies_ now compares equal to an InterDependencies_ with the same parameters. As a consequence, running a Measurement without any registered parameters raises RuntimeError("No parameters supplied") again. Since QCoDeS 0.55.0 this check had silently stopped working and such a measurement would start a dataset without parameters. The override argument of DataSet.set_interdependencies is deprecated, since the interdependencies of a started dataset are fixed and override never updated the run description stored in the database. (#8726)

Improved:

  • The full_name of an instrument, instrument module, ChannelTuple or parameter, and thereby the name of an instrument, is now cached on first access. Resolving these names walked up the chain of parent instruments on every access, which was a significant part of the time spent taking a snapshot of a station, e.g. at the start of every measurement. Taking a snapshot of a station with a few thousand parameters on nested instrument modules is now around 25% faster. The name is only cached if it is built by the default implementations of name_parts and short_name of the component and all its parents, since these only depend on attributes set when the component is created. Components where any of these are overridden, and therefore may change name after creation, still compute full_name on every access. (#7706)

  • Repeated calls to get_parameter_data on a started DataSet, and to methods built on it such as to_pandas_dataframe and to_xarray_dataset, are now faster as the run description held by the dataset is used rather than reading and parsing it from the database on every call. Calling get_parameter_data on a DataSet that has not been started now returns empty arrays for its parameters rather than raising a KeyError. A RunDescriber now holds a copy of the shapes it is created with, so changing the shapes mapping passed to Measurement.set_shapes, e.g. to reuse it for another measurement, no longer changes the description.shapes of datasets that have already been recorded. (#8726)

  • Fixed two race conditions in DataSet subscribers. A result inserted while a subscriber’s callback was running could be held back until the next insert, and when a dataset was completed, its final callback could run concurrently with one already in progress on the subscriber thread, delivering results out of order. Subscriber callbacks now never overlap and always receive results in the order they were inserted. The length passed to a subscriber callback is now always the number of results in the dataset up to and including the ones passed along with it. Previously it could be off when results were inserted while the callback was being called. (#8758)

  • Subscribing to a DataSet that is written in the background (write_in_background=True) now raises a NotImplementedError. This combination never worked: the background writer failed to insert the first results and the measurement then hung. Measurement.run raises the error before the run is created if subscribers are set up via Measurement.add_subscriber, the subscription.default_subscribers config option or DataSaver.default_callback. (#8758)

  • The instrument loggers (self.log and self.visa_log of instruments, channels and other instrument modules) no longer log while the garbage collector closes an instrument that was not closed, since the garbage collector runs at an arbitrary point in time and on any thread, possibly in the middle of other logging, where logging is not safe with all log handlers. IPInstrument now logs through its instrument logger, so that this also applies to it. Its log records are therefore emitted by the qcodes.instrument.instrument_base logger with the name of the instrument, rather than by the qcodes.instrument.ip logger. (#8769)

  • Instruments whose initialization fails are now closed right away, so that the resources they acquired before the failure, such as an open VISA connection, are freed immediately rather than when the instrument is garbage collected. Previously, retrying to create an instrument for a resource that can only be opened once could fail until the garbage collector had run. This also applies to instruments that cannot be registered, e.g. because their name is already in use, or that have abstract parameters, and to instruments whose __init__ returns a value (which raises a TypeError). If closing the instrument fails too, this is added as a note to the error of the initialization. Instruments that fail before Instrument.__init__ has completed, e.g. because a driver validates its arguments first, are not closed, since close methods rely on the name, parameters and logger that it sets up. (#8769)

  • Instruments that have been closed are no longer closed a second time when they are garbage collected. Previously, the close method of a driver could run again at an arbitrary later point in time, possibly after the name or the resources of the instrument had been reused by a new instrument. Instruments that are garbage collected without having been closed are still closed, but instruments should always be closed explicitly, e.g. with close or Instrument.close_all. (#8769)

  • Instrument.close now does nothing if the instrument has already been closed; close methods of subclasses still run before they call it. Closing an IPInstrument a second time no longer raises an AttributeError, and closing it now also closes its socket if the socket cannot be shut down, e.g. because it is not connected. (#8769)

Improved Drivers:

  • The remaining parameters of the Stanford Research SR560, SR830 and SR86x drivers are now annotated with the type of their value, e.g. SR830.buffer_SR is Parameter[float | Literal["Trigger"], Self]. Fixed the following SR830 driver bugs found along the way:

    • The time setpoints of the data buffer (ch1_databuffer, ch2_databuffer and sweep_setpoints) are now spaced by the sample period, 1 / buffer_SR. Previously N points spanned N / buffer_SR, so the spacing was too large by a factor N / (N - 1).

    • sweep_setpoints now keeps the unit and label of the sweep when the sample rate is switched back to "Trigger", and shows s / Time while a constant sample rate is used. Set the unit and label of the sweep with set_sweep_parameters or, together with a custom sweep_array, with the new sweep_setpoints.set_sweep_unit_and_label.

    • Creating an SR830 no longer emits a QCoDeSDeprecationWarning about ChannelBuffer not forwarding its keyword arguments. (#8696)

  • The remaining parameters of the YokogawaGS200 driver are now annotated with the type of their value, e.g. Parameter[float, Self]. YokogawaGS200Program.count is annotated as int | Literal["MIN", "MAX"]: it can be set to "MIN" or "MAX", and getting it always returns an integer, but until it is read again the cached value is the keyword that was set. The status register parameters return the StatusByte, StandardEventRegister, ExtendedEventRegister and ConditionRegister flags as before, and are now annotated as such.

    Fixed the following driver bugs found along the way:

    • YokogawaGS200.ramp_voltage and ramp_current raised a TypeError when called with ramp_mode="SOFTWARE". They now perform the software ramp, and raise a ValueError if ramp_step is 0, which would otherwise jump directly to the target.

    • A software ramp of the YokogawaGS200 to a target outside the output range of the present source range now raises before changing the output. Previously it stepped up to the limit of the range before raising. (#8697)

  • The Keithley_2600.yaml pyvisa-sim file now also defines the resources GPIB::3::INSTR and GPIB::4::INSTR, so that up to four simulated Keithley 2600 instruments with independent state can be used at the same time. (#8756)

  • The SignalHoundUSBSA124B driver now logs through its instrument logger, so that it does not log while the garbage collector closes it. Its log records are therefore emitted by the qcodes.instrument.instrument_base logger with the name of the instrument, rather than by the logger of the driver module. SignalHoundUSBSA124B.check_for_error is therefore no longer a static method, so it can no longer be called on the class without an instance. (#8769)

  • Closing a DynaCool, GalilMotionController, KeysightM960x, KeysightM9336A, SignalHoundUSBSA124B or MiniCircuits USB HID instrument that has already been closed no longer raises an AttributeError. Closing them after their initialization failed before connecting no longer fails either. KeysightM960x, KeysightM9336A and SignalHoundUSBSA124B no longer try to close a session or device that failed to open, and DynaCool now closes its VISA connection also if telling the server that it closes the connection fails, e.g. because the VISA session has already been closed. (#8769)

  • GalilMotionController and the MiniCircuits USB HID drivers (MiniCircuitsHIDMixin subclasses) now fully close the instrument in close. Previously, they only closed the connection, so the instrument stayed registered and its name could not be reused until it was garbage collected. (#8769)

Under the hood:

  • Tests are now distributed between pytest-xdist workers using worksteal rather than loadfile, so that a single slow test file no longer determines the duration of the test run. (#xxxx)

  • The test suite runs faster, especially on Windows: test databases are now opened with SQLite’s PRAGMA synchronous=OFF so that commits are not flushed to disk. (#8748)

  • All temporary files created by the test suite are now placed under pytest’s temporary directory root, so setting PYTEST_DEBUG_TEMPROOT (or --basetemp) relocates all of them. (#8749)

  • VisaInstrument no longer logs when the VISA handle of an instrument that was not closed is closed as the instrument is garbage collected, since logging from within the garbage collector or during interpreter shutdown is not safe with all log handlers. (#8769)