Skip to content

V2 simplify#8

Merged
himjl merged 12 commits intov2from
v2-simplify
Mar 24, 2026
Merged

V2 simplify#8
himjl merged 12 commits intov2from
v2-simplify

Conversation

@himjl
Copy link
Copy Markdown
Owner

@himjl himjl commented Mar 24, 2026

Summary

This PR simplifies the package around the actual product surface: benchmark data loaders, feature-driven simulation, and learning statistics.

It removes mref from the core learning-model and dataset-loading paths, flattens the linear learner implementation, and makes local data caching explicit and repo-local by default.

What Changed

  • Flattened LinearLearner into hobj.learning_models and moved representation/update-rule modules to top-level hobj.learning_models.
  • Replaced learner-facing image typing with local ImageId typing in hobj/types.py.
  • Removed mref from learning-model code and tests.
  • Refactored image dataset loading into hobj.data_loaders.images and removed the old hobj.data.images path.
  • Reworked Imageset so it:
    • accepts cachedir: Path | None = None
    • defaults to repo-local data/
    • downloads/extracts assets directly without default_data_store
    • resolves local files by ImageId / Path instead of ImageRef
  • Reworked hobj/data_loaders/behavior.py to cache downloaded JSON locally without default_data_store.
  • Updated benchmark code to use the rewritten image/data loader interfaces.
  • Switched CI to uv in .github/workflows/ci.yml and added uv.lock.
  • Bumped supported Python to 3.12-only in pyproject.toml.

Why

The previous design exposed infrastructure abstractions like mref, ImageRef, and a global data store in places where the library really only needs:

  • stable image IDs
  • local cached benchmark data
  • feature lookup for simulation

This PR narrows the API around those real needs and reduces coupling across the package.

Impact

  • mref is no longer part of the core learning-model / data-loader workflow.
  • Code importing old hobj.data... image modules will need to switch to hobj.data_loaders....
  • Python 3.11 support is dropped; this branch targets Python 3.12.
  • Local dataset caching now defaults to data/ in the repo rather than the previous global cache/store path.

Validation

  • uv run pytest -q
  • Current local result: 4 passed

@himjl himjl merged commit 98a3c3a into v2 Mar 24, 2026
1 check passed
@himjl himjl deleted the v2-simplify branch March 24, 2026 23:52
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