Skip to content

Commit 4529f5d

Browse files
committed
🐛 Fix default unique_extra_keys value
The current default value of `None` for the `unique_extra_keys` in the `BaseSubmissionController` is not a valid approach for setting the default. For `BaseSubmissionController`s, the user should still specify the unique extra keys, since they can't be derived from a parent node. For the `FromGroupSubmissionController`, it is sensible to use the `_aiida_hash` as a default value, instead of `None`.
1 parent b861256 commit 4529f5d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

aiida_submission_controller/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BaseSubmissionController(BaseModel):
5454
"""Label of the group to store the process nodes in."""
5555
max_concurrent: int
5656
"""Maximum concurrent active processes."""
57-
unique_extra_keys: Optional[tuple] = None
57+
unique_extra_keys: tuple
5858
"""Tuple of keys defined in the extras that uniquely define each process to be run."""
5959

6060
_validate_group_exists = field_validator("group_label")(validate_group_exists)

aiida_submission_controller/from_group.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class FromGroupSubmissionController(BaseSubmissionController): # pylint: disabl
1515
and define the abstract methods.
1616
"""
1717

18+
unique_extra_keys: Optional[tuple] = ("_aiida_hash", )
19+
"""Tuple of keys defined in the extras that uniquely define each process to be run."""
1820
parent_group_label: str
1921
"""Label of the parent group from which to construct the process inputs."""
2022
filters: Optional[dict] = None

0 commit comments

Comments
 (0)