Skip to content

Commit

Permalink
refactor(api): remove feature-flag dependency from calibration_storage (
Browse files Browse the repository at this point in the history
#13833)

* Removed FF dependency when importing calibration_storage, moved around where imports are publicized
* robot server import changes to match new calibration_storage import methodology
* Split some tests into ot2/ot3 variants
* Modified settings reset to have to be specified as OT2 or OT3 by caller
* removed tip length cal utils on OT3 because they are not used ever
* Fixed robot server calibration flows to avoid importing OT-3 utilities that are irrelevant to OT-2 workflows
  • Loading branch information
fsinapi authored Oct 31, 2023
1 parent 196fdc0 commit 2a06a3a
Show file tree
Hide file tree
Showing 27 changed files with 388 additions and 501 deletions.
69 changes: 7 additions & 62 deletions api/src/opentrons/calibration_storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from opentrons import config

from .ot3 import ot3_gripper_offset
from .ot3 import gripper_offset
from .ot2 import mark_bad_calibration

# TODO these functions are only used in robot server. We should think about moving them and/or
Expand All @@ -23,79 +21,26 @@
delete_robot_deck_attitude,
)

if config.feature_flags.enable_ot3_hardware_controller():
from .ot3.pipette_offset import (
save_pipette_calibration,
clear_pipette_offset_calibrations,
get_pipette_offset,
delete_pipette_offset_file,
)
from .ot3.tip_length import (
clear_tip_length_calibration,
create_tip_length_data,
save_tip_length_calibration,
tip_lengths_for_pipette,
load_tip_length_calibration,
delete_tip_length_calibration,
)
from .ot3 import models
from .ot3.module_offset import (
save_module_calibration,
clear_module_offset_calibrations,
get_module_offset,
delete_module_offset_file,
load_all_module_offsets,
)
else:
from .ot2.pipette_offset import (
save_pipette_calibration,
clear_pipette_offset_calibrations,
get_pipette_offset,
delete_pipette_offset_file,
)
from .ot2.tip_length import (
clear_tip_length_calibration,
create_tip_length_data,
save_tip_length_calibration,
tip_lengths_for_pipette,
load_tip_length_calibration,
delete_tip_length_calibration,
)
from .ot2 import models # type: ignore[no-redef]
from . import ot2, ot3, helpers

__all__ = [
"helpers",
# deck calibration functions
"save_robot_deck_attitude",
"get_robot_deck_attitude",
"delete_robot_deck_attitude",
"save_robot_belt_attitude",
"get_robot_belt_attitude",
"delete_robot_belt_attitude",
# pipette calibration functions
"save_pipette_calibration",
"get_pipette_offset",
"clear_pipette_offset_calibrations",
"delete_pipette_offset_file",
# tip length calibration functions
"clear_tip_length_calibration",
"create_tip_length_data",
"save_tip_length_calibration",
"tip_lengths_for_pipette",
"delete_tip_length_calibration",
"load_tip_length_calibration",
# module calibration functions
"save_module_calibration",
"clear_module_offset_calibrations",
"get_module_offset",
"delete_module_offset_file",
"load_all_module_offsets",
# functions only used in robot server
"_save_custom_tiprack_definition",
"get_custom_tiprack_definition_for_tlc",
"get_all_pipette_offset_calibrations",
"get_all_tip_length_calibrations",
# file exports
"models",
"ot3_gripper_offset",
"gripper_offset",
"mark_bad_calibration",
# Platform specific submodules
"ot2",
"ot3",
]
28 changes: 26 additions & 2 deletions api/src/opentrons/calibration_storage/ot2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
from . import (
models as ot2_models,
models,
mark_bad_calibration,
)
from .pipette_offset import (
save_pipette_calibration,
clear_pipette_offset_calibrations,
get_pipette_offset,
delete_pipette_offset_file,
)

from .tip_length import (
clear_tip_length_calibration,
create_tip_length_data,
save_tip_length_calibration,
tip_lengths_for_pipette,
load_tip_length_calibration,
delete_tip_length_calibration,
)

__all__ = [
"ot2_models",
"models",
"mark_bad_calibration",
"save_pipette_calibration",
"clear_pipette_offset_calibrations",
"get_pipette_offset",
"delete_pipette_offset_file",
"clear_tip_length_calibration",
"create_tip_length_data",
"save_tip_length_calibration",
"tip_lengths_for_pipette",
"load_tip_length_calibration",
"delete_tip_length_calibration",
]
31 changes: 26 additions & 5 deletions api/src/opentrons/calibration_storage/ot3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
from . import (
models as ot3_models,
gripper_offset as ot3_gripper_offset,
models,
gripper_offset as gripper_offset,
)
from .pipette_offset import (
save_pipette_calibration,
clear_pipette_offset_calibrations,
get_pipette_offset,
delete_pipette_offset_file,
)
from .module_offset import (
save_module_calibration,
clear_module_offset_calibrations,
get_module_offset,
delete_module_offset_file,
load_all_module_offsets,
)


__all__ = [
"ot3_models",
"ot3_gripper_offset",
"models",
"gripper_offset",
"save_pipette_calibration",
"clear_pipette_offset_calibrations",
"get_pipette_offset",
"delete_pipette_offset_file",
"save_module_calibration",
"clear_module_offset_calibrations",
"get_module_offset",
"delete_module_offset_file",
"load_all_module_offsets",
]
181 changes: 0 additions & 181 deletions api/src/opentrons/calibration_storage/ot3/tip_length.py

This file was deleted.

Loading

0 comments on commit 2a06a3a

Please sign in to comment.