Analyze mworks on linux

Hi Chris,

It would convenient if I could analyze mworks files on linux (remote server). I’ve been piling up a lot of data and would like to automate the analysis on a remote linux server. I see precompiled libraries (python & matlab) for MacOSX only and was wondering if there is a way to run mworks analyses on linux?

Thanks,
Yoon

Hi Yoon,

The timing of your question is very good. Although this has been an open issue for a while now, I very recently added an officially-supported, pure-Python MWK2 reader to MWorks. It requires the msgpack package but otherwise has no dependencies outside of the Python standard library.

The module includes an MWKFile class that’s designed to be a drop-in replacement for mworks.MWKFile, the standard data analysis tool that, as you note, depends on macOS-only compiled code. If you want your analysis code to be compatible with both versions, import MWKFile like this:

try:
    from mworks.data import MWKFile
except ImportError:
    from mwk2reader import MWKFile

While I’d like to add a pure-MATLAB data file reader, too, the prospects for that don’t look so good, so I hope Python will work for you.

Cheers,
Chris

Hi Chris,

Thank you so much for providing support! It’s working well and gives me identical results from the OSX-compiled library. As a matter of fact, the pure-python MWK2 reader works well on both OpenMind & Mac environments (I haven’t found a case to use the try-catch exceptions yet).

Cheers,

Yoon

Hi Yoon,

Glad to hear the pure-Python reader works well. The only difference I’d expect between it and the compiled version is that the latter should be faster, which is why I suggested using try/except when importing. But if you find that the pure-Python version is fast enough, then certainly you can just use that.

Cheers,
Chris