From f83a167414fb8917a8708c85f13501763de21230 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 Sep 2019 09:48:39 -0700 Subject: [PATCH] file mode for high level funtion not useful --- python/damask/dadf5.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/python/damask/dadf5.py b/python/damask/dadf5.py index 6edad9c37..688cbba08 100644 --- a/python/damask/dadf5.py +++ b/python/damask/dadf5.py @@ -17,7 +17,7 @@ class DADF5(): # ------------------------------------------------------------------ def __init__(self, filename, - mode = 'r', + mode = 'a', ): """ Opens an existing DADF5 file. @@ -26,16 +26,9 @@ class DADF5(): ---------- filename : str name of the DADF5 file to be openend. - mode : str, optional - filemode for opening, either 'r' or 'a'. """ - if mode not in ['a','r']: - print('Invalid file access mode') - else: - with h5py.File(filename,mode): - pass - + with h5py.File(filename,'r') as f: if f.attrs['DADF5-major'] != 0 or f.attrs['DADF5-minor'] != 2: