Skip to content

Commit

Permalink
Fix submit_new_batch when verbose = True
Browse files Browse the repository at this point in the history
The `submit_new_batch` method fails if `verbose` is set to `True`, as it
refers to the `parent_group` to get the total number of submissions.
When using the `BaseSubmissionController`, this attribute is not
specified.
To fix the `verbose` option for the `BaseSubmissionController` and
`FromGroupSubmissionController`, the number of submissions is
defined by the number of `all extras to `submit`.
  • Loading branch information
t-reents committed Mar 6, 2024
1 parent 4db1dfc commit 20c553a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aiida_submission_controller/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ def num_already_run(self):
def submit_new_batch(self, dry_run=False, sort=False, verbose=False, sleep=0):
"""Submit a new batch of calculations, ensuring less than self.max_concurrent active at the same time."""
CMDLINE_LOGGER.level = logging.INFO if verbose else logging.WARNING

extras_to_run = list(set(self.get_all_extras_to_submit()).difference(self._check_submitted_extras()))

all_extras = set(self.get_all_extras_to_submit())
extras_to_run = list(all_extras.difference(self._check_submitted_extras()))

if sort:
extras_to_run = sorted(extras_to_run)
Expand All @@ -204,7 +205,7 @@ def submit_new_batch(self, dry_run=False, sort=False, verbose=False, sleep=0):
table.add_column("Available", justify="left", style="cyan", no_wrap=True)

table.add_row(
str(self.parent_group.count()),
str(len(all_extras)),
str(self.num_already_run),
str(self.num_to_run),
str(self.max_concurrent),
Expand Down

0 comments on commit 20c553a

Please sign in to comment.