Skip to content

Commit

Permalink
Add condition to check arg.repeat in _init_subdata
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Nov 21, 2024
1 parent 61bea6c commit 52cc61c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dargs/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __init__(self, data: dict, arg: Argument | Variant):

def _init_subdata(self):
"""Initialize sub ArgumentData."""
if isinstance(self.data, dict) and isinstance(self.arg, Argument):
if isinstance(self.data, dict) and isinstance(self.arg, Argument) and not self.arg.repeat:
sub_fields = self.arg.sub_fields.copy()
# extend subfiles with sub_variants
for vv in self.arg.sub_variants.values():
Expand All @@ -175,7 +175,7 @@ def _init_subdata(self):
else:
self.subdata.append(ArgumentData(self.data[kk], kk))
elif (
isinstance(self.data, list)
isinstance(self.data, (list, dict))
and isinstance(self.arg, Argument)
and self.arg.repeat
):
Expand Down

0 comments on commit 52cc61c

Please sign in to comment.