Test refactor offline
2 unresolved threads
2 unresolved threads
this branch has additional tests for full coverage of offline (note Usr class is not tested). There is also an attempt to fix some bugs in the Header class.
Edited by Tamas Gal
Merge request reports
Activity
- Resolved by Zineb Aly
- Resolved by Zineb Aly
201 198 Constructor = namedtuple(attribute, fields) 202 199 if len(values) < len(fields): 203 200 values += [None] * (len(fields) - len(values)) 201 print(attribute, fields, values) 204 202 self._data[attribute] = Constructor( 205 203 **{f: _to_num(v) 206 204 for (f, v) in zip(fields, values)}) 207 205 206 # quick fix while waiting for additional definitions in mc_header 207 for key in self._missing_keys: 208 self._data[key] = _to_num(header[key]) So here is the crux, I think we should have dummy entries for every non-existent key. The code itself can go to the for-loop above while iterating over the keys in the file, instead of the known keys. Hope you understand what I mean ;) we can check for every item if it's in the existing
mc_header.keys()
, if not, we just name each entryfield_1
,field_2
etc.
253 289 assert np.allclose( 254 290 [37.51967774166617, -10.280346193553832, 13.67595659707355], 255 291 self.f.events.usr.DeltaPosZ) 292 293 294 class TestIndependentFunctions(unittest.TestCase): mentioned in commit c0892b66
Please register or sign in to reply