Skip to content

[WIP] Implementation of compose module for Matlab tasks #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tclose
Copy link
Contributor

@tclose tclose commented Jun 23, 2025

Types of changes

  • New feature (non-breaking change which adds functionality)

Summary

Adds support for Matlab tasks, i.e. with the syntax

from pydra.compose import matlab

MyMatlabTask = matlab.define("""
x = function(a, b)
   ...
""")

Checklist

  • I have added tests to cover my changes (if necessary)
  • I have updated documentation (if necessary)

Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.83%. Comparing base (7fa412b) to head (e97aa12).

❗ There is a different number of reports uploaded between BASE (7fa412b) and HEAD (e97aa12). Click for more details.

HEAD has 19 uploads less than BASE
Flag BASE (7fa412b) HEAD (e97aa12)
23 4
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #833       +/-   ##
===========================================
- Coverage   88.46%   36.83%   -51.63%     
===========================================
  Files          86       65       -21     
  Lines       17964    11517     -6447     
  Branches     3504     1493     -2011     
===========================================
- Hits        15891     4242    -11649     
- Misses       1695     6847     +5152     
- Partials      378      428       +50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tclose
Copy link
Contributor Author

tclose commented Jun 23, 2025

Just a stub at this stage, but something someone could pick up and run with if they felt like it. Just need to implement 3 functions

  • parse_matlab_function: pull out function name, inputs and outputs (including parsing doc string) from function definition string
  • MatlabTask._run: execute the Matlab function and save the outputs to the working dir. Will probably need to execute some wrapping Matlab function that reads and writes the inputs to disk if they are matlab arrays instead of files
  • MatlabOutputs._from_job: finds the written data from disk and returns it in the MatlabOutputs structure

Additionally, it would be good be a argument passed to the matlab.define decorator, maybe called compile_to or something, that compiles the matlab function into an OCI image with a compiled version of the function and the Matlab compiler runtime, which could be pushed up to a docker registry using the hash of the task definition as the version tag.

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