Skip to content

Commit

Permalink
🐛 Fix default unique_extra_keys value
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
mbercx committed Jan 10, 2025
1 parent b861256 commit 2039c89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions aiida_submission_controller/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import abc
import logging
import time
from typing import Optional

from aiida import engine, orm
from aiida.common import NotExistent
Expand Down Expand Up @@ -54,7 +53,7 @@ class BaseSubmissionController(BaseModel):
"""Label of the group to store the process nodes in."""
max_concurrent: int
"""Maximum concurrent active processes."""
unique_extra_keys: Optional[tuple] = None
unique_extra_keys: tuple
"""Tuple of keys defined in the extras that uniquely define each process to be run."""

_validate_group_exists = field_validator("group_label")(validate_group_exists)
Expand Down
2 changes: 2 additions & 0 deletions aiida_submission_controller/from_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class FromGroupSubmissionController(BaseSubmissionController): # pylint: disabl
and define the abstract methods.
"""

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

0 comments on commit 2039c89

Please sign in to comment.