Ulm-IQO / qudi

(Legacy project) A modular laboratory experiment management suite, predecessor to qudi-core.
GNU General Public License v3.0
165 stars 140 forks source link

Handle the case of an ROI with only one POI. #708

Closed nbeaver closed 1 year ago

nbeaver commented 1 year ago

This allows the POI manager to load an ROI file with a single POI.

Description

Add the ndmin argument to loadtxt to ensure the shape is correct even when there is only one POI to load. Previously the resulting shape for poi_names was () and for poi_coords was (3,), but with the fix it now has the correct shapes (1,) and (1, 3).

Motivation and Context

Currently, the POI manager will fail with an IndexError when attempting to load an ROI with a single ROI since loadtxt defaults to squeezing the dimensions.

How Has This Been Tested?

I have tested it manually by loading an ROI with a single POI.

Types of changes

Checklist:

timoML commented 1 year ago

I can confirm the bug and the fix looks fine. @nbeaver Do you want to contribute this to qudi-iqo-modules as an PR as well? Alternatively, I can also push your fix there but this would drop your credit.