diff --git a/skvalidate/__init__.py b/skvalidate/__init__.py index 1cb350c..a134dba 100644 --- a/skvalidate/__init__.py +++ b/skvalidate/__init__.py @@ -14,6 +14,7 @@ # logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) +logger.propagate = False # add loggers ch = logging.StreamHandler() diff --git a/skvalidate/commands/root_info.py b/skvalidate/commands/root_info.py index 857622c..30c144e 100644 --- a/skvalidate/commands/root_info.py +++ b/skvalidate/commands/root_info.py @@ -3,6 +3,7 @@ """ from __future__ import print_function import click +import numpy as np import pandas as pd from tabulate import tabulate import uproot @@ -19,6 +20,15 @@ def info(input_file): for name, obj in _walk(f): canRead = False is_empty = False + + hasStreamer = hasattr(obj, '_streamer') and obj._streamer is not None + interpretation = obj.interpretation if hasattr(obj, 'interpretation') else None + if not hasStreamer and interpretation is None: + data.append( + (name, interpretation, np.nan, np.nan, hasStreamer, canRead, is_empty) + ) + continue + try: a = obj.array() if a is None: @@ -28,9 +38,8 @@ def info(input_file): canRead = True except Exception as e: print(e) - hasStreamer = obj._streamer is not None data.append( - (name, obj.interpretation, obj.compressedbytes(), obj.uncompressedbytes(), hasStreamer, canRead, is_empty) + (name, interpretation, obj.compressedbytes(), obj.uncompressedbytes(), hasStreamer, canRead, is_empty) ) return pd.DataFrame.from_records(data, columns=labels) diff --git a/skvalidate/compare/__init__.py b/skvalidate/compare/__init__.py index b0963bd..859921c 100644 --- a/skvalidate/compare/__init__.py +++ b/skvalidate/compare/__init__.py @@ -101,7 +101,7 @@ def load_values(name, content1, content2): try: value1 = np.array(value1) value2 = np.array(value2) - except (AssertionError, TypeError) as e: + except (AssertionError, TypeError, ValueError) as e: logger.error('Cannot convert {} to numpy array: {}'.format(name, e)) return None, None