Skip to content

Simplify running projects which have Matlab custom models for users. #181

@arwelHughes

Description

@arwelHughes

It has not proven to be possible to run Matlab custom models in pythonRAT with the performance of running the Matlab version (and vice versa). The advice therefore to users is to run with matlabRAT where they have Matlab custom models. Currently, all existing RasCAL users have Matlab custom models, but are forced to use pythonRAT when using the GUI, which is likely to be highly detremental to the uptake of the new software in the short to medium term.

When installing pythonRAT with the Matlab option, we always have a Matlab session available to pythonRAT, and so it would simplify things greatly for users if we just use this to run matlabRAT for them in a seamless way.

A basic example of how this can be done is available here: https://github.com/arwelHughes/RAT_fork/blob/pyRunner/pyRunner/matlab_rat.py

When this is run it:

  • Saves the project class and controls class to jsons.
  • Calls a matlab function in a Matlab engine (https://github.com/arwelHughes/RAT_fork/blob/pyRunner/pyRunner/runFromPython.m) which (a) Loads these jsons into Matlab. (b) Runs the Matlab version of RATmain.mex. (c) Saves the results of the run to jsons (c) Passes control back to Python (d) Loads the results jsons and sends these back to the user.

In the example we start a new Matlab engine, but this could be done quite easily with the existing engine in pythonRAT. What's missing is the processing of events, but it should be possible to divert the even output on the Matlab side to a file, and to have a file uptate listener on the Python side to deal with this.

Having this capability in pythonRAT would then open up the possibility of doing this as required from the GUI, giving Matlab custom file users (which at present is basically everybody!) GUI support, which is currently absent.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions