Skip to content

Export inferred parameters related to dependencies#7432

Merged
jenshnielsen merged 15 commits into
microsoft:mainfrom
jenshnielsen:add_interdeps_to_xarray
Sep 24, 2025
Merged

Export inferred parameters related to dependencies#7432
jenshnielsen merged 15 commits into
microsoft:mainfrom
jenshnielsen:add_interdeps_to_xarray

Conversation

@jenshnielsen
Copy link
Copy Markdown
Collaborator

@jenshnielsen jenshnielsen commented Aug 27, 2025

Export inferred to and from parameters related to setpoints with the same shape as the setpoints when exporting to xarray and the shape is known. Export inferred related to data parameters as data parameters.

TODO

  • Add docs and changelog

@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch from 4fd8248 to 4616cb2 Compare August 27, 2025 12:34
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 27, 2025

Codecov Report

❌ Patch coverage is 75.92593% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.93%. Comparing base (d7b44d1) to head (2a30214).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/qcodes/dataset/exporters/export_to_xarray.py 86.25% 11 Missing ⚠️
src/qcodes/dataset/data_set_cache.py 45.45% 6 Missing ⚠️
src/qcodes/dataset/data_set_in_memory.py 28.57% 5 Missing ⚠️
src/qcodes/dataset/data_set.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7432      +/-   ##
==========================================
- Coverage   59.94%   59.93%   -0.01%     
==========================================
  Files         347      347              
  Lines       31117    31168      +51     
==========================================
+ Hits        18653    18681      +28     
- Misses      12464    12487      +23     

☔ 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.

@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch 2 times, most recently from b8cde31 to 38abf50 Compare August 28, 2025 11:30
Copy link
Copy Markdown
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

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

pinging @samantha-ho for review as well :)

Comment thread src/qcodes/dataset/exporters/export_to_xarray.py Outdated
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch 3 times, most recently from 2965bb2 to 1d6e8e5 Compare September 3, 2025 08:14
Comment thread src/qcodes/dataset/exporters/export_to_xarray.py
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch from 1d6e8e5 to 49073aa Compare September 3, 2025 08:43
Comment thread src/qcodes/dataset/data_set.py Outdated
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch 2 times, most recently from 8fb3820 to 0856fba Compare September 3, 2025 10:14
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch 2 times, most recently from 7e15907 to 1f7fce5 Compare September 18, 2025 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the xarray export functionality to include inferred parameters related to dependencies. The changes add support for exporting inferred parameters that have the same shape as setpoints as coordinates, and inferred parameters related to data parameters as data variables.

  • Adds new method to_xarray_dataset_dict to replace the deprecated to_xarray_dataarray_dict
  • Updates the xarray export logic to include inferred parameters based on their relationships in the dependency graph
  • Adds comprehensive test coverage for the new functionality with various parameter relationship scenarios

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/dataset/test_dataset_export.py Adds type annotations and comprehensive tests for inferred parameter export functionality
tests/dataset/measurement/test_inferred_parameters_fix.py Updates existing tests to verify inferred parameters are now exported as coordinates
src/qcodes/dataset/exporters/export_to_xarray.py Implements core logic for exporting inferred parameters and adds new to_xarray_dataset_dict method
src/qcodes/dataset/data_set_protocol.py Adds protocol definition for new to_xarray_dataset_dict method
src/qcodes/dataset/data_set_in_memory.py Implements to_xarray_dataset_dict method and deprecates old method
src/qcodes/dataset/data_set_cache.py Adds cache support for new dataset dict export method
src/qcodes/dataset/data_set.py Implements to_xarray_dataset_dict method in main DataSet class

Comment thread src/qcodes/dataset/exporters/export_to_xarray.py
Comment thread tests/dataset/test_dataset_export.py
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch from defc83b to 9dd5a92 Compare September 23, 2025 09:04
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch from 9dd5a92 to 946f52a Compare September 23, 2025 09:42
Copy link
Copy Markdown
Contributor

@samantha-ho samantha-ho left a comment

Choose a reason for hiding this comment

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

Everything here looks good to me. Nice job!

@jenshnielsen jenshnielsen marked this pull request as ready for review September 24, 2025 12:24
@jenshnielsen jenshnielsen requested a review from a team as a code owner September 24, 2025 12:24
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch from 5a92f47 to d0d790e Compare September 24, 2025 12:25
@jenshnielsen jenshnielsen force-pushed the add_interdeps_to_xarray branch from d0d790e to 2a30214 Compare September 24, 2025 12:42
@jenshnielsen jenshnielsen added this pull request to the merge queue Sep 24, 2025
Merged via the queue into microsoft:main with commit fa8a832 Sep 24, 2025
16 checks passed
@jenshnielsen jenshnielsen deleted the add_interdeps_to_xarray branch September 24, 2025 14:00
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.

4 participants