Skip to content
Snippets Groups Projects
Commit 4aeac16f authored by Valerio Mariani's avatar Valerio Mariani
Browse files

Added function to check if an entry is already present in the file. Fixed a typo

parent ec9c95d4
No related branches found
No related tags found
No related merge requests found
......@@ -492,6 +492,29 @@ class CXIWriter:
return self._initialized
def is_entry_in_file(self, path):
"""Checks if an entry is already present in the file.
Checks if an entry is already present in the file at the path provided by the user. It will return True if
either a dataset or a group are present at the specified path
Args:
path (str): the path where to check for a dataset or group
Results:
ret (bool): True if a group or dataset can be found in the file, False otherwise
"""
if path in self._fh:
ret = True
else:
ret = False
return ret
def file_is_full(self):
"""Checks if the file is full.
......@@ -505,7 +528,7 @@ class CXIWriter:
return self._curr_slice >= self._max_num_slices
def num_slices_in_file(selfself):
def num_slices_in_file(self):
"""Returns the number of slices already written in the file
Returns the number of slices that have already been written in the file.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment