Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions torch_sim/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 1 addition & 6 deletions torch_sim/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading