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

wrong handling of array indexing #15

Open
SaschaRienaecker opened this issue Mar 3, 2023 · 1 comment
Open

wrong handling of array indexing #15

SaschaRienaecker opened this issue Mar 3, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@SaschaRienaecker
Copy link

First of all, thank you for this nice project.
When I try to convert the following lines,

  x = zeros(4,4)
  y = x(1,:)

I get a python output which is obviously wrong

import numpy as np
x = np.zeros((4,4))
y = x(1,:)

since x is an array and should be indexed using [ ] brackets and python indexing starting from 0.
Is there an easy way to fix? This would be very helpful.

@ebranlard
Copy link
Owner

ebranlard commented Mar 3, 2023

Hi @SaschaRienaecker
Unfortunately this is one of the greatest limitation.. There might be a way to somehow figuring out, based on context, which object is a variables and which is a function. If you are well versed in python, you can try diving into the code and come up with a suggestion? Even if it only works for the case with a "zeros" or "ones" initialization, it would still be useful.
Thanks a lot!

The issue is the same as #4

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

No branches or pull requests

2 participants