Developer Guide – ArchitectureΒΆ

This page gives a high-level overview of the internal design.

Intermediate Representation (IR)ΒΆ

All conversions flow through a dataclass-based IR:

  • Workflow β†’ Task β†’ ParameterSpec, RequirementSpec, etc.

  • Versioned JSON schema under wf2wf/schemas/v0.1/wf.json

  • Validation via jsonschema

Why IR?ΒΆ

  • Decouples importers/exporters

  • Enables round-trip testing

  • Central place for metadata handling and loss mapping

Code layoutΒΆ

wf2wf/
  core.py           # IR dataclasses & utils
  importers/        # Format β†’ IR
  exporters/        # IR β†’ Format
  environ.py        # Conda β†’ OCI pipeline
  loss.py           # Loss mapping helpers
  cli.py            # Typer/Click CLI

Adding a new engineΒΆ

  1. Implement importers/<engine>.py returning a Workflow instance.

  2. Implement exporters/<engine>.py consuming a Workflow.

  3. Register entry-points if distributing externally.

  4. Add tests & docs.