Skip to content

Commit 0f8c53d

Browse files
sliu008Copilot
andauthored
Update podaac/merger/path_utils.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1f3876b commit 0f8c53d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

podaac/merger/path_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ def collapse_dims(dims: dict) -> dict:
116116
root_dims = {p for p in dims if p.count("/") == 1}
117117

118118
for path, size in dims.items():
119-
dim = "/" + path.split("/")[-1]
120-
121-
# If dim has a root version and this is NOT that root path → drop it
122-
if dim in root_dims and path != dim:
119+
dim_name = path.split("/")[-1]
120+
root_dim_path = f"/{dim_name}"
121+
# If root-level version exists and this is NOT that root path → drop it
122+
if root_dim_path in root_dims and path != root_dim_path:
123123
continue
124124
result[path] = size
125125

0 commit comments

Comments
 (0)