idx stored in list again to pass all tests

This commit is contained in:
Fabian Joswig 2021-10-29 16:15:52 +01:00
parent 11aa99ac8a
commit eef464ec26

View file

@ -78,7 +78,7 @@ class Obs:
if len(dc) == 1:
self.idl[name] = range(idx[0], idx[-1] + dc[0], dc[0])
else:
self.idl[name] = np.array(idx, dtype=_type_chooser(len(idx)))
self.idl[name] = list(idx)
else:
raise Exception('incompatible type for idl[%s].' % (name))
else:
@ -1467,10 +1467,3 @@ def merge_obs(list_of_obs):
o.is_merged = np.any([oi.is_merged for oi in list_of_obs])
o.reweighted = np.max([oi.reweighted for oi in list_of_obs])
return o
def _type_chooser(n):
for dtype in [np.uint8, np.uint16, np.uint32, np.uint64]:
if n <= dtype(-1):
return dtype
raise Exception('{} is really big!'.format(n))