Tables with same dtype names should have the same dtype
Summary
(Summarise the bug encountered concisely.)
Environment
- KM3Pipe version (
km3pipe --version
): - Python version (
python --version
): - OS: (
uname -a
)
Additional information
(The following are optional but may be relevant.)
- HDF5 metadata (
h5info /path/to/relevant/file.h5
) - ROOT file metadata (
JPrintMeta -f /path/to/relevant/file.root
): - Jpp version (only if relevant,
JPrint -v
)
What is the current bug behavior?
Two tables initialised with dict
s containing the very same keys but different order is handled differently in Python 2 and 3. We should always get the same numpy dtype
(maybe order by name?)
What is the expected correct behavior?
Same dtype when initialised with same dict-keys.
Steps to reproduce
import km3pipe as kp
t1 = kp.Table({'a': [1, 2], 'b': [3, 4], 'c': [5, 6]})
t2 = kp.Table({'c': [1, 2], 'a': [3, 4], 'b': [5, 6]})
print(t1.dtype)
print(t2.dtype)
print(t1.dtype == t2.dtype)