From e9fe67f75e9da79430a08232061227ff95faaa61 Mon Sep 17 00:00:00 2001 From: Tim Widrick Date: Mon, 13 Nov 2017 19:52:17 -0500 Subject: [PATCH] Fix ddls to print SimpleNamespaces also allow 24 chars for floats in ddls --- deepdish/io/ls.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deepdish/io/ls.py b/deepdish/io/ls.py index 3c3cfdf..8fa4635 100644 --- a/deepdish/io/ls.py +++ b/deepdish/io/ls.py @@ -29,6 +29,7 @@ MIN_COLUMN_WIDTH = 5 MIN_AUTOMATIC_COLUMN_WIDTH = 20 MAX_AUTOMATIC_COLUMN_WIDTH = 80 +MAX_FLOAT_LEN = 24 ABRIDGE_OVER_N_CHILDREN = 50 ABRIDGE_SHOW_EACH_SIDE = 5 @@ -271,13 +272,14 @@ def info(self, colorize=True, final_level=False): final_level=final_level) def print(self, level=0, parent='/', colorize=True, max_level=None, - file=sys.stdout): + file=sys.stdout, settings={}): if level == 0 and not self.header.get('dd_io_unpack'): print_row('', self.info(colorize=colorize, final_level=(0 == max_level)), level=level, parent=parent, unpack=False, colorize=colorize, file=file) - DictNode.print(self, level, parent, colorize, max_level, file) + DictNode.print(self, level, parent, colorize, max_level, + file, settings) def __repr__(self): s = ['{}={}'.format(k, repr(v)) for k, v in self.children.items()] @@ -469,7 +471,7 @@ def info(self, colorize=True, final_level=False): type_color='blue', colorize=colorize) else: - return type_string(repr(self.value)[:20], + return type_string(repr(self.value)[:MAX_FLOAT_LEN], dtype=str(np.dtype(type(self.value))), type_color='blue', colorize=colorize)