Formatting

This commit is contained in:
2019-05-03 18:39:42 +02:00
parent d991cd496e
commit 56a321f8e3

View File

@@ -144,7 +144,8 @@ VMPmodule_hdr = np.dtype([('shortname', 'S10'),
('version', '<u4'), ('version', '<u4'),
('date', 'S8')]) ('date', 'S8')])
data_dtype_dict = { # Maps from colID to a tuple defining a numpy dtype
VMPdata_colID_dtype_map = {
4: ('time/s', '<f8'), 4: ('time/s', '<f8'),
5: ('control/V/mA', '<f4'), 5: ('control/V/mA', '<f4'),
6: ('Ewe/V', '<f4'), 6: ('Ewe/V', '<f4'),
@@ -214,11 +215,11 @@ def VMPdata_dtype_from_colIDs(colIDs):
raise NotImplementedError("flag %d not implemented" % colID) raise NotImplementedError("flag %d not implemented" % colID)
else: else:
try: try:
field = data_dtype_dict[colID][0] field = VMPdata_colID_dtype_map[colID][0]
if field in field_list: if field in field_list:
field += str(len(field_list)) field += str(len(field_list))
field_list.append(field) field_list.append(field)
type_list.append(data_dtype_dict[colID][1]) type_list.append(VMPdata_colID_dtype_map[colID][1])
except KeyError: except KeyError:
print(list(zip(field_list, type_list))) print(list(zip(field_list, type_list)))
raise NotImplementedError("column type %d not implemented" raise NotImplementedError("column type %d not implemented"