Skip to content

Commit

Permalink
fix for predefine type - issue #40
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Mar 9, 2015
1 parent 1fa8949 commit 91f85b3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions docs/Types/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Predefined Types
Predefined types are base integer and floating point types that are identified via
one of the following strings:

* ``H5T_STD_UI8{LE|BE}``: a one byte unsigned integer
* ``H5T_STD_U8{LE|BE}``: a one byte unsigned integer
* ``H5T_STD_I8{LE|BE}``: a one byte signed integer
* ``H5T_STD_U16{LE|BE}``: a two byte unsigned integer
* ``H5T_STD_U6{LE|BE}``: a two byte unsigned integer
* ``H5T_STD_I16{LE|BE}``: a two byte signed integer
* ``H5T_STD_U32{LE|BE}``: a four byte unsigned integer
* ``H5T_STD_I32{LE|BE}``: a four byte signed integer
Expand Down
16 changes: 8 additions & 8 deletions server/hdf5dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ def getBaseType(dt):

predefined_int_types = {
'int8': 'H5T_STD_I8',
'uint8': 'H5T_STD_UI8',
'uint8': 'H5T_STD_U8',
'int16': 'H5T_STD_I16',
'uint16': 'H5T_STD_UI16',
'uint16': 'H5T_STD_U16',
'int32': 'H5T_STD_I32',
'uint32': 'H5T_STD_UI32',
'uint32': 'H5T_STD_U32',
'int64': 'H5T_STD_I64',
'uint64': 'H5T_STD_UI64'
'uint64': 'H5T_STD_U64'
}
predefined_float_types = {
'float32': 'H5T_IEEE_F32',
Expand Down Expand Up @@ -244,13 +244,13 @@ def getBaseType(dt):
def getNumpyTypename(hdf5TypeName, typeClass=None):
predefined_int_types = {
'H5T_STD_I8': 'i1',
'H5T_STD_UI8': 'u1',
'H5T_STD_U8': 'u1',
'H5T_STD_I16': 'i2',
'H5T_STD_UI16': 'u2',
'H5T_STD_U16': 'u2',
'H5T_STD_I32': 'i4',
'H5T_STD_UI32': 'u4',
'H5T_STD_U32': 'u4',
'H5T_STD_I64': 'i8',
'H5T_STD_UI64': 'u8'
'H5T_STD_U64': 'u8'
}
predefined_float_types = {
'H5T_IEEE_F32': 'f4',
Expand Down
8 changes: 4 additions & 4 deletions test/integ/datasettest.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,9 @@ def testPostTypes(self):
root_uuid = helper.getRootUUID(domain)


datatypes = ( 'H5T_STD_I8LE', 'H5T_STD_UI8LE',
'H5T_STD_I16LE', 'H5T_STD_UI16LE',
'H5T_STD_I32LE', 'H5T_STD_UI32LE',
datatypes = ( 'H5T_STD_I8LE', 'H5T_STD_U8LE',
'H5T_STD_I16LE', 'H5T_STD_U16LE',
'H5T_STD_I32LE', 'H5T_STD_U32LE',
'H5T_STD_I64LE', 'H5T_STD_I64LE',
'H5T_IEEE_F32LE', 'H5T_IEEE_F64LE' )

Expand Down Expand Up @@ -995,4 +995,4 @@ def testGetCollectionBatch(self):
self.failUnlessEqual(len(uuids), 1000) # should get 1000 unique uuid's

if __name__ == '__main__':
unittest.main()
unittest.main()
8 changes: 4 additions & 4 deletions test/integ/datatypetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ def testPostTypes(self):
root_uuid = helper.getRootUUID(domain)

# list of types supported
datatypes = ( 'H5T_STD_I8LE', 'H5T_STD_UI8LE',
'H5T_STD_I16LE', 'H5T_STD_UI16LE',
'H5T_STD_I32LE', 'H5T_STD_UI32LE',
datatypes = ( 'H5T_STD_I8LE', 'H5T_STD_U8LE',
'H5T_STD_I16LE', 'H5T_STD_U16LE',
'H5T_STD_I32LE', 'H5T_STD_U32LE',
'H5T_STD_I64LE', 'H5T_STD_I64LE',
'H5T_IEEE_F32LE', 'H5T_IEEE_F64LE' )

Expand Down Expand Up @@ -273,4 +273,4 @@ def testGetCollectionBatch(self):


if __name__ == '__main__':
unittest.main()
unittest.main()
2 changes: 1 addition & 1 deletion test/unit/hdf5dtypeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def testCompoundTypeItem(self):
self.failUnlessEqual(tempFieldType['base'], 'H5T_IEEE_F32LE')

def testCreateBaseType(self):
dt = hdf5dtype.createDataType('H5T_STD_UI32BE')
dt = hdf5dtype.createDataType('H5T_STD_U32BE')
self.assertEqual(dt.name, 'uint32')
self.assertEqual(dt.byteorder, '>')
self.assertEqual(dt.kind, 'u')
Expand Down
4 changes: 2 additions & 2 deletions testjson/tref.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
},
"type": {
"base": "H5T_STD_UI32BE",
"base": "H5T_STD_U32BE",
"class": "H5T_INTEGER"
},
"value": [
Expand All @@ -32,7 +32,7 @@
]
},
"type": {
"base": "H5T_STD_UI8LE",
"base": "H5T_STD_U8LE",
"class": "H5T_INTEGER"
},
"value": [
Expand Down
16 changes: 8 additions & 8 deletions util/jsontoh5py.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

def getNumpyTypename(hdf5TypeName, typeClass=None):
predefined_int_types = {
'H5T_STD_I8': 'i1',
'H5T_STD_UI8': 'u1',
'H5T_STD_I16': 'i2',
'H5T_STD_UI16': 'u2',
'H5T_STD_I32': 'i4',
'H5T_STD_UI32': 'u4',
'H5T_STD_I64': 'i8',
'H5T_STD_UI64': 'u8'
'H5T_STD_I8': 'i1',
'H5T_STD_U8': 'u1',
'H5T_STD_I16': 'i2',
'H5T_STD_U16': 'u2',
'H5T_STD_I32': 'i4',
'H5T_STD_U32': 'u4',
'H5T_STD_I64': 'i8',
'H5T_STD_U64': 'u8'
}
predefined_float_types = {
'H5T_IEEE_F32': 'f4',
Expand Down

0 comments on commit 91f85b3

Please sign in to comment.