Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
33b5907
Fix isinstance validator logic order
jenshnielsen Aug 19, 2026
2a441b5
Add ty type checker configuration
jenshnielsen Aug 19, 2026
b5c47f4
Dispatch Parameter.get_raw/set_raw instead of overwriting them
jenshnielsen Aug 19, 2026
4b0a0ac
Default TParameter to Parameter[Any, Any]
jenshnielsen Aug 19, 2026
340550e
Fix element typing of standalone result dicts
jenshnielsen Aug 21, 2026
1c6f3c0
Do not assume a ctypes errcheck callable has a __name__
jenshnielsen Aug 21, 2026
5f4bb2a
Suppress ty on the colorbar _inside workaround
jenshnielsen Aug 21, 2026
e4145f7
Suppress ty on the qcodes_abstractmethod marker
jenshnielsen Aug 21, 2026
b345ce7
Annotate the DynaCool server socket dictionary
jenshnielsen Aug 21, 2026
e600647
Narrow the numpy int and float type tuples
jenshnielsen Aug 21, 2026
3b108e9
Suppress ty on the ParamSpec._from_dict override
jenshnielsen Aug 21, 2026
399dfee
Suppress ty on the IPToVisa base class conflict
jenshnielsen Aug 21, 2026
d380eda
Suppress ty on the Alazar get_idn override
jenshnielsen Aug 21, 2026
c6be0b3
Match the parameter name of the AWG5014 __getattr__
jenshnielsen Aug 21, 2026
12b14f0
Suppress ty on Parameter.increment
jenshnielsen Aug 21, 2026
c152c30
Suppress ty on the Lakeshore CHANNEL_CLASS default
jenshnielsen Aug 21, 2026
2467d1b
Suppress ty on the cache update monkeypatch
jenshnielsen Aug 21, 2026
bc8a2bd
Suppress ty on the run overview extra columns
jenshnielsen Aug 21, 2026
9910db1
Type the AutoLoadableChannelList multichan_paramclass
jenshnielsen Aug 21, 2026
377e6d3
Suppress ty on the ChannelList setitem narrowing
jenshnielsen Aug 21, 2026
18ac6c2
Annotate the second Command exec mapping
jenshnielsen Aug 21, 2026
6df9bb7
Register the float sqlite adapter separately from numpy floats
jenshnielsen Aug 21, 2026
940b039
Suppress the get_ramp_values mismatch newly reported by ty 0.0.74
jenshnielsen Aug 24, 2026
c083924
Add a draft report for the remaining ty issue
jenshnielsen Aug 24, 2026
6f2c10f
Document how mypy and ty suppression codes interact
jenshnielsen Aug 24, 2026
2137afa
Document how pyright reads suppression comments
jenshnielsen Aug 24, 2026
41af639
Annotate the json exporter templates
jenshnielsen Aug 24, 2026
330b683
Allow subscribe callbacks to take callback_kwargs
jenshnielsen Aug 24, 2026
8d8312b
Type the 34980A module dict as its submodules
jenshnielsen Aug 24, 2026
3b53ea0
Correct the return type of parse_awg_file
jenshnielsen Aug 24, 2026
b11d441
Do not assume every parameter has a label in the AWG5014C notebook
jenshnielsen Aug 24, 2026
53496d6
Require qcodes_loop 0.2.3
jenshnielsen Aug 29, 2026
e3cd750
Check the example notebooks with ty
jenshnielsen Aug 25, 2026
824adde
Use the enum keys for the B1500 module dicts
jenshnielsen Aug 25, 2026
ad0dec3
Enable the channels before B1500 phase compensation
jenshnielsen Aug 25, 2026
afc81b0
Declare the dynamic attributes of the E4980A measurement pair
jenshnielsen Aug 25, 2026
f3eb283
Pack the SR86x example waveforms in lists
jenshnielsen Aug 25, 2026
3d802eb
Accept any iterable of paths in the B220X switch matrix
jenshnielsen Aug 25, 2026
33e1d1f
Accept any collection of paths in the 34980A switch matrix
jenshnielsen Aug 25, 2026
2b8e92f
Do not take the length of Line2D.get_ydata in the Lakeshore examples
jenshnielsen Aug 25, 2026
89bc656
Handle the optional values in the offline plotting tutorial
jenshnielsen Aug 25, 2026
9753a1a
Put snapshot_raw on the dataset protocol
jenshnielsen Aug 25, 2026
2d96b0b
Check the optional snapshots in the snapshots notebook
jenshnielsen Aug 25, 2026
7609756
Use type safe dataset unpacking
jenshnielsen Aug 27, 2026
e3977ce
Ask dond for unsqueezed results in the docs
jenshnielsen Aug 27, 2026
05c8696
Allow ParamSpecBase in get_parameter_data
jenshnielsen Aug 27, 2026
e1df6d8
Check for a missing config in the config notebook
jenshnielsen Aug 27, 2026
e000af0
Match the set_raw parameter name in the docs
jenshnielsen Aug 27, 2026
ed88c2f
Narrow root_instrument in the example parameters
jenshnielsen Aug 27, 2026
4a78c18
Fix ty typechecking of docs hack
jenshnielsen Aug 28, 2026
446bd85
Guard the DataSetInMem only API in the docs
jenshnielsen Aug 28, 2026
d612a29
Allow a sequence of arrays as a measurement result
jenshnielsen Aug 28, 2026
b98a13a
Run ty as part of the CI type checking job
jenshnielsen Aug 28, 2026
eadbfb7
Suppress ty errors where mypy is already suppressed
jenshnielsen Aug 29, 2026
6c18044
Suppress ty errors where pyright is already suppressed
jenshnielsen Aug 29, 2026
8286a8c
Annotate numpy_complex as numpy complex types only
jenshnielsen Aug 29, 2026
8594dab
Annotate the monitor ports as int
jenshnielsen Aug 29, 2026
d854c08
Annotate shape containers in tests
jenshnielsen Aug 29, 2026
73cfb78
Assert optional attributes are set in tests
jenshnielsen Aug 29, 2026
dd4eef3
Suppress ty on TypeVars used as plain values
jenshnielsen Aug 29, 2026
482de30
Clean up ignore comments in parameter override test
jenshnielsen Aug 29, 2026
dddcfdf
Suppress ty on reading the name of a callable
jenshnielsen Aug 29, 2026
7eb8fd2
Fix type checking for example notebook
jenshnielsen Sep 21, 2026
fb21938
Add type for idn parameter
jenshnielsen Sep 21, 2026
83b2209
Suppress new ty errors in negative type tests
jenshnielsen Sep 25, 2026
b0de75f
Compare the global set callback against None
jenshnielsen Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ jobs:
run: mypy -p qcodes
if: ${{ !matrix.min-version && always() }}
id: mypy
- name: Run ty
run: ty check --output-format github
if: ${{ !matrix.min-version && always() }}
id: ty
- name: Set pytest basetemp
if: ${{ runner.os == 'Windows' }}
run: echo "PYTEST_BASETEMP=--basetemp=D:\\tmp" >> $GITHUB_ENV
Expand Down
6 changes: 6 additions & 0 deletions docs/changes/newsfragments/8441.improved.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The ``callback`` argument of :meth:`.DataSet.subscribe` is now typed as
``Callable[..., None]``. The previous annotation described a callback taking
exactly three arguments, which contradicted ``callback_kwargs``: those are bound
onto the callback with ``functools.partial``, so a callback using them takes
further arguments. ``_Subscriber``, which ``subscribe`` forwards to, already
typed it this way.
3 changes: 3 additions & 0 deletions docs/changes/newsfragments/8441.improved.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The offline plotting tutorial now checks the optional values it gets back from
:func:`.plot_dataset` before using them, and asks for the root figure when
saving. ``Axes.figure`` may be a ``SubFigure``, which has no ``savefig``.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.improved.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
``snapshot_raw`` is now part of :class:`.DataSetProtocol` and is available on
:class:`.DataSetInMem` as well as on :class:`.DataSet`. It is documented as the
way to get the snapshot of a run as a JSON string, and is used as such in the
example notebooks, but it was only declared on one of the two dataset classes,
so reading it from a dataset returned by a measurement did not type check.
3 changes: 3 additions & 0 deletions docs/changes/newsfragments/8441.improved.12
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The snapshot example notebook now checks that the snapshots it reads back from
the datasets are present before using them. A run only has a snapshot if one was
recorded, so both ``snapshot`` and ``snapshot_raw`` are optional.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.improved.13
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The type alias ``ValuesType``, used by ``DataSaver.add_result`` and related
methods, now also accepts a sequence of numpy arrays. This is what a
``MultiParameter`` measuring more than one array returns, so passing such a
result to ``DataSaver.add_result`` no longer produces a type checking error.
The behavior at runtime is unchanged since this was already supported.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.improved.14
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The annotation of ``qcodes.utils.types.numpy_complex`` now correctly
describes its content as a tuple of numpy complex types. It was previously
annotated as also containing the builtin ``complex``, which via the implicit
numeric tower made type checkers treat it as possibly containing ``int`` or
``float`` as well.
3 changes: 3 additions & 0 deletions docs/changes/newsfragments/8441.improved.15
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The module level ports used by ``qcodes.monitor`` are now annotated as
``int``. They are intended to be reassigned to select another port, which
type checkers rejected since the type was inferred from the default value.
7 changes: 7 additions & 0 deletions docs/changes/newsfragments/8441.improved.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``Keysight34980A.module`` is now a ``dict`` of
``Keysight34980ASwitchMatrixSubModule`` rather than one built with
``dict.fromkeys``, whose values were typed as possibly ``None``. ``scan_slots``
puts an entry in for every slot, either the driver for the installed module or a
generic submodule, so the values were never ``None`` once the instrument was
constructed. Code using ``instrument.module[slot]`` no longer has to account for
a ``None`` that cannot occur.
6 changes: 6 additions & 0 deletions docs/changes/newsfragments/8441.improved.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The return type of :func:`.parse_awg_file` has been corrected. The waveform and
marker entries were declared as lists of dicts, but the parser returns the arrays
from inside those dicts, and the loop counts and sequencing values were declared
as possibly ``str`` when they are always ``int``. The type now matches the call
signature of :meth:`.TektronixAWG5014.make_send_and_load_awg_file`, which the
docstring already promised and which is how the function is meant to be used.
6 changes: 6 additions & 0 deletions docs/changes/newsfragments/8441.improved.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The Keysight B1500 example notebook called
``b1500.run_iv_staircase_sweep.measurement_status()`` in the phase compensation
section. ``IVSweepMeasurement`` has no such method, so the cell raised
``AttributeError``. The surrounding text asks for all channel outputs to be
enabled before performing phase compensation, so the cell now calls
``b1500.enable_channels()``.
7 changes: 7 additions & 0 deletions docs/changes/newsfragments/8441.improved.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``KeysightE4980AMeasurementPair`` now declares a ``__getattr__`` for type
checkers. The two measured values are exposed as attributes named after the
``names`` of the measurement function, for example ``capacitance`` for ``CPD``
and ``inductance`` for ``LPD``, so which attributes exist is only known at
runtime. The declaration lets this documented usage be written in typed code. It
is not defined at runtime, so accessing an attribute that the current
measurement function does not provide still raises the usual ``AttributeError``.
4 changes: 4 additions & 0 deletions docs/changes/newsfragments/8441.improved.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The Stanford SR86x buffered readout example notebook now packs the waveforms for
:meth:`.TektronixAWG70000Base.makeSEQXFile` in lists rather than wrapping them in
further numpy arrays, which is the shape the method documents. The two forms
behave the same at runtime.
6 changes: 6 additions & 0 deletions docs/changes/newsfragments/8441.improved.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
``connect_paths``, ``disconnect_paths`` and ``to_channel_list`` on the Keysight
B220X switch matrix drivers now accept any iterable of paths rather than only a
``Sequence``. They iterate the paths once and do not index them, so passing a
set, as the example notebook does, is fine. Note that the order in which the
paths appear in the channel list then follows the iteration order of the
argument.
6 changes: 6 additions & 0 deletions docs/changes/newsfragments/8441.improved.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The path arguments of ``connect_paths``, ``disconnect_paths``, ``are_closed``,
``are_open`` and ``to_channel_list`` on the Keysight 34980A switch matrix
submodules are now typed as a ``Collection`` rather than a ``list``, so a set or
a tuple of paths is accepted as well. A ``Collection`` rather than an
``Iterable`` because these methods walk the paths twice, once to validate them
and once to build the channel list, which a one shot iterator would not survive.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.improved.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The live temperature plot helper in the two Lakeshore example notebooks keeps
the appended y data in a local variable instead of reading it back with
``Line2D.get_ydata``. The return of ``get_ydata`` is typed as ``ArrayLike``,
which is not necessarily sized, so taking its length was a type error. This also
avoids reading the data back from the line on every iteration.
9 changes: 9 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:class:`.Parameter` no longer replaces its own ``get_raw``/``set_raw`` methods
with the implementation generated from ``get_cmd``/``set_cmd``. The generated
implementation is stored on the parameter instead, and ``get_raw``/``set_raw``
are now regular methods that dispatch to it. Assigning over the methods made
static type checkers infer ``get_raw``/``set_raw`` to be instance attributes of
:class:`.Parameter`, which in turn made every subclass implementing them as
regular methods an invalid override. There is no change in behaviour; note only
that ``parameter.get_raw`` is now always a bound method rather than, depending
on the arguments, a ``Command`` instance.
9 changes: 9 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The ``TParameter`` type variable used by :meth:`.InstrumentBase.add_parameter`
now defaults to ``Parameter[Any, Any]`` rather than to a bare ``Parameter``.
When ``add_parameter`` is called without an explicit ``parameter_class`` the
returned parameter is bound to the instrument it is added to, so the previous
default (which expands to ``Parameter[Any, InstrumentBase | None]``) wrongly
claimed that the instrument was ``InstrumentBase | None``. This made the result
unassignable to the ``Parameter[SomeType, Self]`` annotations that drivers use.
Code that relies on the inferred type of an unannotated
``instrument.add_parameter("name")`` will now see ``Parameter[Any, Any]``.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
``DataSet._finalize_res_dict_standalones`` now appends to its result list
directly instead of building intermediate lists. The intermediate lists took
their element type from the branch that built them rather than from the
declaration, and ``dict`` is invariant in its value type, so the result was not
assignable back. There is no change in behaviour.
4 changes: 4 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The Alazar DLL wrapper no longer assumes that the callable handed to a ctypes
``errcheck`` has a ``__name__``, which a plain ``Callable`` does not guarantee.
The error message falls back to the repr of the callable instead. This only
affects the text of an error that should not occur in practice.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
``numpy_ints`` and ``numpy_floats`` in ``qcodes.utils.types`` are now annotated
as tuples of ``type[np.integer]`` and ``type[np.floating]`` rather than of bare
``type``. As a consequence ``_adapt_float``, which is registered as a sqlite
adapter for the numpy float types as well as for ``float``, now declares that it
accepts ``np.floating`` too. Its behaviour is unchanged.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The ``__getattr__`` that provides backwards-compatible access to the old flat
parameter names on the Tektronix AWG5014 now names its parameter ``key``,
matching ``DelegateAttributes.__getattr__`` which it overrides and delegates to.
Python only ever calls ``__getattr__`` positionally, so this has no effect at
runtime.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
``json_template_linear`` and ``json_template_heatmap`` in
``qcodes.dataset.json_exporter`` are now annotated as ``dict[str, Any]``. They
are templates for a JSON document, so their values are deliberately
heterogeneous, and without the annotation the inferred value type made indexing
into them an error for callers filling the template in.
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8441.underthehood.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The type checker ``ty`` is now a test dependency and is run as part of the
CI job that also runs ``mypy`` and ``pyright``. Unlike the other type
checkers ``ty`` understands Jupyter notebooks, so this type checks the
example notebooks in ``docs`` in addition to the source code in ``src``
and the test suite. ``ty`` 0.0.80 or newer is required.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# this should happen as early as possible
import qcodes.instrument.instrument_meta

