Remove metadata interface#989
Open
mtauraso wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #989 +/- ##
==========================================
- Coverage 65.79% 65.63% -0.17%
==========================================
Files 85 85
Lines 8178 8113 -65
==========================================
- Hits 5381 5325 -56
+ Misses 2797 2788 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy dataset metadata-table interface (metadata() / metadata_fields()) from HyraxDataset and updates remaining call sites (notably visualize) and tests to rely on getter-based (get_*) / DataProvider field access instead.
Changes:
- Removed metadata-table plumbing from
HyraxDataset,InferenceDataset, andDataProvider, plus related config entries. - Updated multiple datasets to call the new
HyraxDataset.__init__(config)signature and added an explicitget_object_id()where needed. - Updated tests and
visualizeto avoid the removed metadata APIs.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/hyrax/test_inference_dataset.py | Removes metadata-ordering assertions now that metadata API is gone. |
| tests/hyrax/test_fits_image_dataset.py | Updates field assertions to use fields() rather than metadata_fields(). |
| tests/hyrax/test_downloaded_lsst_dataset.py | Switches metadata lookups to get_object_id(). |
| tests/hyrax/test_data_provider.py | Updates expectations after removing metadata plumbing from DataProvider. |
| src/hyrax/verbs/visualize.py | Replaces metadata API usage with per-index field fetching via DataProvider. |
| src/hyrax/hyrax_default_config.toml | Removes random-dataset metadata_fields config entry. |
| src/hyrax/datasets/random/hyrax_random_dataset.py | Drops metadata table construction and calls new super().__init__(config). |
| src/hyrax/datasets/lsst_dataset.py | Updates super().__init__ call and adds get_object_id(). |
| src/hyrax/datasets/kafka_stream_dataset.py | Updates super().__init__ call to new signature. |
| src/hyrax/datasets/inference_dataset.py | Removes metadata overrides. |
| src/hyrax/datasets/hsc_dataset.py | Fixes super().__init__ call to avoid positional arg confusion. |
| src/hyrax/datasets/fits_image_dataset.py | Removes metadata preparation and uses new super().__init__(config). |
| src/hyrax/datasets/dataset_registry.py | Removes metadata-table interface and simplifies HyraxDataset.__init__. |
| src/hyrax/datasets/data_provider.py | Removes metadata aggregation APIs/fields from DataProvider. |
| GETITEM_REFACTOR_PLAN.md | Adds design/implementation plan documenting the broader refactor direction. |
Comment on lines
+592
to
+598
| def _available_fields(self) -> set[str]: | ||
| """Return the set of all field names available across all datasets in the data provider.""" | ||
| all_fields = set() | ||
| for field_list in self.data_provider.fields().values(): | ||
| all_fields.update(field_list) | ||
| all_fields.add("object_id") | ||
| return all_fields |
Comment on lines
+600
to
+624
| def _fetch_fields(self, indices, fields) -> dict[str, list]: | ||
| """Fetch specific fields for a list of indices from the data provider. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| indices : list of int | ||
| Indices to fetch data for. | ||
| fields : list of str | ||
| Field names to extract. | ||
|
|
||
| Returns | ||
| ------- | ||
| dict[str, np.ndarray] | ||
| Mapping of field name to array of values across all indices. | ||
| """ | ||
| import numpy as np | ||
|
|
||
| result = {field: [] for field in fields} | ||
| primary_name = self.data_provider.primary_dataset | ||
| for idx in indices: | ||
| sample = self.data_provider[idx] | ||
| data = sample.get(primary_name, {}) | ||
| for field in fields: | ||
| result[field].append(data.get(field)) | ||
| return {field: np.array(values) for field, values in result.items()} |
| raw_filenames = fetched[self.filename_column_name] | ||
|
|
||
| filenames = [f.decode("utf-8") for f in raw_filenames] | ||
| filenames = [str(f) for f in raw_filenames] |
mtauraso
commented
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes the Metadata interface from datasets, Includes a quick fix to the only remaining consumer (visualizev1) so it uses the
get_interface for everything.