Skip to content

Commit

Permalink
Merge branch 'edge' into RET-1025_handle_motor_driver_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Nov 13, 2023
2 parents c6c6b6b + 882c75b commit 7ff959f
Show file tree
Hide file tree
Showing 503 changed files with 30,736 additions and 5,022 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ update-server/**
robot-server/**
notify-server/**
shared-data/python/**
hardware-testing/**

# app-testing don't format the json protocols
app-testing/files
48 changes: 24 additions & 24 deletions api-client/src/deck_configuration/__stubs__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,63 @@ import {
import type { Fixture } from '@opentrons/shared-data'

export const DECK_CONFIG_STUB: { [fixtureLocation: string]: Fixture } = {
A1: {
fixtureLocation: 'A1',
cutoutA1: {
fixtureLocation: 'cutoutA1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
B1: {
fixtureLocation: 'B1',
cutoutB1: {
fixtureLocation: 'cutoutB1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
C1: {
fixtureLocation: 'C1',
cutoutC1: {
fixtureLocation: 'cutoutC1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
D1: {
fixtureLocation: 'D1',
cutoutD1: {
fixtureLocation: 'cutoutD1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
A2: {
fixtureLocation: 'A2',
cutoutA2: {
fixtureLocation: 'cutoutA2',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
B2: {
fixtureLocation: 'B2',
cutoutB2: {
fixtureLocation: 'cutoutB2',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
C2: {
fixtureLocation: 'C2',
cutoutC2: {
fixtureLocation: 'cutoutC2',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
D2: {
fixtureLocation: 'D2',
cutoutD2: {
fixtureLocation: 'cutoutD2',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
A3: {
fixtureLocation: 'A3',
cutoutA3: {
fixtureLocation: 'cutoutA3',
loadName: TRASH_BIN_LOAD_NAME,
fixtureId: uuidv4(),
},
B3: {
fixtureLocation: 'B3',
cutoutB3: {
fixtureLocation: 'cutoutB3',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
C3: {
fixtureLocation: 'C3',
cutoutC3: {
fixtureLocation: 'cutoutC3',
loadName: STAGING_AREA_LOAD_NAME,
fixtureId: uuidv4(),
},
D3: {
fixtureLocation: 'D3',
cutoutD3: {
fixtureLocation: 'cutoutD3',
loadName: WASTE_CHUTE_LOAD_NAME,
fixtureId: uuidv4(),
},
Expand Down
56 changes: 1 addition & 55 deletions api-client/src/protocols/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@ import {
parseLiquidsInLoadOrder,
parseLabwareInfoByLiquidId,
parseInitialLoadedLabwareByAdapter,
parseInitialLoadedFixturesByCutout,
} from '../utils'
import { simpleAnalysisFileFixture } from '../__fixtures__'

import {
LoadFixtureRunTimeCommand,
RunTimeCommand,
STAGING_AREA_LOAD_NAME,
STANDARD_SLOT_LOAD_NAME,
WASTE_CHUTE_LOAD_NAME,
} from '@opentrons/shared-data'
import { RunTimeCommand } from '@opentrons/shared-data'

const mockRunTimeCommands: RunTimeCommand[] = simpleAnalysisFileFixture.commands as any
const mockLoadLiquidRunTimeCommands = [
Expand Down Expand Up @@ -366,53 +359,6 @@ describe('parseInitialLoadedModulesBySlot', () => {
)
})
})
describe('parseInitialLoadedFixturesByCutout', () => {
it('returns fixtures loaded in cutouts', () => {
const loadFixtureCommands: LoadFixtureRunTimeCommand[] = [
{
id: 'fakeId1',
commandType: 'loadFixture',
params: {
loadName: STAGING_AREA_LOAD_NAME,
location: { cutout: 'B3' },
},
createdAt: 'fake_timestamp',
startedAt: 'fake_timestamp',
completedAt: 'fake_timestamp',
status: 'succeeded',
},
{
id: 'fakeId2',
commandType: 'loadFixture',
params: { loadName: WASTE_CHUTE_LOAD_NAME, location: { cutout: 'D3' } },
createdAt: 'fake_timestamp',
startedAt: 'fake_timestamp',
completedAt: 'fake_timestamp',
status: 'succeeded',
},
{
id: 'fakeId3',
commandType: 'loadFixture',
params: {
loadName: STANDARD_SLOT_LOAD_NAME,
location: { cutout: 'C3' },
},
createdAt: 'fake_timestamp',
startedAt: 'fake_timestamp',
completedAt: 'fake_timestamp',
status: 'succeeded',
},
]
const expected = {
B3: loadFixtureCommands[0],
D3: loadFixtureCommands[1],
C3: loadFixtureCommands[2],
}
expect(parseInitialLoadedFixturesByCutout(loadFixtureCommands)).toEqual(
expected
)
})
})
describe('parseLiquidsInLoadOrder', () => {
it('returns liquids in loaded order', () => {
const expected = [
Expand Down
59 changes: 59 additions & 0 deletions api-client/src/protocols/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
ModuleModel,
PipetteName,
RunTimeCommand,
AddressableAreaName,
} from '@opentrons/shared-data'

interface PipetteNamesByMount {
Expand Down Expand Up @@ -228,6 +229,7 @@ export function parseInitialLoadedModulesBySlot(
export interface LoadedFixturesBySlot {
[slotName: string]: LoadFixtureRunTimeCommand
}
// TODO(bh, 2023-11-09): remove this util, there will be no loadFixture command
export function parseInitialLoadedFixturesByCutout(
commands: RunTimeCommand[]
): LoadedFixturesBySlot {
Expand All @@ -244,6 +246,63 @@ export function parseInitialLoadedFixturesByCutout(
)
}

export function parseAllAddressableAreas(
commands: RunTimeCommand[]
): AddressableAreaName[] {
return commands.reduce<AddressableAreaName[]>((acc, command) => {
if (
command.commandType === 'moveLabware' &&
command.params.newLocation !== 'offDeck' &&
'slotName' in command.params.newLocation &&
!acc.includes(command.params.newLocation.slotName as AddressableAreaName)
) {
return [
...acc,
command.params.newLocation.slotName as AddressableAreaName,
]
} else if (
command.commandType === 'moveLabware' &&
command.params.newLocation !== 'offDeck' &&
'addressableAreaName' in command.params.newLocation &&
!acc.includes(
command.params.newLocation.addressableAreaName as AddressableAreaName
)
) {
return [
...acc,
command.params.newLocation.addressableAreaName as AddressableAreaName,
]
} else if (
(command.commandType === 'loadLabware' ||
command.commandType === 'loadModule') &&
command.params.location !== 'offDeck' &&
'slotName' in command.params.location &&
!acc.includes(command.params.location.slotName as AddressableAreaName)
) {
return [...acc, command.params.location.slotName as AddressableAreaName]
} else if (
command.commandType === 'loadLabware' &&
command.params.location !== 'offDeck' &&
'addressableAreaName' in command.params.location &&
!acc.includes(
command.params.location.addressableAreaName as AddressableAreaName
)
) {
return [
...acc,
command.params.location.addressableAreaName as AddressableAreaName,
]
}
// TODO(BC, 11/6/23): once moveToAddressableArea command exists add it back here
// else if (command.commandType === 'moveToAddressableArea') {
// ...
// }
else {
return acc
}
}, [])
}

export interface LiquidsById {
[liquidId: string]: {
displayName: string
Expand Down
3 changes: 2 additions & 1 deletion api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ push-no-restart-ot3: sdist
echo $(sdist_file)
$(call push-python-sdist,$(host),$(ssh_key),$(ssh_opts),$(sdist_file),/opt/opentrons-robot-server,opentrons,src,,$(version_file))
ssh $(ssh_helper) root@$(host) "mount -o remount,rw / && mkdir -p /usr/local/bin"
scp $(ssh_helper) ./src/opentrons/hardware_control/scripts/{ot3repl,ot3gripper} root@$(host):/usr/local/bin/
scp $(ssh_helper) ./src/opentrons/hardware_control/scripts/ot3repl root@$(host):/usr/local/bin/
scp $(ssh_helper) ./src/opentrons/hardware_control/scripts/ot3gripper root@$(host):/usr/local/bin/
ssh $(ssh_helper) root@$(host) "mount -o remount,ro /"

.PHONY: push-ot3
Expand Down
9 changes: 9 additions & 0 deletions api/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ log][]. For a list of currently known issues, please see the [Opentrons issue tr
[technical change log]: https://github.com/Opentrons/opentrons/releases
[opentrons issue tracker]: https://github.com/Opentrons/opentrons/issues?q=is%3Aopen+is%3Aissue+label%3Abug


## Opentrons Robot Software Changes in 7.0.2

The 7.0.2 hotfix release does not contain any changes to the robot software

### Known Issues

JSON protocols created or modified with Protocol Designer v6.0.0 or higher can't be simulated with the `opentrons_simulate` command-line tool

---

## Opentrons Robot Software Changes in 7.0.1
Expand Down
44 changes: 38 additions & 6 deletions api/src/opentrons/hardware_control/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ async def home(self, axes: Optional[List[Axis]] = None) -> None:
if any(unsupported):
raise UnsupportedHardwareCommand(
message=f"At least one axis in {axes} is not supported on the OT2.",
detail={"unsupported_axes": unsupported},
detail={"unsupported_axes": str(unsupported)},
)
self._reset_last_mount()
# Initialize/update current_position
Expand Down Expand Up @@ -661,14 +661,14 @@ async def current_position(
raise PositionUnknownError(
message=f"Current position of {str(mount)} pipette is unknown,"
" please home.",
detail={"mount": str(mount), "missing_axes": position_axes},
detail={"mount": str(mount), "missing_axes": str(position_axes)},
)
axes_str = [ot2_axis_to_string(a) for a in position_axes]
if not self._backend.is_homed(axes_str):
unhomed = self._backend._unhomed_axes(axes_str)
raise PositionUnknownError(
message=f"{str(mount)} pipette axes ({unhomed}) must be homed.",
detail={"mount": str(mount), "unhomed_axes": unhomed},
detail={"mount": str(mount), "unhomed_axes": str(unhomed)},
)
elif not self._current_position and not refresh:
raise PositionUnknownError(
Expand Down Expand Up @@ -755,7 +755,7 @@ async def move_axes(
"""
raise UnsupportedHardwareCommand(
message="move_axes is not supported on the OT-2.",
detail={"axes_commanded": list(position.keys())},
detail={"axes_commanded": str(list(position.keys()))},
)

async def move_rel(
Expand All @@ -781,7 +781,7 @@ async def move_rel(
" is unknown.",
detail={
"mount": str(mount),
"fail_on_not_homed": fail_on_not_homed,
"fail_on_not_homed": str(fail_on_not_homed),
},
)
else:
Expand All @@ -797,7 +797,7 @@ async def move_rel(
unhomed = self._backend._unhomed_axes(axes_str)
raise PositionUnknownError(
message=f"{str(mount)} pipette axes ({unhomed}) must be homed.",
detail={"mount": str(mount), "unhomed_axes": unhomed},
detail={"mount": str(mount), "unhomed_axes": str(unhomed)},
)

await self._cache_and_maybe_retract_mount(mount)
Expand Down Expand Up @@ -1084,6 +1084,38 @@ async def blow_out(
blowout_spec.instr.set_current_volume(0)
blowout_spec.instr.ready_to_aspirate = False

async def update_nozzle_configuration_for_mount(
self,
mount: top_types.Mount,
back_left_nozzle: Optional[str],
front_right_nozzle: Optional[str],
starting_nozzle: Optional[str] = None,
) -> None:
"""
Update a nozzle configuration for a given pipette.
The expectation of this function is that the back_left_nozzle/front_right_nozzle are the two corners
of a rectangle of nozzles. A call to this function that does not follow that schema will result
in an error.
:param mount: A robot mount that the instrument is on.
:param back_left_nozzle: A string representing a nozzle name of the form <LETTER><NUMBER> such as 'A1'.
:param front_right_nozzle: A string representing a nozzle name of the form <LETTER><NUMBER> such as 'A1'.
:param starting_nozzle: A string representing the starting nozzle which will be used as the critical point
of the pipette nozzle configuration. By default, the back left nozzle will be the starting nozzle if
none is provided.
:return: None.
If none of the nozzle parameters are provided, the nozzle configuration will be reset to default.
"""
if not back_left_nozzle and not front_right_nozzle and not starting_nozzle:
await self.reset_nozzle_configuration(mount)
else:
assert back_left_nozzle and front_right_nozzle
await self.update_nozzle_configuration(
mount, back_left_nozzle, front_right_nozzle, starting_nozzle
)

async def pick_up_tip(
self,
mount: top_types.Mount,
Expand Down
Loading

0 comments on commit 7ff959f

Please sign in to comment.