Skip to content

feat: snapshot the station at the end of a measurement and diff snapshots - #8521

Draft
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 1 commit into
microsoft:mainfrom
jenshnielsen:post_measurement_snapshot
Draft

Jens Hedegaard Nielsen (jenshnielsen) wants to merge 1 commit into
microsoft:mainfrom
jenshnielsen:post_measurement_snapshot

Conversation

@jenshnielsen

Copy link
Copy Markdown
Collaborator

In addition to the snapshot taken when a measurement starts, a snapshot is now also taken when the measurement ends, using the same settings (update="Only_invalid"). It is stored in the dataset metadata under the end_snapshot key and exposed as the new end_snapshot property of the dataset. It can be disabled per measurement with
Measurement.run(snapshot_at_end=False) or globally via the new dataset.snapshot_at_end config key.

Add diff_start_end_snapshot and diff_start_end_snapshot_by_id to compare the start and end snapshot of a dataset, reusing the existing ParameterDiff machinery, and export them along with the existing diff_param_snapshots and diff_param_values_by_id from qcodes.dataset. Add format_parameter_diff to render a ParameterDiff in a human-readable form, which is also used when printing a ParameterDiff.

…hots

In addition to the snapshot taken when a measurement starts, a snapshot is
now also taken when the measurement ends, using the same settings
(``update="Only_invalid"``). It is stored in the dataset metadata under the
``end_snapshot`` key and exposed as the new ``end_snapshot`` property of the
dataset. It can be disabled per measurement with
``Measurement.run(snapshot_at_end=False)`` or globally via the new
``dataset.snapshot_at_end`` config key.

Add ``diff_start_end_snapshot`` and ``diff_start_end_snapshot_by_id`` to
compare the start and end snapshot of a dataset, reusing the existing
``ParameterDiff`` machinery, and export them along with the existing
``diff_param_snapshots`` and ``diff_param_values_by_id`` from
``qcodes.dataset``. Add ``format_parameter_diff`` to render a
``ParameterDiff`` in a human-readable form, which is also used when printing
a ``ParameterDiff``.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 84ae5582-d6ef-48bf-826b-87e071a97174
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.80519% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.06%. Comparing base (7bc8605) to head (9bd2655).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
src/qcodes/dataset/measurements.py 92.59% 2 Missing ⚠️
src/qcodes/dataset/data_set_protocol.py 95.00% 1 Missing ⚠️
src/qcodes/dataset/snapshot_utils.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8521      +/-   ##
==========================================
+ Coverage   72.00%   72.06%   +0.06%     
==========================================
  Files         305      305              
  Lines       32019    32084      +65     
==========================================
+ Hits        23055    23122      +67     
+ Misses       8964     8962       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant