Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Aug 20, 2024
2 parents add5cf2 + 9289993 commit 82543de
Show file tree
Hide file tree
Showing 33 changed files with 145 additions and 97 deletions.
7 changes: 5 additions & 2 deletions abr-testing/abr_testing/data_collection/abr_robot_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,11 @@ def get_run_error_info_from_robot(
errored_labware_dict["Slot"] = labware["location"].get("slotName", "")
errored_labware_dict["Labware Type"] = labware.get("definitionUri", "")
offset_id = labware.get("offsetId", "")
if offset_id == "":
labware_slot = errored_labware_dict["Slot"]
labware_slot = errored_labware_dict["Slot"]
if str(labware_slot) == "":
lpc_message = "No labware slot was associated with this error. \
Please manually check LPC data."
elif offset_id == "":
lpc_message = f"The current LPC coords found at {labware_slot} are (0, 0, 0). \
Please confirm with the ABR-LPC sheet and re-LPC."
else:
Expand Down
4 changes: 4 additions & 0 deletions api/src/opentrons/config/defaults_ot3.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
sensor_threshold_pascals=15,
output_option=OutputOptions.sync_buffer_to_csv,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "/data/pressure_sensor_data.csv"},
Expand Down Expand Up @@ -345,6 +346,9 @@ def _build_default_liquid_probe(
aspirate_while_sensing=from_conf.get(
"aspirate_while_sensing", default.aspirate_while_sensing
),
z_overlap_between_passes_mm=from_conf.get(
"z_overlap_between_passes_mm", default.z_overlap_between_passes_mm
),
samples_for_baselining=from_conf.get(
"samples_for_baselining", default.samples_for_baselining
),
Expand Down
1 change: 1 addition & 0 deletions api/src/opentrons/config/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class LiquidProbeSettings:
sensor_threshold_pascals: float
output_option: OutputOptions
aspirate_while_sensing: bool
z_overlap_between_passes_mm: float
samples_for_baselining: int
sample_time_sec: float
data_files: Optional[Dict[InstrumentProbeType, str]]
Expand Down
6 changes: 3 additions & 3 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2707,14 +2707,14 @@ async def liquid_probe(
instrument.backlash_distance + sensor_baseline_plunger_move_mm
)
# height where probe action will begin
# TODO: (sigler) add this to pipette's liquid def (per tip)
z_overlap_between_passes_mm = 0.1
sensor_baseline_z_move_mm = OT3API.liquid_probe_non_responsive_z_distance(
probe_settings.mount_speed,
probe_settings.samples_for_baselining,
probe_settings.sample_time_sec,
)
z_offset_per_pass = sensor_baseline_z_move_mm + z_overlap_between_passes_mm
z_offset_per_pass = (
sensor_baseline_z_move_mm + probe_settings.z_overlap_between_passes_mm
)

# height that is considered safe to reset the plunger without disturbing liquid
# this usually needs to at least 1-2mm from liquid, to avoid splashes from air
Expand Down
1 change: 1 addition & 0 deletions api/tests/opentrons/config/ot3_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"sensor_threshold_pascals": 17,
"output_option": OutputOptions.stream_to_csv,
"aspirate_while_sensing": False,
"z_overlap_between_passes_mm": 0.1,
"samples_for_baselining": 20,
"sample_time_sec": 0.004,
"data_files": {"PRIMARY": "/data/pressure_sensor_data.csv"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def fake_liquid_settings() -> LiquidProbeSettings:
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
Expand Down
8 changes: 6 additions & 2 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def fake_liquid_settings() -> LiquidProbeSettings:
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
Expand Down Expand Up @@ -827,6 +828,7 @@ async def test_liquid_probe(
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=True,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
Expand Down Expand Up @@ -913,7 +915,7 @@ async def test_liquid_probe_plunger_moves(
sample_time_sec,
)

probe_pass_overlap = 0.1
probe_pass_overlap = config.z_overlap_between_passes_mm
probe_pass_z_offset_mm = non_responsive_z_mm + probe_pass_overlap
probe_safe_reset_mm = max(2.0, probe_pass_z_offset_mm)

Expand Down Expand Up @@ -1011,7 +1013,7 @@ async def test_liquid_probe_mount_moves(
sample_time_sec,
)

probe_pass_overlap = 0.1
probe_pass_overlap = config.z_overlap_between_passes_mm
probe_pass_z_offset_mm = non_responsive_z_mm + probe_pass_overlap
probe_safe_reset_mm = max(2.0, probe_pass_z_offset_mm)

Expand Down Expand Up @@ -1080,6 +1082,7 @@ async def test_multi_liquid_probe(
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=True,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
Expand Down Expand Up @@ -1154,6 +1157,7 @@ async def _fake_pos_update_and_raise(
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=True,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
Expand Down
1 change: 1 addition & 0 deletions hardware-testing/hardware_testing/gravimetric/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def _get_liquid_probe_settings(
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
output_option=OutputOptions.sync_only,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files={InstrumentProbeType.PRIMARY: "/data/testing_data/pressure.csv"},
Expand Down
1 change: 1 addition & 0 deletions hardware-testing/hardware_testing/liquid_sense/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def _run_trial(
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
output_option=OutputOptions.sync_buffer_to_csv,
aspirate_while_sensing=run_args.aspirate,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files=data_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,7 @@ async def _test_liquid_probe(
sensor_threshold_pascals=probe_cfg.sensor_threshold_pascals,
output_option=OutputOptions.can_bus_only, # FIXME: remove
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
samples_for_baselining=20,
sample_time_sec=0.004,
data_files=None,
Expand Down
1 change: 0 additions & 1 deletion protocol-designer/src/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export function NavigationBar({
padding={`${SPACING.spacing12} ${SPACING.spacing40}`}
gridGap={SPACING.spacing40}
>
TODO add breadcrumbs here
{navRoutes.map(({ name, navLinkTo }: RouteProps) => (
<NavbarLink key={name} to={navLinkTo}>
<StyledText desktopStyle="bodyDefaultRegular">{name}</StyledText>
Expand Down
17 changes: 5 additions & 12 deletions protocol-designer/src/ProtocolRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Box } from '@opentrons/components'
import { Landing } from './pages/Landing'
import { ProtocolOverview } from './pages/ProtocolOverview'
import { Liquids } from './pages/Liquids'
import { StartingDeckState } from './pages/StartingDeckState'
import { ProtocolSteps } from './pages/ProtocolSteps'
import { Designer } from './pages/Designer'
import { CreateNewProtocolWizard } from './pages/CreateNewProtocolWizard'
import { NavigationBar } from './NavigationBar'

Expand All @@ -26,16 +25,10 @@ const pdRoutes: RouteProps[] = [
path: '/liquids',
},
{
Component: StartingDeckState,
name: 'Starting deck state',
navLinkTo: '/startingDeckState',
path: '/startingDeckState',
},
{
Component: ProtocolSteps,
name: 'Protocol steps',
navLinkTo: '/steps',
path: '/steps',
Component: Designer,
name: 'Edit protocol',
navLinkTo: '/designer',
path: '/designer',
},
{
Component: CreateNewProtocolWizard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"done": "Done",
"edit": "Edit",
"labware": "Labware",
"protocol_starting_deck": "Protocol starting deck",
"reservoir": "Reservoir",
"starting_deck_state": "Starting deck state",
"tipRack": "Tip rack",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
LegacyStyledText,
RobotCoordsForeignDiv,
} from '@opentrons/components'
import { START_TERMINAL_ITEM_ID } from '../../steplist'
import { getDeckSetupForActiveItem } from '../../top-selectors/labware-locations'
import { START_TERMINAL_ITEM_ID } from '../../../steplist'
import { getDeckSetupForActiveItem } from '../../../top-selectors/labware-locations'

import type { CoordinateTuple, Dimensions } from '@opentrons/shared-data'
import type { TerminalItemId } from '../../steplist'
import type { TerminalItemId } from '../../../steplist'

import styles from './DeckSetup.module.css'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
TRASH_BIN_ADAPTER_FIXTURE,
WASTE_CHUTE_CUTOUT,
} from '@opentrons/shared-data'
import { getSelectedTerminalItemId } from '../../ui/steps'
import { getDeckSetupForActiveItem } from '../../top-selectors/labware-locations'
import { getDisableModuleRestrictions } from '../../feature-flags/selectors'
import { getRobotType } from '../../file-data/selectors'
import { getHasGen1MultiChannelPipette } from '../../step-forms'
import { getSelectedTerminalItemId } from '../../../ui/steps'
import { getDeckSetupForActiveItem } from '../../../top-selectors/labware-locations'
import { getDisableModuleRestrictions } from '../../../feature-flags/selectors'
import { getRobotType } from '../../../file-data/selectors'
import { getHasGen1MultiChannelPipette } from '../../../step-forms'
import { SlotDetailsContainer } from './SlotDetailsContainer'
import { DeckSetupDetails } from './DeckSetupDetails'
import { getCutoutIdForAddressableArea } from './utils'
Expand Down Expand Up @@ -60,7 +60,7 @@ const OT2_STANDARD_DECK_VIEW_LAYER_BLOCK_LIST: string[] = [
const lightFill = COLORS.grey35
const darkFill = COLORS.grey60

export function StartingDeckState(): JSX.Element {
export function DeckSetupContainer(): JSX.Element {
const selectedTerminalItemId = useSelector(getSelectedTerminalItemId)
const activeDeckSetup = useSelector(getDeckSetupForActiveItem)
const _disableCollisionWarnings = useSelector(getDisableModuleRestrictions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ import {
SPAN7_8_10_11_SLOT,
THERMOCYCLER_MODULE_TYPE,
} from '@opentrons/shared-data'
import { getSlotIdsBlockedBySpanning, getSlotIsEmpty } from '../../step-forms'
import { LabwareOnDeck } from '../../components/DeckSetup/LabwareOnDeck'
import { SlotWarning } from '../../components/DeckSetup/SlotWarning'
import { getStagingAreaAddressableAreas } from '../../utils'
import {
getSlotIdsBlockedBySpanning,
getSlotIsEmpty,
} from '../../../step-forms'
import { LabwareOnDeck } from '../../../components/DeckSetup/LabwareOnDeck'
import { SlotWarning } from '../../../components/DeckSetup/SlotWarning'
import { getStagingAreaAddressableAreas } from '../../../utils'
import { ControlSelect } from './ControlSelect'

import type { ModuleTemporalProperties } from '@opentrons/step-generation'
Expand All @@ -32,8 +35,8 @@ import type {
InitialDeckSetup,
LabwareOnDeck as LabwareOnDeckType,
ModuleOnDeck,
} from '../../step-forms'
import type { TerminalItemId } from '../../steplist'
} from '../../../step-forms'
import type { TerminalItemId } from '../../../steplist'

interface DeckSetupDetailsProps {
activeDeckSetup: InitialDeckSetup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ import {
getModuleType,
} from '@opentrons/shared-data'

import { getRobotType } from '../../file-data/selectors'
import { getRobotType } from '../../../file-data/selectors'
import {
createDeckFixture,
deleteDeckFixture,
} from '../../step-forms/actions/additionalItems'
import { createModule, deleteModule } from '../../step-forms/actions'
import { getDeckSetupForActiveItem } from '../../top-selectors/labware-locations'
import { createContainer, deleteContainer } from '../../labware-ingred/actions'
} from '../../../step-forms/actions/additionalItems'
import { createModule, deleteModule } from '../../../step-forms/actions'
import { getDeckSetupForActiveItem } from '../../../top-selectors/labware-locations'
import {
createContainer,
deleteContainer,
} from '../../../labware-ingred/actions'
import {
getEnableAbsorbanceReader,
getEnableMoam,
} from '../../feature-flags/selectors'
import { createContainerAboveModule } from '../../step-forms/actions/thunks'
} from '../../../feature-flags/selectors'
import { createContainerAboveModule } from '../../../step-forms/actions/thunks'
import {
FIXTURES,
MAX_MAGNETIC_BLOCKS,
Expand All @@ -42,8 +45,8 @@ import { getModuleModelsBySlot } from './utils'
import { LabwareTools } from './LabwareTools'

import type { CutoutId, DeckSlotId, ModuleModel } from '@opentrons/shared-data'
import type { DeckFixture } from '../../step-forms/actions/additionalItems'
import type { ThunkDispatch } from '../../types'
import type { DeckFixture } from '../../../step-forms/actions/additionalItems'
import type { ThunkDispatch } from '../../../types'
import type { Fixture } from './constants'

interface DeckSetupToolsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ import {
getModuleType,
} from '@opentrons/shared-data'

import { selectors as stepFormSelectors } from '../../step-forms'
import { getOnlyLatestDefs } from '../../labware-defs'
import { selectors as stepFormSelectors } from '../../../step-forms'
import { getOnlyLatestDefs } from '../../../labware-defs'
import {
ADAPTER_96_CHANNEL,
getLabwareIsCompatible as _getLabwareIsCompatible,
} from '../../utils/labwareModuleCompatibility'
import { getHas96Channel } from '../../utils'
import { createCustomLabwareDef } from '../../labware-defs/actions'
import { getRobotType } from '../../file-data/selectors'
import { getCustomLabwareDefsByURI } from '../../labware-defs/selectors'
import { getPipetteEntities } from '../../step-forms/selectors'
} from '../../../utils/labwareModuleCompatibility'
import { getHas96Channel } from '../../../utils'
import { createCustomLabwareDef } from '../../../labware-defs/actions'
import { getRobotType } from '../../../file-data/selectors'
import { getCustomLabwareDefsByURI } from '../../../labware-defs/selectors'
import { getPipetteEntities } from '../../../step-forms/selectors'
import { ORDERED_CATEGORIES } from './constants'
import {
getLabwareIsRecommended,
Expand All @@ -50,9 +50,9 @@ import type {
LabwareDefinition2,
ModuleModel,
} from '@opentrons/shared-data'
import type { ModuleOnDeck } from '../../step-forms'
import type { ThunkDispatch } from '../../types'
import type { LabwareDefByDefURI } from '../../labware-defs'
import type { ModuleOnDeck } from '../../../step-forms'
import type { ThunkDispatch } from '../../../types'
import type { LabwareDefByDefURI } from '../../../labware-defs'
import type { Fixture } from './constants'

const CUSTOM_CATEGORY = 'custom'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { it } from 'vitest'

it.todo('write test for DeckSetupContainer')
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'
import '@testing-library/jest-dom/vitest'
import { fireEvent, screen } from '@testing-library/react'
import { FLEX_ROBOT_TYPE, fixture96Plate } from '@opentrons/shared-data'
import { i18n } from '../../../assets/localization'
import { renderWithProviders } from '../../../__testing-utils__'
import { deleteContainer } from '../../../labware-ingred/actions'
import { createModule, deleteModule } from '../../../step-forms/actions'
import { getRobotType } from '../../../file-data/selectors'
import { i18n } from '../../../../assets/localization'
import { renderWithProviders } from '../../../../__testing-utils__'
import { deleteContainer } from '../../../../labware-ingred/actions'
import { createModule, deleteModule } from '../../../../step-forms/actions'
import { getRobotType } from '../../../../file-data/selectors'
import {
getEnableAbsorbanceReader,
getEnableMoam,
} from '../../../feature-flags/selectors'
} from '../../../../feature-flags/selectors'
import {
createDeckFixture,
deleteDeckFixture,
} from '../../../step-forms/actions/additionalItems'
import { getDeckSetupForActiveItem } from '../../../top-selectors/labware-locations'
} from '../../../../step-forms/actions/additionalItems'
import { getDeckSetupForActiveItem } from '../../../../top-selectors/labware-locations'
import { DeckSetupTools } from '../DeckSetupTools'
import { LabwareTools } from '../LabwareTools'

import type { LabwareDefinition2 } from '@opentrons/shared-data'

vi.mock('../../../feature-flags/selectors')
vi.mock('../../../file-data/selectors')
vi.mock('../../../top-selectors/labware-locations')
vi.mock('../../../../feature-flags/selectors')
vi.mock('../../../../file-data/selectors')
vi.mock('../../../../top-selectors/labware-locations')
vi.mock('../LabwareTools')
vi.mock('../../../labware-ingred/actions')
vi.mock('../../../step-forms/actions')
vi.mock('../../../step-forms/actions/additionalItems')
vi.mock('../../../../labware-ingred/actions')
vi.mock('../../../../step-forms/actions')
vi.mock('../../../../step-forms/actions/additionalItems')

const render = (props: React.ComponentProps<typeof DeckSetupTools>) => {
return renderWithProviders(<DeckSetupTools {...props} />, {
Expand Down
Loading

0 comments on commit 82543de

Please sign in to comment.