Skip to content
Snippets Groups Projects
Commit cb9656dc authored by Andi Gerken's avatar Andi Gerken
Browse files

Fixed bug in update_ids

parent 49d9e5b7
No related branches found
No related tags found
1 merge request!40Fixed bug in update_ids
Pipeline #52655 passed
......@@ -350,8 +350,8 @@ def update_individual_ids(args=None):
assert n_fish == len(
f.entities
), f"Number of fish in file {file} is not the same as in the previous file."
if video is None:
if "video" in f.attrs:
if video is None and "video" in f.attrs:
video = f.attrs["video"]
else:
assert (
......
......@@ -79,6 +79,7 @@ class File(h5py.File):
calendar_time_points: Iterable = None,
open_copy: bool = False,
validate_poses_hash: bool = True,
calculate_data_on_close: bool = True,
):
"""Create a new RoboFish Track Format object.
......@@ -147,6 +148,7 @@ class File(h5py.File):
self.path = path
self.validate_when_saving = validate_when_saving
self.calculate_data_on_close = calculate_data_on_close
if open_copy:
assert (
......@@ -275,7 +277,7 @@ class File(h5py.File):
super().__exit__(type, value, traceback)
def close(self):
if self.mode != "r":
if self.mode != "r" and self.calculate_data_on_close:
self.update_calculated_data()
super().close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment