From 9a5eb45212214e7b1243ca02070b33225e312f51 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 17 Feb 2022 07:16:55 +0100 Subject: [PATCH] helpful information when comparing files --- python/damask/_result.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/damask/_result.py b/python/damask/_result.py index de51eb611..4cda246e0 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -168,6 +168,10 @@ class Result: def __repr__(self): """Show summary of file content.""" + with h5py.File(self.fname,'r') as f: + header = [f'Created by {f.attrs["creator"]}', + f'Created on {f.attrs["created"]}', + f'With call {f.attrs["call"]}'] visible_increments = self.visible['increments'] first = self.view(increments=visible_increments[0:1]).list_data() @@ -178,7 +182,7 @@ class Result: in_between = '' if len(visible_increments) < 3 else \ ''.join([f'\n{inc}\n ...\n' for inc in visible_increments[1:-1]]) - return util.srepr(first + in_between + last) + return util.srepr(header) +'\n'+ util.srepr(first + in_between + last) def _manage_view(self,action,what,datasets):