• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pyiron / executorlib / 11543861772

27 Oct 2024 09:13PM UTC coverage: 94.084% (-0.3%) from 94.335%
11543861772

push

github

web-flow
Cache: Add queue test (#452)

* Cache: Add queue test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix mpich bug

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

11 of 14 new or added lines in 2 files covered. (78.57%)

827 of 879 relevant lines covered (94.08%)

0.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/executorlib/standalone/cache/queue.py
1
from typing import List, Optional
1✔
2

3
from pysqa import QueueAdapter
1✔
4

5

6
def execute_with_pysqa(
1✔
7
    command: str,
8
    resource_dict: dict,
9
    task_dependent_lst: List[int] = [],
10
    config_directory: Optional[str] = None,
11
    backend: Optional[str] = None,
12
) -> int:
13
    """
14
    Execute a command by submitting it to the queuing system
15

16
    Args:
17
        command (list): The command to be executed.
18
        task_dependent_lst (list): A list of subprocesses that the current subprocess depends on. Defaults to [].
19
        resource_dict (dict): resource dictionary, which defines the resources used for the execution of the function.
20
                              Example resource dictionary: {
21
                                  cwd: None,
22
                              }
23
        config_directory (str, optional): path to the config directory.
24
        backend (str, optional): name of the backend used to spawn tasks.
25

26
    Returns:
27
        int: queuing system ID
28
    """
29
    if resource_dict is None:
1✔
NEW
30
        resource_dict = {"cwd": "."}
×
31
    qa = QueueAdapter(directory=config_directory, queue_type=backend)
1✔
32
    submit_kwargs = {
1✔
33
        "command": " ".join(command),
34
        "dependency_list": [str(qid) for qid in task_dependent_lst],
35
        "working_directory": resource_dict["cwd"],
36
    }
37
    del resource_dict["cwd"]
1✔
38
    submit_kwargs.update(resource_dict)
1✔
39
    return qa.submit_job(**submit_kwargs)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc