Ticket #1789: Support half floats via buffer interface #68
+32
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes (and tests) to allow exporting half-floats through the buffer interface.
Code:
Added NPY_HALF to switch (descr->type_num) in _buffer_format_string.
Added 'e' keys to the _pep3118_native_map and _pep3118_standard_map.
Tests:
Added entries to the generic round-trip tests.
Added specialized half-float test that round-trips example values from the wikipedia page.
http://en.wikipedia.org/wiki/Half_precision_floating-point_format
http://mail.scipy.org/pipermail/numpy-discussion/2011-March/055795.html
http://projects.scipy.org/numpy/ticket/1789