summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
authorEli Stevens <elis@doselab.com>2011-03-24 21:50:27 -0700
committerMark Wiebe <mwwiebe@gmail.com>2011-04-02 11:22:51 -0700
commitf9c7bde68655de06546f5c8dba30314888e409cc (patch)
tree50a68d8b895260ac905c5ef08020121849da6abd /numpy/core/_internal.py
parent65b77ee94131bf8365d8a6dba6fa19da1269339c (diff)
downloadnumpy-f9c7bde68655de06546f5c8dba30314888e409cc.tar.gz
ENH: Changes (and tests) to allow exporting half-floats through the buffer interface. (#1789)
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
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 67ca1716f..5298f412b 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -363,6 +363,7 @@ _pep3118_native_map = {
'L': 'L',
'q': 'q',
'Q': 'Q',
+ 'e': 'e',
'f': 'f',
'd': 'd',
'g': 'g',
@@ -388,6 +389,7 @@ _pep3118_standard_map = {
'L': 'u4',
'q': 'i8',
'Q': 'u8',
+ 'e': 'f2',
'f': 'f',
'd': 'd',
'Zf': 'F',