scipp / scippneutron

Neutron scattering toolkit built using scipp for Data Reduction. Not facility or instrument specific.
https://scipp.github.io/scippneutron/
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

`from_mantid` may fail during cleanup with workspace groups #470

Closed SimonHeybrock closed 3 weeks ago

SimonHeybrock commented 9 months ago

I encountered this when loading a ZOOM file, which has multiple periods. Apparently this is represented in Mantid as a workspace group. from_mantid then raised here:

https://github.com/scipp/scippneutron/blob/022555bd9b0529eb74b0374e22802f325d2aa9b4/src/scippneutron/mantid.py#L47-L49

I think it probably deleted the workspace group first, which also removed the children, so in the second loop iteration DeleteWorkspace raises ValueError.

Simple fix is to wrap it in a try/except, I don't know if we need more than that.