hotfix, missing kwarg files in read_rwms method

This commit is contained in:
jkuhl-uni 2021-12-17 12:08:08 +01:00
parent 307738c4fd
commit 5e5a9df404
2 changed files with 24 additions and 7 deletions

View file

@ -39,7 +39,9 @@ def read_rwms(path, prefix, version='2.0', names=None, **kwargs):
if not ls: if not ls:
raise Exception('Error, directory not found') raise Exception('Error, directory not found')
if 'files' in kwargs:
ls = kwargs.get('files')
else:
# Exclude files with different names # Exclude files with different names
for exc in ls: for exc in ls:
if not fnmatch.fnmatch(exc, prefix + '*' + postfix + '.dat'): if not fnmatch.fnmatch(exc, prefix + '*' + postfix + '.dat'):

15
pyerrors/input/utils.py Normal file
View file

@ -0,0 +1,15 @@
import fnmatch
def check_missing(idl,che):
missing = []
for ind in che:
if not ind in idl:
missing.append(ind)
if(len(missing) == 0):
print("There are no measurements missing.")
else:
print(len(missing),"measurements missing")
miss_str = str(missing[0])
for i in missing[1:]:
miss_str += ","+str(i)
print(miss_str)