Fixed bugs in update_file() method and create_hdf5_file_from_filesystem_path()
This commit is contained in:
@ -138,10 +138,10 @@ def create_hdf5_file_from_filesystem_path(path_to_input_directory: str,
|
||||
select_dir_keywords[i] = keyword.replace('/',os.sep)
|
||||
|
||||
if not path_to_filenames_dict:
|
||||
# On dry_run=True, returns path to files dictionary of the output directory without making a actual copy of the input directory
|
||||
path_to_output_directory = os.path.join(path_to_input_directory,'..')
|
||||
path_to_filenames_dict = utils.copy_directory_with_contraints(path_to_input_directory,
|
||||
path_to_output_directory,
|
||||
# On dry_run=True, returns path to files dictionary of the output directory without making a actual copy of the input directory.
|
||||
# Therefore, there wont be a copying conflict by setting up input and output directories the same
|
||||
path_to_filenames_dict = utils.copy_directory_with_contraints(input_dir_path=path_to_input_directory,
|
||||
output_dir_path=path_to_input_directory,
|
||||
dry_run=True)
|
||||
# Set input_directory as copied input directory
|
||||
root_dir = path_to_input_directory
|
||||
|
@ -359,11 +359,12 @@ class HDF5DataOpsManager():
|
||||
def update_file(self, path_to_append_dir):
|
||||
# Split the reference file path and the append directory path into directories and filenames
|
||||
ref_tail, ref_head = os.path.split(self.file_path)
|
||||
ref_head_filename, head_ext = os.path.splitext(ref_head)
|
||||
tail, head = os.path.split(path_to_append_dir)
|
||||
head_filename, head_ext = os.path.splitext(head)
|
||||
|
||||
|
||||
# Ensure the append directory is in the same directory as the reference file and has the same name (without extension)
|
||||
if not (ref_tail == tail and ref_head == head_filename):
|
||||
if not (ref_tail == tail and ref_head_filename == head):
|
||||
raise ValueError("The append directory must be in the same directory as the reference HDF5 file and have the same name without the extension.")
|
||||
|
||||
# Close the file if it's already open
|
||||
|
Reference in New Issue
Block a user