Add methods to retrieve partition file paths and memory estimates #1085
+375
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds three new methods to the
HealpixDatasetclass to provide visibility into memory usage and file paths for catalog partitions, addressing issue #1083.Problem
When preparing to pull data from a catalog, especially a remotely located one, users need to:
Previously, this information was not accessible via the
Catalogobjects.Solution
New Methods
1.
get_partition_file_paths()Returns a dictionary mapping HEALPix pixels to their underlying Parquet file paths.
2.
get_partition_metadata()Returns a DataFrame with detailed metadata for each partition including file path, total compressed size, and per-column sizes.
3.
get_memory_estimate(include_index=False)Provides an upper bound estimate of memory usage for the currently loaded columns and partitions.
The estimate:
Use Case Example
Implementation Details
Testing
tests/lsdb/catalog/test_memory_estimate.pyDocumentation
docs/reference/catalog_inspection.rstdocs/tutorials/performance.rstBenefits
Closes #1083
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.