QCoDeS [UNRELEASED DRAFT] (2026-11-27)¶
Breaking Changes:¶
GalilDMC4133Controller.absolute_positionis now read-only. Setting it previously only updated the cached value without moving the motors, and now raises an error. (#8677)The
cutoff_lo(high-pass) andcutoff_hi(low-pass) parameters of the virtualSR560driver now only accept the filter cutoffs that the instrument has:cutoff_loaccepts"DC"and 0.03 Hz to 10 kHz, andcutoff_hi0.03 Hz to 1 MHz. Previouslycutoff_loalso accepted 30 kHz to 1 MHz, andcutoff_hiaccepted"DC".SR86x.external_reference_trigger_input_resistancenow returns"50OHMS"or"1MEG"instead of0or1. Setting it to0or1still works at runtime, but type checkers now reject it since the parameter is annotated asParameter[str, Self]; set it to"50"/"50OHMS"or"1M"/"1MEG"instead. (#8696)The
current,current_rangeandcurrent_limitparameters of theYokogawaGS200, and itsmeasureparameter in voltage source mode, now use the unitAinstead ofI. Theramp_rateandramp_stepparameters now start with the unitsA/sandAinstead ofV/sandVif 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, sodelay(500)set a delay of 500 s despite themsunit. 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 afloatin seconds instead of anintrounded to whole seconds. (#8697)The
InterDependencies_of aDataSetorDataSetInMemare 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.interdepsis therefore aFrozenInterDependencies_for such datasets and modifying it in place raises aTypeError. Methods that return a new object such asextendandremovecontinue to work, andFrozenInterDependencies_now compares equal to anInterDependencies_with the same parameters. As a consequence, running aMeasurementwithout any registered parameters raisesRuntimeError("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. Theoverrideargument ofDataSet.set_interdependenciesis deprecated, since the interdependencies of a started dataset are fixed andoverridenever updated the run description stored in the database. (#8726)
Improved:¶
The
full_nameof an instrument, instrument module,ChannelTupleor parameter, and thereby thenameof 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 ofname_partsandshort_nameof 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 computefull_nameon every access. (#7706)Datasets exported to NetCDF can now be compressed using the deflate (gzip) compression built into NetCDF4/HDF5. Depending on the data this reduces the size of the exported files by a factor of roughly 1.3 to 3.3 with no measurable slowdown of the export, and no loss of precision since the compression is lossless. Compressed files remain regular NetCDF files that can be read by any NetCDF client without any special handling.
Compression is disabled by default for now and can be enabled with the new
qcodes.config.dataset.export_netcdf_compression_levelconfig option, which sets the compression level between0(uncompressed, the default) and9. A level of4is recommended since higher levels are significantly slower while giving almost no additional size reduction. We plan to enable compression by default in a future release, so please try it out and let us know about any problems. (#8367)Repeated calls to
get_parameter_dataon a startedDataSet, and to methods built on it such asto_pandas_dataframeandto_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. Callingget_parameter_dataon aDataSetthat has not been started now returns empty arrays for its parameters rather than raising aKeyError. ARunDescribernow holds a copy of the shapes it is created with, so changing the shapes mapping passed toMeasurement.set_shapes, e.g. to reuse it for another measurement, no longer changes thedescription.shapesof datasets that have already been recorded. (#8726)Fixed two race conditions in
DataSetsubscribers. 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
DataSetthat is written in the background (write_in_background=True) now raises aNotImplementedError. This combination never worked: the background writer failed to insert the first results and the measurement then hung.Measurement.runraises the error before the run is created if subscribers are set up viaMeasurement.add_subscriber, thesubscription.default_subscribersconfig option orDataSaver.default_callback. (#8758)The instrument loggers (
self.logandself.visa_logof 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.IPInstrumentnow logs through its instrument logger, so that this also applies to it. Its log records are therefore emitted by theqcodes.instrument.instrument_baselogger with the name of the instrument, rather than by theqcodes.instrument.iplogger. (#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 aTypeError). If closing the instrument fails too, this is added as a note to the error of the initialization. Instruments that fail beforeInstrument.__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
closemethod 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. withcloseorInstrument.close_all. (#8769)Instrument.closenow does nothing if the instrument has already been closed; close methods of subclasses still run before they call it. Closing anIPInstrumenta second time no longer raises anAttributeError, and closing it now also closes its socket if the socket cannot be shut down, e.g. because it is not connected. (#8769)The
setmethod of aParameteris now typed with the parameter’s data type, so that type checkers reportparameter.set(value)calls with a value of the wrong type in the same way as they already did forparameter(value). Previouslysetaccepted any arguments. (#8800)When a
VisaInstrumentcannot connect because the VISA interface in its address is not configured (VI_ERROR_INTF_NUM_NCONFIG) or no instrument is found at its address (VI_ERROR_RSRC_NFOUND), the raisedVisaIOErrornow has a note that names the likely cause on the PC, e.g. a GPIB board that is not configured in NI MAX or Keysight Connection Expert. (#8809)
Improved Drivers:¶
The Keithley 2450 source limit has the unit of the limited quantity: V for the current source, A for the voltage source. (#8619)
The Rigol DS1074Z time axis is spaced by the waveform’s x increment; it was one increment too wide in total. (#8621)
All queries of the Galil DMC-41x3 driver now retry the empty or bare
:replies that gclib can return under rapid polling, instead of onlyis_in_motionandabsolute_position. Each such reply is now also logged as a warning. Non-empty replies that cannot be parsed, such as an absolute position with fewer than three values, now raise immediately instead of being retried.GalilDMC4133Motor.on_off_statusandoff_when_error_occursnow parse the whole reply instead of only its first character. The Galil DMC-41x3 driver no longer appends a carriage return to the commands it sends, since gclib already terminates each command with one. Previously every command was followed by an extra empty command. (#8677)The remaining parameters of the Stanford Research
SR560,SR830andSR86xdrivers are now annotated with the type of their value, e.g.SR830.buffer_SRisParameter[float | Literal["Trigger"], Self]. Fixed the following SR830 driver bugs found along the way:The time setpoints of the data buffer (
ch1_databuffer,ch2_databufferandsweep_setpoints) are now spaced by the sample period,1 / buffer_SR. Previously N points spannedN / buffer_SR, so the spacing was too large by a factorN / (N - 1).sweep_setpointsnow keeps the unit and label of the sweep when the sample rate is switched back to"Trigger", and showss/Timewhile a constant sample rate is used. Set the unit and label of the sweep withset_sweep_parametersor, together with a customsweep_array, with the newsweep_setpoints.set_sweep_unit_and_label.Creating an
SR830no longer emits aQCoDeSDeprecationWarningaboutChannelBuffernot forwarding its keyword arguments. (#8696)
The remaining parameters of the
YokogawaGS200driver are now annotated with the type of their value, e.g.Parameter[float, Self].YokogawaGS200Program.countis annotated asint | 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 theStatusByte,StandardEventRegister,ExtendedEventRegisterandConditionRegisterflags as before, and are now annotated as such.Fixed the following driver bugs found along the way:
YokogawaGS200.ramp_voltageandramp_currentraised aTypeErrorwhen called withramp_mode="SOFTWARE". They now perform the software ramp, and raise aValueErroriframp_stepis 0, which would otherwise jump directly to the target.A software ramp of the
YokogawaGS200to 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
SignalHoundUSBSA124Bdriver 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 theqcodes.instrument.instrument_baselogger with the name of the instrument, rather than by the logger of the driver module.SignalHoundUSBSA124B.check_for_erroris 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,SignalHoundUSBSA124Bor MiniCircuits USB HID instrument that has already been closed no longer raises anAttributeError. Closing them after their initialization failed before connecting no longer fails either.KeysightM960x,KeysightM9336AandSignalHoundUSBSA124Bno longer try to close a session or device that failed to open, andDynaCoolnow 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)GalilMotionControllerand the MiniCircuits USB HID drivers (MiniCircuitsHIDMixinsubclasses) now fully close the instrument inclose. Previously, they only closed the connection, so the instrument stayed registered and its name could not be reused until it was garbage collected. (#8769)
New:¶
Snapshots can be stored losslessly using versioned, checksummed Zstandard level 1 compression by setting
dataset.snapshot_compressionto"zstd". Compressed and uncompressed snapshots are always readable, and snapshot APIs and NetCDF exports return the complete JSON. Uncompressed snapshots, the default, can be read by all QCoDeS versions; compressed snapshots can only be read by QCoDeS 0.64.0 and later. No database upgrade is required. (#8724)Added the config option
qcodes.config.dataset.export_netcdf_snapshot_in_group. When enabled, the snapshot of datasets exported to NetCDF is stored as a variable in theqcodes_metadatagroup, compressed with the sameqcodes.config.dataset.export_netcdf_compression_levelas the data, rather than as thesnapshotattribute. The snapshot is then only read when needed, which reduces the time it takes to open files with large snapshots, and their size when compression is enabled. Thesnapshotattribute then contains a pointer to that location.load_from_netcdfsupports both layouts, and the new functionqcodes.dataset.snapshot_from_netcdfcan be used to read the snapshot from either layout without a QCoDeS database. The option is disabled by default since tools that read thesnapshotattribute directly must be updated to support the new layout. (#8781)
Under the hood:¶
Tests are now distributed between pytest-xdist workers using
workstealrather thanloadfile, 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=OFFso 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)VisaInstrumentno 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)The
[source]links in the API documentation now point to the source code on GitHub instead of to source pages rendered bysphinx.ext.viewcode. This makes the documentation build faster. Inherited members now also link to their definition in the base class. (#8783)