Handle errors when a multi-leaf dt has no 2D data - #65
Conversation
Co-authored-by: Phil King <78075132+phrgab@users.noreply.github.com>
|
Thanks @phrgab. This should now be fixed. I'll fix the merge conflict when we're ready to merge. |
| "## Interactive plotting\n", | ||
| "### Interactive UIs\n", | ||
| "Interactive UIs for visualising and aligning data can be accessed by calling {py:func}`.disp <peaks.core.GUI.disp_panels.disp.disp>` on a 2D, 3D, or 4D {py:class}`xarray.DataArray`, or on a {py:class}`xarray.DataTree` containing either a single data entry, or on a tree with multiple leafs. If the latter, or if passing a list of 2D {py:class}`xarray.DataArray`'s to {py:func}`pks.disp <peaks.core.GUI.disp_panels.disp.disp>`, all 2D scans are included in a data explorer view.\n", | ||
| "Interactive UIs for visualising and aligning data can be accessed by calling {py:func}`.disp <peaks.core.GUI.disp_panels.disp.disp>` on a 2D, 3D, or 4D {py:class}`xarray.DataArray`, or on a {py:class}`xarray.DataTree` containing either a single data entry, or on a tree with multiple leaves that each hold a 2D scan. If the latter, or if passing a list of 2D {py:class}`xarray.DataArray`'s to {py:func}`pks.disp <peaks.core.GUI.disp_panels.disp.disp>`, all 2D scans are included in a data explorer view.\n", |
There was a problem hiding this comment.
Thanks @shum23, sorry to be pedantic, but is this strictly correct yet? I think if we pass a DataTree containing multiple leaves, it will strip out all 2D ones to put into a 2D display panel. So there could be a structure with e.g. a mix of 2D, 3D, 4D, 1D arrays in a tree, and it would load all of the 2D ones into a single 2D viewer.
So should we say: "or on a tree with multiple leaves where at least one holds a 2D scan."
There was a problem hiding this comment.
Thanks @phrgab. Yea that's true. I've also just added a dispersion to the tree to double-check and it worked. Could have thought it through more but didn't since this was done during the beamtime - also just realised I had forgotten I'd created a branch from the issue already so I've ended up with two branches for this... I'll bin the extra one after this is merged.
now raises a proper error there
Fix #62