Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Allow creating structured void scalars by passing dtype
Adds an optional `dtype=` kwarg to `np.void`. If given (and not None), this kwarg effectively turns it into: res = np.array(data, dtype=dtype)[()] Thanks for Marten's review and Bas' help with the typing. Reviewed-by: Marten van Kerkwijk <mhvk@astro.utoronto.ca> Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
158 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
``np.void`` now has a ``dtype`` argument | ||
---------------------------------------- | ||
NumPy now allows constructing structured void scalars directly by | ||
passing the ``dtype`` argument to ``np.void``. |
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