Skip to content

Commit 867b374

Browse files
committed
chore(shared-data): format reversions
1 parent d5ecd37 commit 867b374

28 files changed

+194
-227
lines changed

shared-data/command/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export interface CommandNote {
5555
export type CommandStatus = 'queued' | 'running' | 'succeeded' | 'failed'
5656
export type CommandIntent = 'protocol' | 'setup' | 'fixit'
5757
export interface CommonCommandRunTimeInfo<
58-
DefinedErrorsT extends DefinedRunCommandError = DefinedRunCommandError
58+
DefinedErrorsT extends DefinedRunCommandError = DefinedRunCommandError,
5959
> {
6060
key?: string
6161
id: string

shared-data/deck/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const latestDeckDefinitions = {
3737

3838
export function getDeckDefinitions(): Record<string, DeckDefinition> {
3939
return Object.values(
40-
(latestDeckDefinitions as unknown) as DeckDefinition[]
40+
latestDeckDefinitions as unknown as DeckDefinition[]
4141
).reduce<Record<string, DeckDefinition>>((acc, deckDef) => {
4242
return { ...acc, [deckDef.otId]: deckDef }
4343
}, {})

shared-data/errors/types/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
22
import ERROR_DATA from '../definitions/1/errors.json'
33

4-
export type ErrorCategories = keyof typeof ERROR_DATA['categories']
4+
export type ErrorCategories = keyof (typeof ERROR_DATA)['categories']
55
export interface CategorySpec {
66
detail: string
77
codePrefix: string
88
}
9-
export type ErrorCodes = keyof typeof ERROR_DATA['codes']
9+
export type ErrorCodes = keyof (typeof ERROR_DATA)['codes']
1010
export interface ErrorSpec {
1111
detail: string
1212
category: ErrorCategories

shared-data/js/__tests__/labwareDefSchemaV2.test.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ const expectedWellsNotMatchingZDimension: Record<string, Set<string>> = {
8484
]),
8585

8686
// This is probably legitimate. Heterogeneous tubes.
87-
'opentrons_40_aluminumblock_eppendorf_24x2ml_safelock_snapcap_generic_16x0.2ml_pcr_strip': new Set(
88-
[
87+
'opentrons_40_aluminumblock_eppendorf_24x2ml_safelock_snapcap_generic_16x0.2ml_pcr_strip':
88+
new Set([
8989
'A3',
9090
'B3',
9191
'C3',
@@ -110,8 +110,7 @@ const expectedWellsNotMatchingZDimension: Record<string, Set<string>> = {
110110
'B8',
111111
'C8',
112112
'D8',
113-
]
114-
),
113+
]),
115114

116115
// These height mismatches are legitimate. The zDimension should match the taller side.
117116
opentrons_calibrationblock_short_side_left: new Set(['A1']),
@@ -123,9 +122,12 @@ const expectedWellsNotMatchingZDimension: Record<string, Set<string>> = {
123122

124123
// These were probably bugs, but it's moot now, since these adapter+wellplate
125124
// combo-definitions have been superseded by proper labware stacking.
126-
opentrons_96_flat_bottom_adapter_nest_wellplate_200ul_flat: standard96WellNames,
127-
opentrons_96_pcr_adapter_nest_wellplate_100ul_pcr_full_skirt: standard96WellNames,
128-
opentrons_universal_flat_adapter_corning_384_wellplate_112ul_flat: standard384WellNames,
125+
opentrons_96_flat_bottom_adapter_nest_wellplate_200ul_flat:
126+
standard96WellNames,
127+
opentrons_96_pcr_adapter_nest_wellplate_100ul_pcr_full_skirt:
128+
standard96WellNames,
129+
opentrons_universal_flat_adapter_corning_384_wellplate_112ul_flat:
130+
standard384WellNames,
129131

130132
// This batch may have incompletely-updated geometry from recent work related to
131133
// liquid level detection and meniscus-relative pipetting. Probably, the wells were
@@ -374,9 +376,8 @@ const checkGeometryDefinitions = (labwareDef: LabwareDefinition2): void => {
374376
const depthFromWell = well.depth
375377
const xyDimensionsFromWell = extractXYDimensionsFromWell(well)
376378
const depthFromGeometry = topSection.topHeight
377-
const xyDimensionsFromGeometry = extractTopDimensionsFromGeometrySection(
378-
topSection
379-
)
379+
const xyDimensionsFromGeometry =
380+
extractTopDimensionsFromGeometrySection(topSection)
380381

381382
const labwareWithWellDepthMismatches = [
382383
// todo(mm, 2025-03-17): Investigate and resolve these mismatches.
@@ -627,9 +628,7 @@ function isInnerWellGeometry(
627628
* Extract some shape-specific properties from a well.
628629
* Fall back to undefined if that property doesn't exist, given the well's shape.
629630
*/
630-
function extractXYDimensionsFromWell(
631-
well: LabwareWell
632-
): {
631+
function extractXYDimensionsFromWell(well: LabwareWell): {
633632
diameter?: number
634633
xDimension?: number
635634
yDimension?: number
@@ -650,9 +649,7 @@ function extractXYDimensionsFromWell(
650649
* Extract some shape-specific properties from a geometry section.
651650
* Fall back to undefined if that property doesn't exist, given the geometry section's shape.
652651
*/
653-
function extractTopDimensionsFromGeometrySection(
654-
section: WellSegment
655-
): {
652+
function extractTopDimensionsFromGeometrySection(section: WellSegment): {
656653
diameter?: number
657654
xDimension?: number
658655
yDimension?: number

shared-data/js/__tests__/labwareDefSchemaV3.test.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,8 @@ const checkExtents = (labwareDef: LabwareDefinition3): void => {
7070
})
7171
test('extents.footprint should be contained inside extents.total', () => {
7272
if (labwareDef.features.slotFootprintAsChild) {
73-
const {
74-
backLeft,
75-
frontRight,
76-
z,
77-
} = labwareDef.features.slotFootprintAsChild
73+
const { backLeft, frontRight, z } =
74+
labwareDef.features.slotFootprintAsChild
7875
const {
7976
total: { backLeftBottom, frontRightTop },
8077
} = labwareDef.extents
@@ -125,10 +122,8 @@ describe(`test labware definitions with schema v3`, () => {
125122

126123
test('slotFootprintAsChild properly uses back-left bottom origin with quadrant IV coordinates', () => {
127124
if (labwareDef.features.slotFootprintAsChild) {
128-
const {
129-
backLeft,
130-
frontRight,
131-
} = labwareDef.features.slotFootprintAsChild
125+
const { backLeft, frontRight } =
126+
labwareDef.features.slotFootprintAsChild
132127

133128
expect(backLeft.x).toBe(0)
134129
expect(backLeft.y).toBe(0)

shared-data/js/constants.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,8 @@ export const FLEX_STAGING_ADDRESSABLE_AREAS: AddressableAreaName[] = [
541541
ABSORBANCE_READER_LID_DOCK_D4_ADDRESSABLE_AREA,
542542
]
543543

544-
export const FLEX_STAGING_ADDRESSABLE_AREAS_WITH_FAKES: AddressableAreaNamesWithFakes[] = [
545-
...FLEX_STAGING_ADDRESSABLE_AREAS,
546-
...FAKE_AA,
547-
]
544+
export const FLEX_STAGING_ADDRESSABLE_AREAS_WITH_FAKES: AddressableAreaNamesWithFakes[] =
545+
[...FLEX_STAGING_ADDRESSABLE_AREAS, ...FAKE_AA]
548546

549547
export const ADDRESSABLE_AREA_1: '1' = '1'
550548
export const ADDRESSABLE_AREA_2: '2' = '2'
@@ -738,10 +736,8 @@ export const WASTE_CHUTE_ONLY_FIXTURES: CutoutFixtureId[] = [
738736
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
739737
]
740738

741-
export const WASTE_CHUTE_ONLY_FIXTURES_WITH_FAKES: CutoutFixtureIdsWithFakes[] = [
742-
...WASTE_CHUTE_ONLY_FIXTURES,
743-
FAKE_WASTE_CHUTE_WITH_EMPTY_SLOT_FIXTURE,
744-
]
739+
export const WASTE_CHUTE_ONLY_FIXTURES_WITH_FAKES: CutoutFixtureIdsWithFakes[] =
740+
[...WASTE_CHUTE_ONLY_FIXTURES, FAKE_WASTE_CHUTE_WITH_EMPTY_SLOT_FIXTURE]
745741

746742
export const WASTE_CHUTE_STAGING_AREA_FIXTURES: CutoutFixtureId[] = [
747743
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
@@ -774,7 +770,8 @@ export const MODULE_FIXTURES_BY_MODEL: {
774770
[FLEX_STACKER_MODULE_V1]: [FLEX_STACKER_V1_FIXTURE],
775771
}
776772

777-
export const DEFAULT_AA_FOR_WASTE_CHUTE = ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA
773+
export const DEFAULT_AA_FOR_WASTE_CHUTE =
774+
ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA
778775

779776
export const STAGING_AREA_FIXTURES: CutoutFixtureId[] = [
780777
STAGING_AREA_RIGHT_SLOT_FIXTURE,

shared-data/js/fixtures.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,11 +1445,8 @@ export const getWasteChuteComboFixture = (
14451445
aaCutoutItem: CutoutConfigMap,
14461446
deckConfigWithAA: CutoutConfigMap[]
14471447
): CutoutConfig | null => {
1448-
const {
1449-
cutoutId,
1450-
cutoutFixtureId,
1451-
opentronsModuleSerialNumber,
1452-
} = aaCutoutItem
1448+
const { cutoutId, cutoutFixtureId, opentronsModuleSerialNumber } =
1449+
aaCutoutItem
14531450
// Check if this is a valid waste chute cutout with compatible fixtures
14541451
if (
14551452
cutoutId !== WASTE_CHUTE_CUTOUT ||
@@ -1527,9 +1524,9 @@ export const replaceCutoutFixtureWithComboFixture = (
15271524
}
15281525

15291526
// Filter potential combo fixture options
1530-
const comboFixturesOptions = Object.entries(
1531-
addressableAreasById
1532-
).filter(([_, areaIds]) => areaIds.includes(aaCutoutItem.addressableAreaId))
1527+
const comboFixturesOptions = Object.entries(addressableAreasById).filter(
1528+
([_, areaIds]) => areaIds.includes(aaCutoutItem.addressableAreaId)
1529+
)
15331530
// Try to match with deck config
15341531
for (const dc of deckConfigWithAA) {
15351532
const match = comboFixturesOptions.find(([, areaIds]) =>
@@ -1678,20 +1675,24 @@ export const getFlexStackerD3Compatibility = (
16781675
)
16791676
) {
16801677
return {
1681-
comboFixtureId: deckConfigCompatabilityD3.cutoutFixtureId as CutoutFixtureId,
1682-
comboFixtureConflict: !deckConfigCompatabilityD3?.compatibleCutoutFixtureIds.includes(
1683-
deckConfigCompatabilityD3.cutoutFixtureId
1684-
),
1678+
comboFixtureId:
1679+
deckConfigCompatabilityD3.cutoutFixtureId as CutoutFixtureId,
1680+
comboFixtureConflict:
1681+
!deckConfigCompatabilityD3?.compatibleCutoutFixtureIds.includes(
1682+
deckConfigCompatabilityD3.cutoutFixtureId
1683+
),
16851684
}
16861685
}
16871686

1688-
const comboFixtureId = deckConfigCompatabilityD3?.compatibleCutoutFixtureIds.find(
1689-
fixtureId => !fixtureId.startsWith('fake')
1690-
) as CutoutFixtureId | undefined
1687+
const comboFixtureId =
1688+
deckConfigCompatabilityD3?.compatibleCutoutFixtureIds.find(
1689+
fixtureId => !fixtureId.startsWith('fake')
1690+
) as CutoutFixtureId | undefined
16911691

1692-
const comboFixtureConflict = !deckConfigCompatabilityD3?.compatibleCutoutFixtureIds.includes(
1693-
deckConfigCompatabilityD3.cutoutFixtureId
1694-
)
1692+
const comboFixtureConflict =
1693+
!deckConfigCompatabilityD3?.compatibleCutoutFixtureIds.includes(
1694+
deckConfigCompatabilityD3.cutoutFixtureId
1695+
)
16951696

16961697
return {
16971698
comboFixtureId,
@@ -1720,9 +1721,8 @@ export const getCutoutConfigReplacmentForModule = (
17201721
moduleModel: ModuleModel,
17211722
deckConfig: CutoutConfig[]
17221723
): CutoutFixtureId => {
1723-
const deckConfigWithAA = replaceFixtureToFakeFixtureAndTransformCutoutFixturesToAA(
1724-
deckConfig
1725-
)
1724+
const deckConfigWithAA =
1725+
replaceFixtureToFakeFixtureAndTransformCutoutFixturesToAA(deckConfig)
17261726
const mainAA = getAAForModuleFixture(cutoutId, fixtureId, moduleModel)
17271727
const addedCutoutConfigs: CutoutConfigMap[] = [
17281728
{

shared-data/js/helpers/__tests__/getFixedTrashLabwareDefinition.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { LabwareDefinition } from '../..'
88
describe('getFixedTrashLabwareDefinition', () => {
99
it(`should return the fixed trash labware defition`, () => {
1010
expect(getFixedTrashLabwareDefinition()).toEqual(
11-
(fixedTrashUncasted as unknown) as LabwareDefinition
11+
fixedTrashUncasted as unknown as LabwareDefinition
1212
)
1313
})
1414
})

shared-data/js/helpers/__tests__/getSimplestFlexDeckConfig.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
2626
)
2727
})
2828
it.only('returns staging area fixtures if commands address column 4 areas', () => {
29-
const cutoutConfigs = getSimplestDeckConfigForProtocol(({
29+
const cutoutConfigs = getSimplestDeckConfigForProtocol({
3030
commands: [
3131
{
3232
...RUN_TIME_COMMAND_STUB_MIXIN,
@@ -70,7 +70,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
7070
},
7171
],
7272
labware: [],
73-
} as unknown) as CompletedProtocolAnalysis)
73+
} as unknown as CompletedProtocolAnalysis)
7474
expect(cutoutConfigs).toEqual([
7575
...FLEX_SIMPLEST_DECK_CONFIG_PROTOCOL_SPEC.slice(0, 8),
7676
{
@@ -96,7 +96,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
9696
])
9797
})
9898
it('returns simplest cutout fixture where many are possible', () => {
99-
const cutoutConfigs = getSimplestDeckConfigForProtocol(({
99+
const cutoutConfigs = getSimplestDeckConfigForProtocol({
100100
commands: [
101101
{
102102
...RUN_TIME_COMMAND_STUB_MIXIN,
@@ -109,7 +109,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
109109
},
110110
],
111111
labware: [],
112-
} as unknown) as CompletedProtocolAnalysis)
112+
} as unknown as CompletedProtocolAnalysis)
113113
expect(cutoutConfigs).toEqual([
114114
...FLEX_SIMPLEST_DECK_CONFIG_PROTOCOL_SPEC.slice(0, 11),
115115
{
@@ -120,7 +120,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
120120
])
121121
})
122122
it('returns compatible cutout fixture where multiple addressable requirements present', () => {
123-
const cutoutConfigs = getSimplestDeckConfigForProtocol(({
123+
const cutoutConfigs = getSimplestDeckConfigForProtocol({
124124
commands: [
125125
{
126126
...RUN_TIME_COMMAND_STUB_MIXIN,
@@ -142,7 +142,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
142142
},
143143
],
144144
labware: [],
145-
} as unknown) as CompletedProtocolAnalysis)
145+
} as unknown as CompletedProtocolAnalysis)
146146
expect(cutoutConfigs).toEqual([
147147
...FLEX_SIMPLEST_DECK_CONFIG_PROTOCOL_SPEC.slice(0, 11),
148148
{
@@ -153,7 +153,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
153153
])
154154
})
155155
it('returns deck with trash in A3 when legacy trash labware is present', () => {
156-
const cutoutConfigs = getSimplestDeckConfigForProtocol(({
156+
const cutoutConfigs = getSimplestDeckConfigForProtocol({
157157
commands: [],
158158
labware: [
159159
{
@@ -164,7 +164,7 @@ describe('getSimplestDeckConfigForProtocol', () => {
164164
location: { slotName: 'A3' },
165165
},
166166
],
167-
} as unknown) as CompletedProtocolAnalysis)
167+
} as unknown as CompletedProtocolAnalysis)
168168
expect(cutoutConfigs).toEqual([
169169
...FLEX_SIMPLEST_DECK_CONFIG_PROTOCOL_SPEC.slice(0, 8),
170170
{

shared-data/js/helpers/__tests__/parseProtocolCommands.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import {
1717

1818
import type { RunTimeCommand } from '../../../command/types'
1919

20-
const mockRunTimeCommands: RunTimeCommand[] = simpleAnalysisFileFixture.commands as any
20+
const mockRunTimeCommands: RunTimeCommand[] =
21+
simpleAnalysisFileFixture.commands as any
2122
const mockLoadLiquidRunTimeCommands = [
2223
{
2324
id: '97ba49a5-04f6-4f91-986a-04a0eb632882',
@@ -194,7 +195,7 @@ describe('parseRequiredModulesEntity', () => {
194195
})
195196
describe('parseInitialLoadedLabwareByAdapter', () => {
196197
it('returns only labware loaded in adapters', () => {
197-
const mockCommandsWithAdapter = ([
198+
const mockCommandsWithAdapter = [
198199
{
199200
id: 'commands.LOAD_LABWARE-2',
200201
createdAt: '2022-04-01T15:46:01.745870+00:00',
@@ -274,7 +275,7 @@ describe('parseInitialLoadedLabwareByAdapter', () => {
274275
startedAt: '2022-04-01T15:46:01.745870+00:00',
275276
completedAt: '2022-04-01T15:46:01.745870+00:00',
276277
},
277-
] as any) as RunTimeCommand[]
278+
] as any as RunTimeCommand[]
278279
const labware2 = 'labware-2'
279280

280281
const expected = {
@@ -314,7 +315,7 @@ describe('parseInitialLoadedLabwareBySlot', () => {
314315
)
315316
})
316317
it('returns labware loaded in addressable areas', () => {
317-
const mockAddressableAreaLoadedLabwareCommand = ([
318+
const mockAddressableAreaLoadedLabwareCommand = [
318319
{
319320
id: 'commands.LOAD_LABWARE-3',
320321
createdAt: '2022-04-01T15:46:01.745870+00:00',
@@ -340,7 +341,7 @@ describe('parseInitialLoadedLabwareBySlot', () => {
340341
startedAt: '2022-04-01T15:46:01.745870+00:00',
341342
completedAt: '2022-04-01T15:46:01.745870+00:00',
342343
},
343-
] as any) as RunTimeCommand[]
344+
] as any as RunTimeCommand[]
344345

345346
const expected = {
346347
D4: mockAddressableAreaLoadedLabwareCommand.find(

0 commit comments

Comments
 (0)