5
5
import click
6
6
import yaml
7
7
8
+ from ..auto .runcard import Runcard
8
9
from .acquisition import acquire as acquisition
9
10
from .autocalibration import autocalibrate
10
11
from .fit import fit as fitting
@@ -43,23 +44,39 @@ def command():
43
44
help = "Use --no-update option to avoid updating iteratively the platform."
44
45
"With this option the new runcard will not be produced." ,
45
46
)
46
- def auto (runcard , folder , force , update ):
47
+ @click .option (
48
+ "--platform" ,
49
+ default = None ,
50
+ help = "Name of the Qibolab platform." ,
51
+ )
52
+ @click .option (
53
+ "--backend" ,
54
+ default = None ,
55
+ help = "Name of the Qibo backend.," ,
56
+ )
57
+ def auto (runcard , folder , force , update , platform , backend ):
47
58
"""Autocalibration
48
59
49
60
Arguments:
50
61
51
62
- RUNCARD: runcard with declarative inputs.
52
63
"""
53
- card = yaml .safe_load (runcard .read_text (encoding = "utf-8" ))
54
- autocalibrate (card , folder , force , update )
64
+ runcard = Runcard .load (yaml .safe_load (runcard .read_text (encoding = "utf-8" )))
65
+
66
+ if platform is not None :
67
+ runcard .platform = platform
68
+ if backend is not None :
69
+ runcard .backend = backend
70
+
71
+ autocalibrate (runcard , folder , force , update )
55
72
56
73
57
74
@command .command (context_settings = CONTEXT_SETTINGS )
58
75
@click .argument (
59
76
"runcard" , metavar = "RUNCARD" , type = click .Path (exists = True , path_type = pathlib .Path )
60
77
)
61
78
@click .option (
62
- "folder" ,
79
+ "-- folder" ,
63
80
"-o" ,
64
81
type = click .Path (path_type = pathlib .Path ),
65
82
help = "Output folder. If not provided a standard name will generated." ,
@@ -70,15 +87,31 @@ def auto(runcard, folder, force, update):
70
87
is_flag = True ,
71
88
help = "Use --force option to overwrite the output folder." ,
72
89
)
73
- def acquire (runcard , folder , force ):
90
+ @click .option (
91
+ "--platform" ,
92
+ default = None ,
93
+ help = "Name of the Qibolab platform." ,
94
+ )
95
+ @click .option (
96
+ "--backend" ,
97
+ default = None ,
98
+ help = "Name of the Qibo backend.," ,
99
+ )
100
+ def acquire (runcard , folder , force , platform , backend ):
74
101
"""Data acquisition
75
102
76
103
Arguments:
77
104
78
105
- RUNCARD: runcard with declarative inputs.
79
106
"""
80
- card = yaml .safe_load (runcard .read_text (encoding = "utf-8" ))
81
- acquisition (card , folder , force )
107
+ runcard = Runcard .load (yaml .safe_load (runcard .read_text (encoding = "utf-8" )))
108
+
109
+ if platform is not None :
110
+ runcard .platform = platform
111
+ if backend is not None :
112
+ runcard .backend = backend
113
+
114
+ acquisition (runcard , folder , force )
82
115
83
116
84
117
@command .command (context_settings = CONTEXT_SETTINGS )
0 commit comments