-
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
Test not failing consistently #1377
Labels
Comments
It passes due to the multiplication The generated code is:
|
yguclu
pushed a commit
that referenced
this issue
Aug 15, 2023
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
We can see here that the test
test_multi_return_array_scalar_op
is (occasionally) failing when converting to Python. In the link this occurs on Python 3.7 however looking at the commit history we can see that this does not occur systematically. As described below, the bug is expected. It is therefore concerning that the test does not fail every time. We should find out why this is the case before fixing the bugTo Reproduce
Provide code to reproduce the behavior:
Error details
Provide the generated code:
We see that the
dtype
is now set toint8
instead oftype(a)
. This is due to the poor handling of interfaces in the python translation as discussed in #802 and #1334. However the problem is avoidable here by propagating thePythonType
instance to the printer instead of replacing it with the type in the semantic stage.Expected behavior
Either the
PythonType
instance should be propagated to the printer instead of replacing it with the type in the semantic stage. Or if code duplication reduction is preferred then the test should be skipped with an appropriate reason.Language
Python
Acceptance criteria
The text was updated successfully, but these errors were encountered: