Skip to content

Commit

Permalink
Merge branch 'development' into fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLP committed Jan 20, 2018
2 parents 380dbda + a5cd072 commit 592b032
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions testbeam_analysis/tools/smc.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ def __init__(self, table_file_in, file_out,
raise NotImplementedError('Data alignment is only supported '
'on event_number')



# Get the table node name
with tb.open_file(table_file_in) as in_file:
if not table: # Find the table node
for n in in_file.root:
if tb.table.Table == type(n):
if not table:
node = n
else: # Multiple tables
raise RuntimeError('No table node defined and '
'multiple nodes found in file')
self.node_name = node.name
elif isinstance(table, Iterable): # possible names
tables = in_file.list_nodes('/',classname='Table') # get all nodes of type 'table'
if len(tables) == 1: # if there is only one table, take this one
self.node_name = tables[0].name
else: # Multiple tables
raise RuntimeError('No table node defined and '
'multiple table nodes found in file')
elif isinstance(table,(list,tuple,set)): # possible names
self.node_name = None
for node_cand in table:
try:
Expand Down

0 comments on commit 592b032

Please sign in to comment.