Skip to content

Better loader discovery#35

Merged
JamesMcClung merged 19 commits into
mainfrom
better-loader-discovery
May 1, 2026
Merged

Better loader discovery#35
JamesMcClung merged 19 commits into
mainfrom
better-loader-discovery

Conversation

@JamesMcClung
Copy link
Copy Markdown
Owner

All loaders are responsible for discovering which prefixes they can open within a given directory. These declarations are passed to the argparse prefix choices. This system replaces a hack introduced in #33 to register prt.bp prefixes specifically. Also, make Loader an intermediate ABC, below DataSource.

JamesMcClung and others added 18 commits May 1, 2026 08:53
Add abstract discover() classmethod to DataSource and concrete
implementations on FieldLoaderBp, ParticleLoaderBp, ParticleLoaderH5.
Not yet wired into the parser — Task 2 switches the registry over.

Co-Authored-By: Claude <noreply@anthropic.com>
Switch LOADERS from prefix-keyed dict to list of loader classes plus a
discover_all(data_dir) function that polls each loader's discover()
classmethod. Loader decorators become bare @loader. parse.py's bespoke
discover_particle_bp_loaders import + the FIXME hack go away — the
particle BP loader is now uniform with the others. args.py exposes
the constructed loader as args.loader. Test fixtures using the
internal _get_parser API updated to match the new tuple return shape.

Co-Authored-By: Claude <noreply@anthropic.com>
@JamesMcClung JamesMcClung added the refactor Internal simplifications or generalizations label May 1, 2026
@JamesMcClung JamesMcClung merged commit 7f60385 into main May 1, 2026
2 checks passed
@JamesMcClung JamesMcClung deleted the better-loader-discovery branch May 1, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Internal simplifications or generalizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant