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

pyiron / executorlib / 11571828308

29 Oct 2024 10:20AM UTC coverage: 94.469% (+0.4%) from 94.059%
11571828308

Pull #463

github

web-flow
Merge da0db2533 into cc96c43f4
Pull Request #463: Add additional input checks

19 of 20 new or added lines in 3 files covered. (95.0%)

1 existing line in 1 file now uncovered.

871 of 922 relevant lines covered (94.47%)

0.94 hits per line

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

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

4
from pysqa import QueueAdapter
1✔
5

6

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

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

27
    Returns:
28
        int: queuing system ID
29
    """
30
    if resource_dict is None:
1✔
UNCOV
31
        resource_dict = {"cwd": "."}
×
32
    qa = QueueAdapter(directory=config_directory, queue_type=backend)
1✔
33
    submit_kwargs = {
1✔
34
        "command": " ".join(command),
35
        "dependency_list": [str(qid) for qid in task_dependent_lst],
36
        "working_directory": os.path.abspath(resource_dict["cwd"]),
37
    }
38
    del resource_dict["cwd"]
1✔
39
    unsupported_keys = [
1✔
40
        "threads_per_core",
41
        "gpus_per_core",
42
        "openmpi_oversubscribe",
43
        "slurm_cmd_args",
44
    ]
45
    for k in unsupported_keys:
1✔
46
        if k in resource_dict:
1✔
47
            del resource_dict[k]
1✔
48
    submit_kwargs.update(resource_dict)
1✔
49
    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

© 2025 Coveralls, Inc