Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-29737

Check if a SourceCatalog is sorted when calling `find`

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • afw
    • None

    Description

      During one of the pair coding sessions with jbosch and dtaranu, 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.

      Attachments

        Issue Links

          Activity

            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.

            kannawad Arun Kannawadi added a comment - 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.
            kannawad Arun Kannawadi added a comment - Jenkins run:  https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/34014/pipeline

            Thanks for the super quick review Jim. I'll merge it to master once the Jenkins run is successfully complete.

            kannawad Arun Kannawadi added a comment - Thanks for the super quick review Jim. I'll merge it to master once the Jenkins run is successfully complete.

            People

              kannawad Arun Kannawadi
              kannawad Arun Kannawadi
              Jim Bosch
              Arun Kannawadi, Jim Bosch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.