File tree Expand file tree Collapse file tree
docs/changes/newsfragments
src/qcodes/dataset/exporters Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Fixed :meth:`qcodes.dataset.DataSet.to_xarray_dataset` raising an
2- ``AlignmentError`` when two data variables do not share the same setpoints
3- and one of them is stored as a non-grid (multi-index) array parameter.
2+ ``AlignmentError`` when two data variables do not share the same full set of
3+ setpoints and one of them is stored as a non-grid (multi-index) array parameter.
Original file line number Diff line number Diff line change @@ -357,11 +357,10 @@ def load_to_xarray_dataset(
357357 dataset , data , use_multi_index = use_multi_index
358358 )
359359
360- # When two data variables do not share the same setpoints, one may be
360+ # When two data variables do not share the same full set of setpoints, one may be
361361 # exported using a pandas MultiIndex (non-grid data) while another uses a
362- # standalone dimension for a shared setpoint coordinate. xr.merge raises
363- # an AlignmentError in that case because the same coordinate name has
364- # different Index objects in the two sub-datasets. Resolve this by
362+ # standalone dimension for a shared setpoint coordinate. xr.merge raises
363+ # an AlignmentError in that case because the shared coordinate name has
365364 # unstacking the multi_index into proper independent dimensions (accepting
366365 # NaN for missing grid points) so that the shared coordinate becomes a
367366 # plain 1-D dimension in all sub-datasets.
Original file line number Diff line number Diff line change @@ -2334,11 +2334,11 @@ def test_export_to_xarray_dataset_different_setpoints(
23342334 """
23352335 Regression test for https://github.com/microsoft/Qcodes/issues/8232
23362336
2337- Export to xarray should succeed when two data variables do not share the
2338- same setpoints. Specifically, this covers the case where one parameter is
2337+ Export to xarray should succeed when two data variables do not share the same
2338+ full set of setpoints. Specifically, this covers the case where one parameter is
23392339 an array-type with setpoints (f_stop, freq) that are NOT on a regular grid
23402340 (so the multi_index path is used), while a second parameter has only the
2341- scalar setpoint (f_stop,). Previously this raised an AlignmentError
2341+ scalar setpoint (f_stop,). Previously this raised an AlignmentError
23422342 because xr.merge could not reconcile the different Index objects for the
23432343 shared 'f_stop' coordinate.
23442344 """
You can’t perform that action at this time.
0 commit comments