Skip to content

Update handling of nargout#136

Merged
arokem merged 1 commit intoarokem:nargoutfrom
blink1073:pr/135
Feb 14, 2015
Merged

Update handling of nargout#136
arokem merged 1 commit intoarokem:nargoutfrom
blink1073:pr/135

Conversation

@blink1073
Copy link
Collaborator

I also changed the semantics of run_func a bit. You can now call built-in functions and pass a single argument that is not a dictionary. Here was my test case:

In [2]: from pymatbridge import Matlab

In [3]: m = Matlab();m.start()
Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge
Send 'exit' command to kill the server
.....MATLAB started and connected!
Out[3]: True

In [4]: res  = m.run_func('svd', np.array([[1,2],[1,3]]), nargout=3)

In [5]: U, S, V = res['result']

In [6]: U, S, V
Out[6]: 
(array([[-0.57604844, -0.81741556],
        [-0.81741556,  0.57604844]]), array([[ 3.86432845,  0.        ],
        [ 0.        ,  0.25877718]]), array([[-0.36059668, -0.93272184],
        [-0.93272184,  0.36059668]]))

This definitely warrants new test cases and some thought about to handle an array (list) of arguments or no arguments, but it definitely demonstrates the nargout behaviour`.

@blink1073
Copy link
Collaborator Author

The test suite passes with these changes.

@arokem
Copy link
Owner

arokem commented Feb 14, 2015

Yeah - looks good. Could you add your test-case to the test suite?

On Sat, Feb 14, 2015 at 8:48 AM, Steven Silvester notifications@github.com
wrote:

The test suite passes with these changes.


Reply to this email directly or view it on GitHub
#136 (comment)
.

@arokem arokem mentioned this pull request Feb 14, 2015
arokem added a commit that referenced this pull request Feb 14, 2015
Update handling of nargout
@arokem arokem merged commit 07faa76 into arokem:nargout Feb 14, 2015
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.

2 participants