Skip to content

Commit

Permalink
fix group check
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwoods2 committed Jul 20, 2024
1 parent 4cb73b7 commit c99c2fd
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions zarrtraj/ZARR.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,8 @@ def _open_trajectory(self):
raise NoDataError("H5MD file must contain an 'h5md' group")

if self._group is None:
# NOTE: we do this because running moto on gh actions
# duplicates all keys in the zarr file when reading
# This should be changed once the issue is resolved
traj_keys = list(self._file["particles"].group_keys())
if len(traj_keys) == 1 or all(
traj_key == traj_keys[0] for traj_key in traj_keys
):
if len(traj_keys) == 1:
self._group = traj_keys[0]
else:
raise NoDataError(
Expand Down Expand Up @@ -774,9 +769,7 @@ def parse_n_atoms(filename, group=None, so=None):

if group is None:
traj_keys = list(file["particles"].group_keys())
if len(traj_keys) == 1 or all(
traj_key == traj_keys[0] for traj_key in traj_keys
):
if len(traj_keys) == 1:
group = traj_keys[0]
else:
raise NoDataError(
Expand Down

0 comments on commit c99c2fd

Please sign in to comment.