Skip to content
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

TypeError: 'numpy.ndarray' object is not callable matlab2python #4

Open
SDIdo opened this issue Nov 24, 2021 · 1 comment
Open

TypeError: 'numpy.ndarray' object is not callable matlab2python #4

SDIdo opened this issue Nov 24, 2021 · 1 comment
Labels
help wanted Extra attention is needed issue

Comments

@SDIdo
Copy link

SDIdo commented Nov 24, 2021

Dear ebranlard,
Thank you for making this amazing tool.
We have almost everything converted out-of-the-box with minor bearable changes.

Issue:
The recognizing of a matlab array or matrix is needed many times.
Matlab2Python, currently, doesn't recognize and thus takes slicing as a function call.
This probably makes it not recognize the index change that is needed as well.

Recreation:

test.m

x = [1:4,11:14];
y = x(1,1);
disp(y);

test.py

import numpy as np
x = np.array([np.arange(1,4+1),np.arange(11,14+1)])
y = x(1,1)
print(y)

y = x(1,1), at run, will cause the following error
TypeError: 'numpy.ndarray' object is not callable

Will be glad for a fix or a direction towards what to change in the code.

Best Regards,
SDido

@ebranlard
Copy link
Owner

Hi @SDIdo,

Sorry for the late reply. Thanks for reporting this and for your nice and simple example.

Those are indeed hard to parse... So far I've updated them manually.
I've been a bit away from this project for a while, so I wouldn't have any recommendations as to how to go about this. I would have to dive into the code, and possibly into the SMOP code. Your test case is definitely a good start.

@ebranlard ebranlard added the help wanted Extra attention is needed label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed issue
Projects
None yet
Development

No branches or pull requests

2 participants