Skip to content

Commit bff1784

Browse files
committed
mild fixups
1 parent febeeea commit bff1784

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

shared-data/python/opentrons_shared_data/pipette/load_data.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import os
32
from pathlib import Path
43
from logging import getLogger
54

@@ -30,6 +29,7 @@
3029

3130
LOG = getLogger(__name__)
3231

32+
3333
def _get_configuration_dictionary(
3434
config_type: Literal["general", "geometry", "liquid"],
3535
channels: PipetteChannelType,
@@ -98,6 +98,7 @@ def _physical(
9898
) -> LoadedConfiguration:
9999
return _get_configuration_dictionary("general", channels, model, version)
100100

101+
101102
def _dirs_in(path: Path) -> Iterator[Path]:
102103
for child in path.iterdir():
103104
if child.is_dir():
@@ -123,17 +124,17 @@ def load_serial_lookup_table() -> Dict[str, str]:
123124
for channel_dir in _dirs_in(config_path):
124125
for model_dir in _dirs_in(channel_dir):
125126
for version_file in model_dir.iterdir():
126-
if version_file.suffix != '.json':
127+
if version_file.suffix != ".json":
127128
continue
128129
try:
129130
version_list = version_file.stem.split("_")
130131
built_model = f"{model_dir.stem}_{_channel_model_str[channel_dir.stem]}_v{version_list[0]}.{version_list[1]}"
131132
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")
133134
continue
134135
model_shorthand = _model_shorthand.get(model_dir.stem, model_dir.stem)
135136
if (
136-
model_dir == "p300"
137+
model_dir.stem == "p300"
137138
and int(version_list[0]) == 1
138139
and int(version_list[1]) == 0
139140
):

shared-data/python/tests/pipette/test_validate_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def test_pick_up_configs_configuration_by_nozzle_map_keys() -> None:
6868
for channel_dir in os.listdir(paths_to_validate):
6969
for model_dir in os.listdir(paths_to_validate / channel_dir):
7070
for version_file in os.listdir(paths_to_validate / channel_dir / model_dir):
71+
print(version_file)
7172
version_list = version_file.split(".json")[0].split("_")
7273
built_model: PipetteModel = PipetteModel(
7374
f"{model_dir}_{_channel_model_str[channel_dir]}_v{version_list[0]}.{version_list[1]}"

0 commit comments

Comments
 (0)