Skip to content

Commit 3aed8df

Browse files
committed
chore(instructor): parse and set split volumes args
1 parent dc59e58 commit 3aed8df

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

icfree/instructor/__main__.py

+16
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ def main():
134134
logger=logger
135135
)
136136

137+
# List of parameters
138+
list_of_params = []
139+
for plt in source_plates.values():
140+
list_of_params += plt.get_list_of_parameters()
141+
list_of_params = list(set(list_of_params))
142+
# If components to split are not given, split all components
143+
if args.split_components == DEFAULT_ARGS['SPLIT_COMPONENTS']:
144+
args.split_components = list_of_params
145+
# If only one volume is given, use it for all components
146+
if len(args.split_upper_vol) == 1:
147+
args.split_upper_vol = \
148+
[args.split_upper_vol[0]] * len(args.split_components)
149+
if len(args.split_lower_vol) == 1:
150+
args.split_lower_vol = \
151+
[args.split_lower_vol[0]] * len(args.split_components)
152+
137153
split_components = dict()
138154
for i in range(len(args.split_components)):
139155
split_components[args.split_components[i]] = {

icfree/instructor/args.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,15 @@ def add_arguments(parser):
8686
nargs='+',
8787
default=DEFAULT_ARGS['SRC_PLATE_TYPE'],
8888
help=(
89-
'Source plate type (for ECHO robot). If number of args is odd, '
90-
'the first arg is the plate type by default. '
91-
'Then, each pair of args is a sample ID and a plate type'
92-
' (e.g. -spt COMPONENT_1 PLATE_TYPE).'
89+
'Source plate type (for ECHO robot). If the number of args'
90+
' is even, then each pair of args is a sample ID and a plate type'
91+
' (e.g. -spt COMPONENT_1 PLATE_TYPE_1 COMPONENT_2 PLATE_TYPE_2).'
92+
' Else (if number of args is odd),'
93+
' the first arg is the plate type by default and the rest of args '
94+
' are couples of sample ID and plate type.'
95+
'Else, each pair of args is a sample ID and a plate type'
96+
' (e.g. -spt DEF_PLATE_TYPE COMPONENT_1 PLATE_TYPE_1'
97+
' COMPONENT_2 PLATE_TYPE_2).'
9398
f' (default: {DEFAULT_ARGS["SRC_PLATE_TYPE"]})'
9499
)
95100
)

0 commit comments

Comments
 (0)