Skip to content

feat(workcell): migrate scheduler config to Pydantic ImportString#346

Open
Btate712 wants to merge 1 commit into
AD-SDL:mainfrom
Btate712:feature/importstring-plugin-config
Open

feat(workcell): migrate scheduler config to Pydantic ImportString#346
Btate712 wants to merge 1 commit into
AD-SDL:mainfrom
Btate712:feature/importstring-plugin-config

Conversation

@Btate712

@Btate712 Btate712 commented May 29, 2026

Copy link
Copy Markdown

PR Info

Partially closes #340 (scheduler half; the `event_handlers` half is blocked on #312)

Replaces `scheduler: str` + `importlib.import_module()` with Pydantic's `ImportString` type in `WorkcellManagerSettings`, so misconfigured scheduler paths are caught at startup rather than when the engine first initializes.

The new preferred format is `module:ClassName` (e.g. `madsci.workcell_manager.schedulers.default_scheduler:Scheduler`), removing the implicit convention that the scheduler class must be named `Scheduler`. Old bare-module strings are still accepted for one release cycle and emit a `DeprecationWarning`. The now-unnecessary `import importlib` is removed from `workcell_engine.py` and the 3-line scheduler instantiation collapses to a single call.

Developer Checklists

I have:

  • Run Pre-commit and Unit Tests, and ensured that they pass
  • Created or updated documentation relevant to your change - I didn't add documentation because I felt it wasn't warranted for this change. I can add it if desired.
  • Created or updated unit tests relevant to your change

Replace the raw string + importlib.import_module pattern with Pydantic's
ImportString type, so import errors are caught at settings parse time
(startup) rather than when the engine first initializes.

The new preferred format is 'module:ClassName' (e.g.
'madsci.workcell_manager.schedulers.default_scheduler:Scheduler'),
which removes the implicit convention that the class must be named
Scheduler. Old bare-module strings are still accepted for one release
cycle and emit a DeprecationWarning.

Closes AD-SDL#340 (scheduler half; event_handlers half blocked on AD-SDL#312)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Btate712 Btate712 marked this pull request as draft May 29, 2026 23:56
@Btate712 Btate712 changed the title feat(workcell): migrate scheduler config to Pydantic ImportString [DRAFT] feat(workcell): migrate scheduler config to Pydantic ImportString May 29, 2026
@Btate712 Btate712 changed the title [DRAFT] feat(workcell): migrate scheduler config to Pydantic ImportString feat(workcell): migrate scheduler config to Pydantic ImportString May 30, 2026
@Btate712 Btate712 marked this pull request as ready for review May 30, 2026 00:01
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.

Plugin loading: migrate Scheduler + EventHandler config to Pydantic ImportString

1 participant