diff --git a/torch_sim/runners.py b/torch_sim/runners.py index e718577ee..4f60d3cd5 100644 --- a/torch_sim/runners.py +++ b/torch_sim/runners.py @@ -629,6 +629,10 @@ def optimize[T: OptimState]( # noqa: C901, PLR0915 if isinstance(initial_state, OptimState): state = initial_state else: + logger.info( + "optimize: initializing optimizer state via chunked apply " + "(BinningAutoBatcher); InFlightAutoBatcher will be used for optimization" + ) state = _chunked_apply( init_fn, initial_state, diff --git a/torch_sim/trajectory.py b/torch_sim/trajectory.py index 290351496..5a73d5802 100644 --- a/torch_sim/trajectory.py +++ b/torch_sim/trajectory.py @@ -186,6 +186,7 @@ def reopen_trajectories( ValueError: If filenames are not unique """ self.finish() + self.trajectories = [] # drop refs so HDF5 finalizes before new opens filenames = ( [filenames] if isinstance(filenames, (str, pathlib.Path)) else list(filenames) @@ -524,12 +525,6 @@ def __init__( else: compression = None - # TODO FIX THIS - if hasattr(tables, "file") and ( - handles := tables.file._open_files.get_handlers_by_name(str(filename)) - ): - list(handles)[-1].close() - # create parent directory if it doesn't exist filename.parent.mkdir(parents=True, exist_ok=True) self._file = tables.open_file(str(filename), mode=mode, filters=compression)