Skip to content

Call read_hats for spatial filters on unaltered catalogs #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
camposandro opened this issue Apr 5, 2025 · 1 comment
Open

Call read_hats for spatial filters on unaltered catalogs #691

camposandro opened this issue Apr 5, 2025 · 1 comment
Assignees
Labels
performance For slow queries or compute bottlenecks

Comments

@camposandro
Copy link
Collaborator

Users often perform spatial filters after a read_hats call where the search_filter was not specified.

E.g. this:

# path 1
cat = lsdb.read_hats(...)
cat = cat.cone_search(...)

instead of:

# path 2
from lsdb.core.search import ConeSearch
cat = lsdb.read_hats(..., search_filter=ConeSearch(...))

If the user goes for "path 1" we should call read_hats again (on behalf of the user), to apply the search filter as in "path 2". We should do this on Catalog.search and only if the catalog is UNALTERED. We cannot forget to pass the remaining args and kwargs used on the user's initial read_hats call.

@camposandro
Copy link
Collaborator Author

We currently set the total_rows of a catalog to zero on the _create_updated_dataset method. Checking if the total rows is greater than zero could be enough to check if the catalog is unaltered.

@nevencaplar nevencaplar added this to the Data Preview 1 milestone Apr 25, 2025
@nevencaplar nevencaplar moved this to Suggested To Do in HATS / LSDB May 1, 2025
@smcguire-cmu smcguire-cmu self-assigned this May 1, 2025
@nevencaplar nevencaplar moved this from Suggested To Do to To Do in HATS / LSDB May 1, 2025
@nevencaplar nevencaplar added the performance For slow queries or compute bottlenecks label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance For slow queries or compute bottlenecks
Projects
Status: To Do
Development

No branches or pull requests

3 participants