Skip to content

Commit 837adbf

Browse files
authored
Merge branch 'main' into trlemon/add_forbidden_channel_cache_keithley3706a
2 parents 2d5da78 + aa276ab commit 837adbf

File tree

5 files changed

+41
-11
lines changed

5 files changed

+41
-11
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: 'v0.14.3'
4+
rev: v0.14.11
55
hooks:
66
- id: ruff-check
77
types_or: [python, pyi, jupyter, toml]
@@ -22,7 +22,7 @@ repos:
2222
- id: mixed-line-ending
2323
args: ['--fix=no']
2424
- repo: https://github.com/gitleaks/gitleaks
25-
rev: v8.28.0
25+
rev: v8.30.0
2626
hooks:
2727
- id: gitleaks
2828
- repo: https://github.com/jumanjihouse/pre-commit-hooks
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The table created by experiments_widget() now has a column of buttons by which individual datasets can be exported as ASCII files. This is a user-friendly way to use the qcode.dataset.export() method.
2+
3+
To demo this feature, run
4+
> experiments_widget(sort_by="timestamp")
5+
in Jupyter, and click on one of the cells in the "Export" column.

requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ coverage==7.13.1
6060
# pytest-cov
6161
cycler==0.12.1
6262
# via matplotlib
63-
dask==2025.12.0
63+
dask==2026.1.1
6464
# via
6565
# qcodes (pyproject.toml)
6666
# qcodes
@@ -89,7 +89,7 @@ fsspec==2026.1.0
8989
# via dask
9090
furo==2025.12.19
9191
# via qcodes (pyproject.toml)
92-
h5netcdf==1.7.3
92+
h5netcdf==1.8.0
9393
# via
9494
# qcodes (pyproject.toml)
9595
# qcodes
@@ -102,7 +102,7 @@ h5py==3.15.1
102102
# qcodes-loop
103103
hickle==5.0.3
104104
# via qcodes-loop
105-
hypothesis==6.150.1
105+
hypothesis==6.150.2
106106
# via qcodes (pyproject.toml)
107107
idna==3.11
108108
# via requests
@@ -211,7 +211,7 @@ networkx==3.6.1
211211
# via
212212
# qcodes (pyproject.toml)
213213
# qcodes
214-
numpy==2.3.5
214+
numpy==2.4.1
215215
# via
216216
# qcodes (pyproject.toml)
217217
# broadbean
@@ -258,7 +258,7 @@ pandas==2.3.3
258258
# qcodes
259259
# qcodes-loop
260260
# xarray
261-
pandas-stubs==2.3.3.251219
261+
pandas-stubs==2.3.3.260113
262262
# via qcodes (pyproject.toml)
263263
pandocfilters==1.5.1
264264
# via nbconvert
@@ -285,7 +285,7 @@ psutil==7.2.1
285285
# via ipykernel
286286
pure-eval==0.2.3
287287
# via stack-data
288-
pyarrow==22.0.0
288+
pyarrow==23.0.0
289289
# via
290290
# qcodes (pyproject.toml)
291291
# qcodes
@@ -327,7 +327,7 @@ python-dateutil==2.9.0.post0
327327
# pandas
328328
pytz==2025.2
329329
# via pandas
330-
pyvisa==1.16.0
330+
pyvisa==1.16.1
331331
# via
332332
# qcodes (pyproject.toml)
333333
# pyvisa-sim
@@ -379,7 +379,7 @@ snowballstemmer==3.0.1
379379
# via sphinx
380380
sortedcontainers==2.4.0
381381
# via hypothesis
382-
soupsieve==2.8.1
382+
soupsieve==2.8.2
383383
# via beautifulsoup4
384384
sphinx==8.2.3
385385
# via
@@ -524,7 +524,7 @@ zhinst-timing-models==25.10.0
524524
# via zhinst-utils
525525
zhinst-toolkit==1.2.0
526526
# via zhinst-qcodes
527-
zhinst-utils==0.7.0
527+
zhinst-utils==0.7.1
528528
# via zhinst-toolkit
529529
zipp==3.23.0
530530
# via importlib-metadata

src/qcodes/interactive_widget.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import traceback
99
from datetime import datetime
1010
from functools import partial, reduce
11+
from pathlib import Path
1112
from typing import TYPE_CHECKING, Any, Literal
1213

1314
from ipywidgets import ( # type: ignore[import-untyped]
@@ -442,6 +443,21 @@ def _get_plot_button(ds: DataSetProtocol, tab: Tab) -> Button:
442443
)
443444

444445

446+
def _get_export_button(
447+
ds: DataSetProtocol, tab: Tab
448+
) -> Button: # New button in the table to export each dataset
449+
return button(
450+
"",
451+
"warning",
452+
tooltip="Click to export this DataSet as ASCII.",
453+
on_click=lambda _: ds.export(
454+
"csv",
455+
path=Path.cwd() / "export",
456+
),
457+
button_kwargs=dict(icon="file-export"),
458+
)
459+
460+
445461
def _experiment_widget(
446462
data_sets: Iterable[DataSetProtocol], tab: Tab
447463
) -> GridspecLayout:
@@ -457,6 +473,7 @@ def _experiment_widget(
457473
"Notes",
458474
"Snapshot",
459475
"Plot",
476+
"Export",
460477
]
461478

462479
header = {n: button(n, "info") for n in header_names}
@@ -471,6 +488,7 @@ def _experiment_widget(
471488
row["MSMT Time"] = _get_timestamp_button(ds)
472489
row["Snapshot"] = _get_snapshot_button(ds, tab)
473490
row["Plot"] = _get_plot_button(ds, tab)
491+
row["Export"] = _get_export_button(ds, tab)
474492
rows.append(row)
475493

476494
grid = GridspecLayout(n_rows=len(rows), n_columns=len(header_names))

tests/test_interactive_widget.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ def test_snapshot_button(tab, standalone_parameters_dataset) -> None:
7575
assert "snapshot" in tab.get_title(1)
7676

7777

78+
def test_export_button(tab, standalone_parameters_dataset) -> None:
79+
ds = standalone_parameters_dataset
80+
export_button = interactive_widget._get_export_button(ds, tab)
81+
export_button.click()
82+
time.sleep(0.5) # after click
83+
84+
7885
@patch("matplotlib.pyplot.show")
7986
def test_plot_button(tab, standalone_parameters_dataset) -> None:
8087
ds = standalone_parameters_dataset

0 commit comments

Comments
 (0)