Included cli commands update and serialize to simplify running metadata revision pipeline.
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add the parent directory to the system path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import h5py
|
||||
import yaml
|
||||
import src.hdf5_ops as hdf5_ops
|
||||
@ -153,12 +157,14 @@ def count(hdf5_obj,yml_dict):
|
||||
print('additions',count_additions, 'deletions', count_delections)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 4:
|
||||
print("Usage: python metadata_revision.py update <path/to/review_file.hdf5> <path/to/review_file.yaml>")
|
||||
sys.exit(1)
|
||||
|
||||
if sys.argv[2] == 'update':
|
||||
input_hdf5_file = sys.argv[3]
|
||||
yaml_review_file = sys.argv[4]
|
||||
if len(sys.argv) < 4:
|
||||
print("Usage: python metadata_revision.py update <path/to/target_file.hdf5> <path/to/metadata_review_file.yaml>")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if sys.argv[1] == 'update':
|
||||
input_hdf5_file = sys.argv[2]
|
||||
yaml_review_file = sys.argv[3]
|
||||
update_hdf5_file_with_review(input_hdf5_file, yaml_review_file)
|
||||
#run(sys.argv[2])
|
||||
|
Reference in New Issue
Block a user