[PIPE2D-1078] Improve error message from PfsDesign.selectFIber Created: 17/Sep/22 Updated: 05/Oct/22 Resolved: 05/Oct/22 |
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Normal |
| Reporter: | rhl | Assignee: | price |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Reviewers: | hassan |
| Description |
|
Please improve the error message when a request fiberId is not present
File ~/PFS/datamodel/python/pfs/datamodel/pfsConfig.py:820, in PfsDesign.selectFiber(self, fiberId)
803 """Select fiber(s) by fiber identifier
804
805 Returns the indices for the provided fiber identifiers.
(...)
817 Indices for fibers.
818 """
819 result = np.nonzero(np.isin(self.fiberId, fiberId))[0]
--> 820 return result.item() if np.isscalar(fiberId) else result
ValueError: can only convert an array of size 1 to a Python scalar
|
| Comments |
| Comment by hassan [ 05/Oct/22 ] |
|
Suggested change in https://github.com/Subaru-PFS/datamodel/pull/103 to provide a clearer error message is fine. |
| Comment by price [ 05/Oct/22 ] |
|
Merged. |