-
Notifications
You must be signed in to change notification settings - Fork 96
Efficient Array Passing #103
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
Conversation
I'm still cleaning this up/getting tests to pass. |
All tests pass! |
I'd prefer this to the create-a-file approach, since it is all in memory, and does not require you to be on the same machine to share the data. |
I'm working on support for complex arrays, don't merge yet. |
All set! |
Sounds great. I will not have time to look at it before Monday, but I will On Saturday, January 17, 2015, Steven Silvester [email protected]
|
This was also an exercise in grokking the code base. FYI, my Matlab license expires in ~40 days. |
% | ||
% See also BASE64DECODE. | ||
|
||
% Author: Peter J. Acklam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think Peter is OK with us using his code? Did the original have a license attached to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://www.fourmilab.ch/webtools/base64/
"This software is in the public domain. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, without any conditions or restrictions. This software is provided “as is” without express or implied warranty. "
Go for it. |
Bottom line: array passing is 10X faster without using temporary files.
Uses base64 encoding to pass arrays between Matlab and Python using a similar method to
complex
. For Python, numeric-type arrays are converted to float64 and then passed as a dictionary. For Matlab, numeric arrays are converted to double and sent back as a structure.Also handles complex type arrays. Side benefit: arrays are now returned as ndarrays.