Skip to content

Conversation

Copy link

Copilot AI commented Nov 16, 2025

Implements Python bindings as a subset of the JS/TS codebase following the pattern from mat3ra-mode#66. The implementation uses Pydantic v2 models and integrates with the mat3ra ecosystem (esse, mode, ade, utils).

Changes

Core Data Models

  • Enums for UnitType, UnitStatus, UnitTag, WorkflowStatus
  • BaseUnit with 9 concrete implementations (Execution, Assignment, IO, Map, Reduce, Condition, Assertion, Processing, Subworkflow)
  • Subworkflow for logical unit collections with application/model config
  • Workflow for complete computational workflows

Dependencies

  • Added mat3ra-esse, mat3ra-mode, mat3ra-ade, mat3ra-utils
  • Added pydantic >=2.0.0 for data validation

Technical Details

  • Pydantic v2 ConfigDict with field aliases for _idid mapping
  • Literal types for unit type constants
  • Compatible with ESSE workflow schemas
  • 17 files, ~450 LOC

Usage

from mat3ra.wode import Workflow, ExecutionUnit, UnitType, UnitStatus

# Create workflow components
unit = ExecutionUnit(
    name="scf_calculation",
    application={"name": "espresso", "version": "6.3"}
)

workflow = Workflow(
    name="DFT Calculation",
    properties=["total_energy"],
    units=[unit.model_dump()]
)

Testing

  • 16 test cases covering all unit types and workflow classes
  • JS tests remain passing
Original prompt

Implement Python codebase as a subset of the JS/TS codebase and similar to the implementation for mode in https://github.com/Exabyte-io/mode/pull/66/files, specifically:

  • use data structures / pydantic types from mat3ra-esse when available
  • use other mat3ra-* libraries when available: mat3ra-mode, mat3ra-ade, mat3ra-utils, etc.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Nov 16, 2025
Copilot AI and others added 2 commits November 16, 2025 23:17
Co-authored-by: timurbazhirov <721112+timurbazhirov@users.noreply.github.com>
Co-authored-by: timurbazhirov <721112+timurbazhirov@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Python codebase as a subset of JS/TS codebase Implement Python codebase using Pydantic and mat3ra-* libraries Nov 16, 2025
Copilot AI requested a review from timurbazhirov November 16, 2025 23:23
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.

2 participants