Skip to content

MAINT: Initializers Cleanup#2100

Open
rlundeen2 wants to merge 1 commit into
microsoft:mainfrom
rlundeen2:rlundeen2-cleanup-initializers
Open

MAINT: Initializers Cleanup#2100
rlundeen2 wants to merge 1 commit into
microsoft:mainfrom
rlundeen2:rlundeen2-cleanup-initializers

Conversation

@rlundeen2

Copy link
Copy Markdown
Contributor

Summary

Restructures pyrit/setup/initializers/ to be simpler, more consistent, and easier to navigate:

  • Move base class: PyRITInitializer now lives in pyrit/setup/ (out of initializers/).
  • Remove dead initializers: simple, airt, and the scenario objective_list.
  • New techniques/ subpackage: ScenarioTechniqueInitializerTechniqueInitializer, backed by a per-file get_technique_factories() protocol (core.py, extra.py). A tags parameter selects technique groups (core / extra / all).
  • Flatten the tree: load_default_datasets and preload_scenario_metadata move out of scenarios/, and scorers / targets move out of components/, up a level. Both subdirs are removed.
  • Dataset selection: LoadDefaultDatasets gains dataset_names and tags parameters so datasets can be selected by name or by metadata instead of always loading the scenario defaults.
  • Consumers, tests, and docs updated to the new module paths and names.

Note on breaking changes

These initializers are essentially configuration — they register default values into the various registries. The renames/removals here shouldn't require breaking-change handling for users.

Validation

  • Full unit suite green (10,045 passed, 121 skipped).
  • ruff check + ruff format clean; validate_docs passes.

Restructure pyrit/setup/initializers for clarity and consistency:

- Move the PyRITInitializer base class up to pyrit/setup/.
- Remove dead initializers (simple, airt, scenario objective_list).
- Add a techniques/ subpackage with TechniqueInitializer (renamed from
  ScenarioTechniqueInitializer) and a per-file get_technique_factories()
  protocol; a tags parameter selects technique groups (core/extra/all).
- Flatten load_default_datasets and preload_scenario_metadata out of the
  scenarios/ subdir, and add dataset_names/tags parameters to
  LoadDefaultDatasets so datasets can be selected by name or metadata.
- Flatten the components/ subdir (scorers, targets) up a level.
- Update consumers, tests, and docs to the new module paths and names.

These initializers are essentially configuration: they register defaults
into the various registries. The renames/removals here should not require
breaking-change handling for users.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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