Skip to content

Commit

Permalink
Merge branch 'edge' into components_refactor-update-basedeck-styling
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Nov 14, 2023
2 parents 8022d16 + 44c3f56 commit 836be65
Show file tree
Hide file tree
Showing 235 changed files with 3,910 additions and 29,291 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
build-ll:
name: 'build labware library artifact'
needs: ['js-unit-test']
timeout-minutes: 30
runs-on: 'ubuntu-20.04'
if: github.event_name != 'pull_request'
steps:
Expand Down
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)

Check warning on line 257 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 257 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
) {
return [
...acc,
command.params.newLocation.slotName as AddressableAreaName,

Check warning on line 261 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 261 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
]
} else if (
command.commandType === 'moveLabware' &&
command.params.newLocation !== 'offDeck' &&
'addressableAreaName' in command.params.newLocation &&
!acc.includes(
command.params.newLocation.addressableAreaName as AddressableAreaName

Check warning on line 268 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 268 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
)
) {
return [
...acc,
command.params.newLocation.addressableAreaName as AddressableAreaName,

Check warning on line 273 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 273 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
]
} 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)

Check warning on line 280 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 280 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
) {
return [...acc, command.params.location.slotName as AddressableAreaName]

Check warning on line 282 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 282 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
} else if (
command.commandType === 'loadLabware' &&
command.params.location !== 'offDeck' &&
'addressableAreaName' in command.params.location &&
!acc.includes(
command.params.location.addressableAreaName as AddressableAreaName

Check warning on line 288 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 288 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
)
) {
return [
...acc,
command.params.location.addressableAreaName as AddressableAreaName,

Check warning on line 293 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 293 in api-client/src/protocols/utils.ts

View workflow job for this annotation

GitHub Actions / js checks

This assertion is unnecessary since it does not change the type of the expression
]
}
// 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
Empty file.
Loading

0 comments on commit 836be65

Please sign in to comment.