Skip to content
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

Override catalog's __len__ method #429

Merged
merged 6 commits into from
Oct 8, 2024

Conversation

camposandro
Copy link
Collaborator

@camposandro camposandro commented Oct 8, 2024

Override the built-in __len__ method to provide the number of rows for unmodified catalogs. I also added docstrings on query and dropna for better clarity (they existed in the base class but not in Catalog). Closes #404.

@camposandro camposandro self-assigned this Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

Before [c478401] After [13442d8] Ratio Benchmark (Parameter)
failed failed n/a benchmarks.time_box_filter_on_partition
93.0±0.8ms 95.3±1ms 1.02 benchmarks.time_kdtree_crossmatch
27.7±0.7ms 28.3±0.4ms 1.02 benchmarks.time_polygon_search
12.0±0.01s 11.7±0.02s 0.97 benchmarks.time_create_large_catalog
1.80±0.02s 1.75±0.01s 0.97 benchmarks.time_create_midsize_catalog

Click here to view all benchmarks.

@camposandro camposandro changed the base branch from main to development October 8, 2024 16:27
@camposandro camposandro force-pushed the issue/404/catalog-len-method branch from 0ba68b1 to 6ca27bb Compare October 8, 2024 19:42
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.94%. Comparing base (0e38536) to head (9f7cceb).

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #429      +/-   ##
===============================================
+ Coverage        97.87%   97.94%   +0.07%     
===============================================
  Files               44       44              
  Lines             1553     1560       +7     
===============================================
+ Hits              1520     1528       +8     
+ Misses              33       32       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@camposandro camposandro merged commit 76e2af4 into development Oct 8, 2024
10 checks passed
@camposandro camposandro deleted the issue/404/catalog-len-method branch October 8, 2024 20:36
camposandro added a commit that referenced this pull request Oct 22, 2024
* Bump pre-commit-ci/lite-action from 1.0.2 to 1.0.3

Bumps [pre-commit-ci/lite-action](https://github.com/pre-commit-ci/lite-action) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/pre-commit-ci/lite-action/releases)
- [Commits](pre-commit-ci/lite-action@v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: pre-commit-ci/lite-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update number of positional args

* Run CI on development branch

* update hipscat target

* WIP: sketching out from_lists

* Override catalog's `__len__` method (#429)

* Wrap catalog's length method

* Invalidate number of rows for all catalog operations

* Clarify error message

* change to nest_lists

* change to nest_lists

* implement at healpix_dataset level

* WIP: sketching out from_lists

* change to nest_lists

* change to nest_lists

* implement at healpix_dataset level

* main test written

* wrap reduce healpix_dataset.py

* wrap in catalog

* update signature to match

* unit test

* isort

* wip

* add reduce append_columns

* add append_columns test

* add docstring

* add unit test

* pr

* isort

* main test

* lint fix

* test compute

* Explode kwargs for ra and dec in from_dataframe (#437)

* use alignment moc in crossmatched/joined catalogs

* remove unused import

* update docs hipscat branch

* Fix unit test

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean McGuire <seanmcgu@andrew.cmu.edu>
Co-authored-by: Sean McGuire <123987820+smcguire-cmu@users.noreply.github.com>
Co-authored-by: Doug Branton <brantd@uw.edu>
Co-authored-by: Doug Branton <dougrbranton@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add len support for unmodified catalogs
2 participants