Skip to content

Comments

lazy import datasets#794

Merged
willccbb merged 2 commits intomainfrom
will/defer-datasets
Jan 28, 2026
Merged

lazy import datasets#794
willccbb merged 2 commits intomainfrom
will/defer-datasets

Conversation

@willccbb
Copy link
Member

@willccbb willccbb commented Jan 28, 2026

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Shifts datasets imports to be lazy to reduce import-time overhead and optionalize the dependency in most code paths. Also tightens typing and forward references.

  • Convert top-level datasets imports to TYPE_CHECKING stubs or local imports within functions/methods (e.g., EnvGroup.__init__, Environment.generate, data_utils.load_example_dataset, eval_utils.make_dataset/quiet_datasets, display_utils.BaseDisplay.start/stop)
  • Add from __future__ import annotations broadly and change DatasetBuilder to a TypeAlias string; minor typing cleanups
  • Update pyproject.toml to include numpy in dependencies

Written by Cursor Bugbot for commit 4186897. This will update automatically on new commits. Configure here.

@willccbb willccbb merged commit 0e6603e into main Jan 28, 2026
6 checks passed
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