Skip to content

Commit

Permalink
Clarify comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeybrock committed Aug 7, 2024
1 parent 7659910 commit ce93edd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scippnexus/nxtransformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,15 @@ def make_transformation(
depends_on, self._obj.parent.name
)
transform.coords['depends_on'] = sc.scalar(relative)
# When loading a subgroup of a file there can be transformation chains
# that lead outside the loaded group. In this case we cannot resolve the
# chain after loading, so we try to resolve it directly.
if relative.startswith('..'):
try:
resolved = self._obj.parent[depends_on][()]
except Exception: # noqa: S110
# Catchall since resolving not strictly necessary
# Catchall since resolving not strictly necessary, we should not
# fail the rest of the loading process.
pass
else:
transform.coords["resolved_depends_on"] = sc.scalar(resolved)
Expand Down

0 comments on commit ce93edd

Please sign in to comment.