Skip to content
Snippets Groups Projects
Commit 90ffa080 authored by Simon Sebastian Humpohl's avatar Simon Sebastian Humpohl
Browse files

Fix numpy table entry dtype on 64bit linux systems

parent 093e6c82
Branches
Tags
No related merge requests found
...@@ -36,8 +36,9 @@ __version__ = "0.1" ...@@ -36,8 +36,9 @@ __version__ = "0.1"
TABLE_ENTRY_FORMAT = struct.Struct('< L H B x') TABLE_ENTRY_FORMAT = struct.Struct('< L H B x')
TABLE_ENTRY_DTYPE = np.dtype([('repeats', 'L'), ('segment_no', 'H'), ('jump_flag', 'B')], align=True) TABLE_ENTRY_DTYPE = np.dtype([('repeats', '<u4'), ('segment_no', '<u2'), ('jump_flag', '|u1')], align=True)
assert TABLE_ENTRY_FORMAT.size == TABLE_ENTRY_DTYPE.itemsize assert TABLE_ENTRY_FORMAT.size == TABLE_ENTRY_DTYPE.itemsize == 8
assert [TABLE_ENTRY_FORMAT.unpack(bytes(range(1, 9)))] == np.frombuffer(bytes(range(1, 9)), dtype=TABLE_ENTRY_DTYPE).tolist()
class ParanoiaLevel(enum.Enum): class ParanoiaLevel(enum.Enum):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment