Code Monkey home page Code Monkey logo

Comments (5)

blink1073 avatar blink1073 commented on August 19, 2024

Hi @arnodelorme, the reason we use files is that for large data we'd run into transmission issues over the pipe.

from oct2py.

arnodelorme avatar arnodelorme commented on August 19, 2024

Ah, OK, but the code above is more of a buffer than a pipe. It is subject to out-of-memory errors, though. Still, I think for large arrays or structures, it could speed read/write up to 1000 compared to storing on HDD (spinning disks).

from oct2py.

blink1073 avatar blink1073 commented on August 19, 2024

You are welcome to explore it, I don't have the bandwidth anymore to do anything more than light maintenance on oct2py.

from oct2py.

arnodelorme avatar arnodelorme commented on August 19, 2024

OK, thank you for taking, at least, the time to respond. I might do some tests and issue a pull request (would just be an option, not the default, which works quite well).

Another issue I have encountered is that data access is different from accessing the HDF5 data directly. An Octave structure such as var.('test')(3).('test2') =1 (or var.test(3).test2 = 1), if I load the HDF5, directly, and convert mat structures to dictionaries, I would get something similar in Python

var['test'][2]['test2']

However, in Oct2py, I would need to use

var['test']['test2'][2,0]

Is there a way to use Oct2py with the original scipy.io.matlab._mio5_params.mat_struct object instead of the Struct Oct2py object? I am maintaining a large open-source Octave-compatible MATLAB project (EEG analysis +300k downloads) and would like Python users to be able to call the MATLAB functions. However, I would also like to have Python-optimized routines and Python users to access the data structures in a way that is natural in Python. So ideally, the Python data structures would not rely on external tools (only dictionaries, lists, and numpy arrays). They would look more like solution 1 above than solution 2.

BTW, of all of the methods I have tried to interface MATLAB with Python, Oct2py is the best. MATLAB code compilation into Python is pathetic (structure conversion is not supported, you can only pass on numerical arrays -- and the MATLAB runtime engine is a beast compared to the Octave one).

from oct2py.

blink1073 avatar blink1073 commented on August 19, 2024

I might do some tests and issue a pull request (would just be an option, not the default, which works quite well).

Yes, I agree making it an option would be ideal.

Is there a way to use Oct2py with the original scipy.io.matlab._mio5_params.mat_struct object instead of the Struct Oct2py object?

This could be made an option as well I believe. The marshal/unmarshal logic was especially tricky, particularly around cells/structs.

from oct2py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.