Skip to content

Commit 3ab4095

Browse files
committed
add comments to clarify the reverse
1 parent 985cc55 commit 3ab4095

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pystac/catalog.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ def generate_subcatalogs(self, template, defaults=None, parent_ids=None, **kwarg
557557
id_iter = reversed(parent_ids)
558558
if all(['{}'.format(id) == next(id_iter, None)
559559
for id in reversed(item_parts.values())]):
560+
# Skip items for which the sub-catalog structure already
561+
# matches the template. The list of parent IDs can include more
562+
# elements on the root side, so compare the reversed sequences.
560563
continue
561564
curr_parent = self
562565
for k, v in item_parts.items():

0 commit comments

Comments
 (0)