qcodes.instrument.instrument_meta.InstrumentMeta = ABCMeta
qcodes.instrument.instrument_meta.InstrumentMeta = ABCMeta # ty: ignore[invalid-assignment]
# we need to reload any module that has been imported and
# makes use of this metaclass. The modules below are all imported
# by importing qcodes.instrument so we need to reload them
Expand Down
24 changes: 2 additions & 22 deletions docs/examples/DataSet/Accessing-data-in-DataSet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -710,26 +710,6 @@
"dataset.get_parameters()"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'x,t,y,y2,q'"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset.parameters"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1047,7 +1027,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "qcodes",
"language": "python",
"name": "python3"
},
Expand All @@ -1061,7 +1041,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.14.7"
},
"toc": {
"base_numbering": 1,
Expand Down
51 changes: 2 additions & 49 deletions docs/examples/DataSet/DataSet-class-walkthrough.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -1131,6 +1131,12 @@
}
],
"source": [
"from qcodes.dataset.data_set_in_memory import DataSetInMem\n",
"\n",
"# the set_netcdf_location only exists for DataSetInMem so we validate that we are indeed using that.\n",
"if not isinstance(reloaded_ds, DataSetInMem):\n",
" raise TypeError(\"reloaded_ds must be an instance of DataSetInMem\")\n",
"\n",
"reloaded_ds.set_netcdf_location(new_file_path)\n",
"reloaded_ds.export_info"
]
Expand Down
18 changes: 12 additions & 6 deletions docs/examples/DataSet/Offline Plotting Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@
"outputs": [],
"source": [
"colorbar = colorbars[0]\n",
"# 2D plots have a colorbar, 1D plots do not, so the entries are optional\n",
"assert colorbar is not None\n",
"colorbar.set_label(\"Correct science label\")"
]
},
Expand Down Expand Up @@ -939,9 +941,11 @@
"source": [
"%%time\n",
"axeslist, _ = plot_dataset(dataset)\n",
"axeslist[0].figure.savefig(\n",
" Path.cwd().parent / \"example_output\" / f\"test_plot_dataset_{dataid}.pdf\"\n",
")"
"# Axes.figure may be a SubFigure, which cannot be saved, so ask for the\n",
"# root figure\n",
"figure = axeslist[0].get_figure(root=True)\n",
"assert figure is not None\n",
"figure.savefig(Path.cwd().parent / \"example_output\" / f\"test_plot_dataset_{dataid}.pdf\")"
]
},
{
Expand Down Expand Up @@ -971,9 +975,11 @@
"source": [
"%%time\n",
"axeslist, _ = plot_dataset(dataset, rasterized=False)\n",
"axeslist[0].figure.savefig(\n",
" Path.cwd().parent / \"example_output\" / f\"test_plot_dataset_{dataid}.pdf\"\n",
")"
"# Axes.figure may be a SubFigure, which cannot be saved, so ask for the\n",
"# root figure\n",
"figure = axeslist[0].get_figure(root=True)\n",
"assert figure is not None\n",
"figure.savefig(Path.cwd().parent / \"example_output\" / f\"test_plot_dataset_{dataid}.pdf\")"
]
}
],
Expand Down
13 changes: 12 additions & 1 deletion docs/examples/DataSet/Threaded data acquisition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "2add302b",
"metadata": {
"ExecuteTime": {
Expand All @@ -115,6 +115,17 @@
" time.sleep(0.1)\n",
" return val\n",
"\n",
" @property\n",
" def root_instrument(self) -> \"DummyInstrumentWithMeasurement\":\n",
" if self.instrument is None or not isinstance(\n",
" self.instrument.root_instrument, DummyInstrumentWithMeasurement\n",
" ):\n",
" raise ValueError(\n",
" \"SleepyDmmExponentialParameter must be bound to a DummyInstrumentWithMeasurement\"\n",
" )\n",
" instr = self.instrument.root_instrument\n",
" return instr\n",
"\n",
" @staticmethod\n",
" def _exponential_decay(a: float, b: float):\n",
" x = 0\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1451,7 +1451,15 @@
}
],
"source": [
"result = dond(sweep_1, sweep_2, [dmm.v1], [dmm.v2], do_plot=True, show_progress=True)"
"result = dond(\n",
" sweep_1,\n",
" sweep_2,\n",
" [dmm.v1],\n",
" [dmm.v2],\n",
" do_plot=True,\n",
" show_progress=True,\n",
" squeeze=False,\n",
")"
]
},
{
Expand Down Expand Up @@ -1979,7 +1987,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "qcodes",
"language": "python",
"name": "python3"
},
Expand All @@ -1993,7 +2001,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.14.7"
},
"toc": {
"base_numbering": 1,
Expand Down
12 changes: 9 additions & 3 deletions docs/examples/DataSet/Working with snapshots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,9 @@
"metadata": {},
"outputs": [],
"source": [
"snapshot_of_run = dataset.snapshot"
"snapshot_of_run = dataset.snapshot\n",
"# a run only has a snapshot if one was recorded, this one has\n",
"assert snapshot_of_run is not None"
]
},
{
Expand All @@ -602,7 +604,8 @@
"metadata": {},
"outputs": [],
"source": [
"snapshot_of_run_in_json_format = dataset.snapshot_raw"
"snapshot_of_run_in_json_format = dataset.snapshot_raw\n",
"assert snapshot_of_run_in_json_format is not None"
]
},
{
Expand Down Expand Up @@ -881,7 +884,10 @@
"metadata": {},
"outputs": [],
"source": [
"diff_param_values(dataset.snapshot, bad_dataset.snapshot).changed"
"snapshot_of_bad_run = bad_dataset.snapshot\n",
"assert snapshot_of_bad_run is not None\n",
"\n",
"diff_param_values(snapshot_of_run, snapshot_of_bad_run).changed"
]
},
{
Expand Down
Loading
Loading