Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:1
-
Epic Link:
-
Team:Data Release Production
-
Urgent?:No
Description
During one of the pair coding sessions with Jim Bosch and Dan Taranu, we found that afw.table.SourceCatalog executes `find` method assuming it is sorted without really checking if the catalog is sorted. This ticket will include an explicit check and raise an error if `find` is called on an unsorted catalog.
Instead of assuming that the catalog is always sorted, the updated find method first performs a binary search hoping that the catalog is sorted, and if unsuccessful, performs a brute-force linear search before declaring it unsuccessful. This fixes the bug of not finding record IDs for unsorted catalog, but fails slower for sorted catalogs.