Skip to content

flepimop2-op_engine: options-surface parity with flepimop2-op_system + jax extra #68

Description

@jc-macdonald

Summary

Bring flepimop2-op_engine's options surface up to parity with flepimop2-op_system's, and add a jax optional extra, so op_engine's new diffrax/lineax-backed CoreSolver methods (#67) and sparse/dense implicit-solve dispatch (#69) can actually be wired up through the flepimop2 provider the same way COVID19_USA's diffrax_engine.py is wired up today.

Current state (confirmed by direct comparison)

flepimop2-op_system's OpSystemSystem (flepimop2-op_system/src/flepimop2/system/op_system/__init__.py) compiles the spec once and publishes a rich self.options surface — 23 keys, including pytree_stepper_fn, block_pytree_stepper_fn, history_stepper_fn, body_eval_fn, block_history_stepper_fn, block_body_eval_fn, factorize_axes, block_axes, template_shapes — read via stepper.option(name, default). This is exactly the contract COVID19_USA's diffrax_engine.py depends on.

flepimop2-op_engine's OpEngineFlepimop2Engine (flepimop2-op_engine/src/flepimop2/engine/op_engine/__init__.py) is an EngineABC (consumer role, not a SystemABC) and today only ever reads 4 option keys off whatever system it's given — operators, jacobian, operator_axis, mixing_kernels — and only ever calls the plain bound stepper() (flat/scalar eval_fn path). It never touches pytree_stepper_fn, history_stepper_fn, body_eval_fn, or any block-axis variant. If op_engine were pointed at an op_system-compiled spec today, it would silently use only the scalar path and none of the vectorized/history machinery.

Structural drift beyond scope, noted for awareness (not necessarily to fix in this issue): the two adapters declare their module identity differently (OpSystemSystem's module="..." class-declaration kwarg vs OpEngineFlepimop2Engine's module: Literal[...] Pydantic field), and their pyproject.tomls have diverged in dependency style (op-system>=0.2.0 registry pin vs op-engine @ git+...@main direct git pin) and version (0.2.0 vs 0.1.0).

Scope

Acceptance criteria

  • flepimop2-op_engine can drive a diffrax-backed CoreSolver solve using pytree_stepper_fn/history_stepper_fn/body_eval_fn/block-axis options from an op_system-compiled spec, exercised by a test analogous to COVID19_USA's own coverage.
  • Existing SciPy-CoreSolver-backed behavior is unchanged (this is additive, not a replacement of the existing 4-key read path).
  • just quality and just test pass for both provider packages.

Relationship to other issues

Depends on #67 (needs the diffrax-backed methods to exist before the provider can wire them up) and #69 (needs the sparse/dense implicit-solve dispatch for full method coverage) — can be scoped/designed in parallel but the "use them" acceptance criterion is blocked on both landing. See #26 for the overall tracking issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestproviderflepimop2 provider/connector package

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions