sot / mica

Microscope on Chandra aspect
https://sot.github.io/mica
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Fix issue in vectorized get_dark_cal_id #274

Closed javierggt closed 2 years ago

javierggt commented 2 years ago

Description

This fixes a bug found in regression testing. get_dark_cal_id is vectorized using np.vectorize. When the input is a scalar, it returns a numpy scalar, but that is a numpy array with shape (). This has overloaded the bracket operators, so you can't call the bracket operators on the result. The solution is to return a scalar of the dtype's type.

Interface impacts

None

Testing

mica unit tests and sparkles tests pass (including a new test for this)

Unit tests

Independent check of unit tests by [REVIEWER NAME]

Functional tests