-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add dtype property to arrays #1421
Comments
You are right, pyccel doesn't yet implement the pyccel/pyccel/ast/class_defs.py Line 136 in 3dec5c0
While you are waiting for someone to pick up this issue, as a temporary workaround you can use:
|
Remove the duplicate `_print_NumpyArray` function from PythonCodePrinter. The original `_print_NumpyArray` function is more accurate as it specifies the `dtype` etc explicitly. Specifying the `dtype` explicitly makes issue #1377 reproducible. To fix this problem support is added for `a.dtype` expressions (Fixes #1421) using the similar function [`np.result_type`](https://numpy.org/doc/stable/reference/generated/numpy.result_type.html). The initialisation dtype is saved and used in the Python printer. This is a work-around until #1334 is resolved well enough to define a clear issue. Additionally a warning is raised if the Python code is not consistent. Fixes #1377. **Additional commits** - Simplify bot linux/windows/macosx output to reduce duplication. Change regex for C now that the test is no longer verbose. - Stop generating `numpy.bool` in code as it has been deprecated by NumPy. Instead use the default bool (with precision `-1`). - Add support for NumPy's short type names. - Reduce duplication in the Python printer. - Remove outdated skips on tests. - Stop array error tests failing in developer mode.
Description
I try to create a numpy array with
np.zeros
with thedtype
given by another array. When I try to pyccelise this file pyccel return the issueAttribute dtype not found
.To Reproduce
Error details
Expected behavior
It should pyccelise it without crashing, I guess.
Language
Fortran
The text was updated successfully, but these errors were encountered: