Coverage for python/lsst/ctrl/mpexec/cli/script/pre_exec_init_qbb.py: 43%

7 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-08-06 02:30 +0000

1# This file is part of ctrl_mpexec. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (http://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <http://www.gnu.org/licenses/>. 

21 

22from types import SimpleNamespace 

23 

24from ... import CmdLineFwk, TaskFactory 

25 

26 

27def pre_exec_init_qbb( 

28 butler_config: str, 

29 qgraph: str, 

30 qgraph_id: str | None, 

31 config_search_path: list[str] | None, 

32) -> None: 

33 """Implement the command line interface ``pipetask pre-exec-init-qbb`` 

34 subcommand. 

35 

36 Should only be called by command line tools and unit test code 

37 that tests this function. 

38 

39 Parameters 

40 ---------- 

41 butler_config : `str` 

42 The path location of the gen3 butler/registry config file. 

43 qgraph : `str` 

44 URI location for a serialized quantum graph definition. 

45 qgraph_id : `str` or `None` 

46 Quantum graph identifier, if specified must match the identifier of the 

47 graph loaded from a file. Ignored if graph is not loaded from a file. 

48 config_search_path : `list` [`str`] 

49 Additional search paths for butler configuration. 

50 """ 

51 args = SimpleNamespace( 

52 butler_config=butler_config, 

53 qgraph=qgraph, 

54 qgraph_id=qgraph_id, 

55 config_search_path=config_search_path, 

56 ) 

57 

58 f = CmdLineFwk() 

59 task_factory = TaskFactory() 

60 f.preExecInitQBB(task_factory, args)