Skip to content

fix(dataset): handle plot for dataset with incorrect parameter data#8080

Merged
einsmein merged 5 commits intomicrosoft:mainfrom
einsmein:plot-fallback
Apr 29, 2026
Merged

fix(dataset): handle plot for dataset with incorrect parameter data#8080
einsmein merged 5 commits intomicrosoft:mainfrom
einsmein:plot-fallback

Conversation

@einsmein
Copy link
Copy Markdown
Contributor

@einsmein einsmein commented Apr 29, 2026

This PR modifies plot_dataset to handle dataset with incorrect parameter data.

When dataset is somehow exported incorrectly, such that get_parameter_data shows setpoints and dependent params as

{
  "dep": {"dep": [...], "index": [...]}, 
  "setpoint": {"setpoint": [...], "index": [...]}, 
}

instead of

{"dep" {"dep": [...], "setpoint": [...]}}

plot_dataset function previously throws a KeyError.
(Specifically, we see this when a dataset with unsorted setpoint was exported to netcdf with flag use_multi_index="always".)

@einsmein einsmein requested a review from a team as a code owner April 29, 2026 08:00
Copy link
Copy Markdown
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Perhaps we should add a changelog entry

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.60%. Comparing base (5c75dd6) to head (3f359ba).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/qcodes/dataset/data_export.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8080   +/-   ##
=======================================
  Coverage   70.59%   70.60%           
=======================================
  Files         333      333           
  Lines       32494    32502    +8     
=======================================
+ Hits        22940    22947    +7     
- Misses       9554     9555    +1     

☔ View full report in Codecov by Sentry.
📢 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.

@einsmein einsmein enabled auto-merge April 29, 2026 08:27
@einsmein einsmein added this pull request to the merge queue Apr 29, 2026
Merged via the queue into microsoft:main with commit c4ef604 Apr 29, 2026
18 checks passed
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.

2 participants