Included a boolean input argument hdf5_upload to deactivate hdf5 upload for testing.
This commit is contained in:
@ -194,7 +194,7 @@ def second_save_metadata_review(review_yaml_file_path, reviewer_attrs):
|
||||
|
||||
|
||||
|
||||
def third_update_hdf5_file_with_review(input_hdf5_file, yalm_review_file, reviewer_attrs = {}):
|
||||
def third_update_hdf5_file_with_review(input_hdf5_file, yalm_review_file, reviewer_attrs = {}, hdf5_upload : bool = False):
|
||||
|
||||
"""Third"""
|
||||
# compare review file with current yalm file and then based on the changes open hdf5 file and access only
|
||||
@ -275,12 +275,17 @@ def third_update_hdf5_file_with_review(input_hdf5_file, yalm_review_file, review
|
||||
|
||||
status = subprocess.run(status_command,capture_output=True,check=True)
|
||||
|
||||
if hdf5_upload:
|
||||
upload_ext = ['.h5','.yaml']
|
||||
else:
|
||||
upload_ext = ['.yaml']
|
||||
|
||||
files_to_add_list = []
|
||||
for line in status.stdout.splitlines():
|
||||
# conver line from bytes to str
|
||||
tmp = line.decode("utf-8")
|
||||
if 'modified' in tmp:
|
||||
if any([ext in tmp for ext in ['.h5','.yaml']] ):
|
||||
if any([ext in tmp for ext in upload_ext] ):
|
||||
files_to_add_list.append(tmp.split()[1])
|
||||
if files_to_add_list:
|
||||
output = subprocess.run(add_command(files_to_add_list),capture_output=True,check=True)
|
||||
|
Reference in New Issue
Block a user