1
1
import json
2
- import os
3
2
from pathlib import Path
4
3
from logging import getLogger
5
4
30
29
31
30
LOG = getLogger (__name__ )
32
31
32
+
33
33
def _get_configuration_dictionary (
34
34
config_type : Literal ["general" , "geometry" , "liquid" ],
35
35
channels : PipetteChannelType ,
@@ -98,6 +98,7 @@ def _physical(
98
98
) -> LoadedConfiguration :
99
99
return _get_configuration_dictionary ("general" , channels , model , version )
100
100
101
+
101
102
def _dirs_in (path : Path ) -> Iterator [Path ]:
102
103
for child in path .iterdir ():
103
104
if child .is_dir ():
@@ -123,17 +124,17 @@ def load_serial_lookup_table() -> Dict[str, str]:
123
124
for channel_dir in _dirs_in (config_path ):
124
125
for model_dir in _dirs_in (channel_dir ):
125
126
for version_file in model_dir .iterdir ():
126
- if version_file .suffix != ' .json' :
127
+ if version_file .suffix != " .json" :
127
128
continue
128
129
try :
129
130
version_list = version_file .stem .split ("_" )
130
131
built_model = f"{ model_dir .stem } _{ _channel_model_str [channel_dir .stem ]} _v{ version_list [0 ]} .{ version_list [1 ]} "
131
132
except IndexError :
132
- LOG .warning (f' Pipette def with bad name { version_file } ignored' )
133
+ LOG .warning (f" Pipette def with bad name { version_file } ignored" )
133
134
continue
134
135
model_shorthand = _model_shorthand .get (model_dir .stem , model_dir .stem )
135
136
if (
136
- model_dir == "p300"
137
+ model_dir . stem == "p300"
137
138
and int (version_list [0 ]) == 1
138
139
and int (version_list [1 ]) == 0
139
140
):
0 commit comments