Skip to content

Commit

Permalink
Adapt check_dataset to check also in data subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
chauenstein committed Aug 15, 2023
1 parent 8310120 commit 047afcd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions odym/modules/ODYM_Functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,19 +1413,21 @@ def convert_log(file, file_format='html'):
output = pypandoc.convert_file(file, file_format, outputfile=output_filename)
assert output == ""

def check_dataset(path,PL_Names,PL_Version,Mylog):
def check_dataset(path,PL_Names,PL_Version,PL_SubFolder,Mylog):
"""
Checks that every parameter in Pl_Names with the corrsponding version PL_Versions is in the folder given by path
Checks that every parameter in Pl_Names with the corrsponding version PL_Versions is in the folder given by path, or subfolder given by PL_SubFolder
:param path: Dataset folder
:param PL_Names: List of parameters names
:param PL_versions: List of parameters versions
:param PL_SubFolder: List of data subfolder names
:param Mylog: log file
"""
for m in range(len(PL_Names)):
if PL_Names[m]+'_'+PL_Version[m]+'.xlsx' not in os.listdir(path):
Mylog.error(PL_Names[m]+'_'+PL_Version[m]+'.xlsx not in the dataset.')
if PL_Names[m]+'_'+PL_Version[m]+'.xlsx' not in os.listdir(os.path.join(path, PL_SubFolder[m])):
Mylog.error(PL_Names[m]+'_'+PL_Version[m]+'.xlsx not in the dataset.')


# The End
Expand Down

0 comments on commit 047afcd

Please sign in to comment.