Details
-
Type:
Improvement
-
Status: Won't Fix
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Story Points:0
-
Epic Link:
-
Team:Data Release Production
Description
While Fred Moolekamp was chasing the errors in DM-29907, it was realized that `afwTable.SourceCatalog` forbids getting children if the catalog is unsorted. In checking if the catalog is sorted, it performs an operation that is O( n), which is as expensive as fetching the children even from an unsorted catalog. Moreover, this check is performed for each parent, thereby making getting the children for all parents an O(n^2) operation. However, it is desirable to check (somewhere, once) if the catalog is sorted, as "unsortedness" could indicate a potentially serious problem elsewhere. This ticket captures potential solutions, and discussions made towards that on Slack.
I think I've fixed it now. There was a logic bug in the `subset` method `references.py` file that caused children sources that are outside of the bounding box also to be returned. The fix is fairly simple and pushed it in the same branch. Since the fix is simple, I don't know if it can be in the same ticket or has to come from another ticket necessarily because the PR was reverted.