Skip to content

Mtauraso/alt dataset#963

Draft
mtauraso wants to merge 2 commits into
mainfrom
mtauraso/alt-dataset
Draft

Mtauraso/alt dataset#963
mtauraso wants to merge 2 commits into
mainfrom
mtauraso/alt-dataset

Conversation

@mtauraso

Copy link
Copy Markdown
Member

Change Description

Solution Description

Code Quality

  • I have read the Contribution Guide and agree to the Code of Conduct
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.93103% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.87%. Comparing base (0f9cee0) to head (7fb45de).

Files with missing lines Patch % Lines
src/hyrax/datasets/data_provider.py 78.12% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #963      +/-   ##
==========================================
- Coverage   64.87%   64.87%   -0.01%     
==========================================
  Files          82       82              
  Lines        7909     7905       -4     
==========================================
- Hits         5131     5128       -3     
+ Misses       2778     2777       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


# Instantiate the dataset class
dataset_cls = fetch_dataset_class(dataset_class)
dataset_instance = dataset_cls(config=dataset_specific_config, data_location=data_location)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think augment, rng, and caching can all maybe just be moved into this constructor if we pass appropriate config along.

However this would mean config other than the dataset-specific part of the data request would get passed in as "dataset config" which is already this weird amalgum.

I think we hit two birds with one stone here:

  • HyraxDataset gets an initialize which receives various config elements and essentially does init like things that are split in this diff between HyraxDataset.__init__ and this preparation function.
  • We remove the requirement on the dataset author to call super.__init__(config) Their init just always runs before Hyrax's stuff, because we call our initializer here.

We're less brittle to Dataset implementation errors, and DataProvider is more focused on the parts of hyrax that truly cross dataset boundaries (joins, collation, etc) and less of a grab bag of everything related to data handling.

# Ensure the class is in the registry so the config system can find it
update_registry(DATASET_REGISTRY, cls.__name__, cls)

def metadata_fields(self) -> list[str]:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably time for metadata to truly die and be completely removed from the codebase.

tensorboardx_logger.log_duration_ts(f"{prefix}/cache_miss_s", start_time)
else:
tensorboardx_logger.log_duration_ts(f"{prefix}/cache_hit_s", start_time)
tensorboardx_logger.log_duration_ts(f"{prefix}/resolve_data_s", start_time)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to bring back cache_hit_s and cache_miss_s and their augment counterparts.

This probably means datasets will end up needing a tensorboardx_logger somehow.

@mtauraso mtauraso self-assigned this Jun 29, 2026
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.

1 participant