-
Type:
Bug
-
Status: Done (View Workflow)
-
Priority:
Normal
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:
`drp_stella` and `datamodel` see the error on `w.2023.30`, `w.2023.30a`, and `w.2023.31`. It was working with `w.2023.29`.
The overloaded method `findWavelength` no longer accepts numpy arrays when there is more than one element in the array.
I've attached a minimal working example script but the following is an example:
# Works correctly DetectorMap.findWavelength(1, 340) DetectorMap.findWavelength(np.array([1]), 340) DetectorMap.findWavelength(2, np.array([341])) DetectorMap.findWavelength(np.array([2]), np.array([341])) # Overload error DetectorMap.findWavelength(np.array([1, 2]), np.array([340])) DetectorMap.findWavelength(np.array([1]), np.array([340, 341])) DetectorMap.findWavelength(np.array([1, 2]), np.array([340, 341]))
Edit: error message:
1: 649.9656811860972 Traceback (most recent call last): File "test-db-findWavelength.py", line 23, in <module> print('2: ', detector_map_used.findWavelength(1, np.array([340, 341]))) # Fails TypeError: findWavelength(): incompatible function arguments. The following argument types are supported: 1. (self: pfs.drp.stella.DetectorMap.DetectorMap, fiberId: int, row: float, throwOnError: bool = False) -> float 2. (self: pfs.drp.stella.DetectorMap.DetectorMap, fiberId: int, row: numpy.ndarray) -> numpy.ndarray 3. (self: pfs.drp.stella.DetectorMap.DetectorMap, fiberId: numpy.ndarray, row: numpy.ndarray) -> numpy.ndarray 4. (self: pfs.drp.stella.DetectorMap.DetectorMap, arg0: int, arg1: numpy.ndarray) -> numpy.ndarray 5. (self: pfs.drp.stella.DetectorMap.DetectorMap, arg0: numpy.ndarray, arg1: numpy.ndarray) -> numpy.ndarray Invoked with: <pfs.drp.stella.DoubleDetectorMap.DoubleDetectorMap object at 0x7ff1c5d96430>, 1, array([340, 341])