-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean PythonCodePrinter and add dtype property (#1260)
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.
- Loading branch information
1 parent
564974c
commit 3964466
Showing
14 changed files
with
506 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.