@opentrons/shared-data 0.0.0-alpha.2 → 0.0.1-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Makefile CHANGED
@@ -3,9 +3,6 @@
3
3
  # using bash instead of /bin/bash in SHELL prevents macOS optimizing away our PATH update
4
4
  SHELL := bash
5
5
 
6
- # TODO(mc, 2018-10-25): use dist to match other projects
7
- BUILD_DIR := build
8
-
9
6
  # These variables can be overriden when make is invoked to customize the
10
7
  # behavior of jest
11
8
  tests ?=
@@ -28,17 +25,12 @@ clean: clean-js clean-py
28
25
 
29
26
  # JavaScript targets
30
27
 
31
- .PHONY: setup-js
32
- setup-js: dist-js
28
+ .PHONY: lib-js
29
+ lib-js: export NODE_ENV := production
30
+ lib-js:
31
+ yarn webpack
33
32
 
34
- .PHONY: dist-js
35
- dist-js:
36
- @yarn shx mkdir -p $(BUILD_DIR)
37
- node js/scripts/build.js $(BUILD_DIR)
38
33
 
39
- .PHONY: clean-js
40
- clean-js:
41
- yarn shx rm -rf $(BUILD_DIR)
42
34
 
43
35
  # Python targets
44
36
 
@@ -469,14 +469,14 @@
469
469
  "enum": ["SINGLE"],
470
470
  "type": "string"
471
471
  },
472
- "primary_nozzle": {
473
- "title": "Primary Nozzle",
472
+ "primaryNozzle": {
473
+ "title": "Primarynozzle",
474
474
  "description": "The primary nozzle to use in the layout configuration. This nozzle will update the critical point of the current pipette. For now, this is also the back left corner of your rectangle.",
475
475
  "enum": ["A1", "H1", "A12", "H12"],
476
476
  "type": "string"
477
477
  }
478
478
  },
479
- "required": ["primary_nozzle"]
479
+ "required": ["primaryNozzle"]
480
480
  },
481
481
  "RowNozzleLayoutConfiguration": {
482
482
  "title": "RowNozzleLayoutConfiguration",
@@ -489,14 +489,14 @@
489
489
  "enum": ["ROW"],
490
490
  "type": "string"
491
491
  },
492
- "primary_nozzle": {
493
- "title": "Primary Nozzle",
492
+ "primaryNozzle": {
493
+ "title": "Primarynozzle",
494
494
  "description": "The primary nozzle to use in the layout configuration. This nozzle will update the critical point of the current pipette. For now, this is also the back left corner of your rectangle.",
495
495
  "enum": ["A1", "H1", "A12", "H12"],
496
496
  "type": "string"
497
497
  }
498
498
  },
499
- "required": ["primary_nozzle"]
499
+ "required": ["primaryNozzle"]
500
500
  },
501
501
  "ColumnNozzleLayoutConfiguration": {
502
502
  "title": "ColumnNozzleLayoutConfiguration",
@@ -509,14 +509,14 @@
509
509
  "enum": ["COLUMN"],
510
510
  "type": "string"
511
511
  },
512
- "primary_nozzle": {
513
- "title": "Primary Nozzle",
512
+ "primaryNozzle": {
513
+ "title": "Primarynozzle",
514
514
  "description": "The primary nozzle to use in the layout configuration. This nozzle will update the critical point of the current pipette. For now, this is also the back left corner of your rectangle.",
515
515
  "enum": ["A1", "H1", "A12", "H12"],
516
516
  "type": "string"
517
517
  }
518
518
  },
519
- "required": ["primary_nozzle"]
519
+ "required": ["primaryNozzle"]
520
520
  },
521
521
  "QuadrantNozzleLayoutConfiguration": {
522
522
  "title": "QuadrantNozzleLayoutConfiguration",
@@ -529,20 +529,20 @@
529
529
  "enum": ["QUADRANT"],
530
530
  "type": "string"
531
531
  },
532
- "primary_nozzle": {
533
- "title": "Primary Nozzle",
532
+ "primaryNozzle": {
533
+ "title": "Primarynozzle",
534
534
  "description": "The primary nozzle to use in the layout configuration. This nozzle will update the critical point of the current pipette. For now, this is also the back left corner of your rectangle.",
535
535
  "enum": ["A1", "H1", "A12", "H12"],
536
536
  "type": "string"
537
537
  },
538
- "front_right_nozzle": {
539
- "title": "Front Right Nozzle",
538
+ "frontRightNozzle": {
539
+ "title": "Frontrightnozzle",
540
540
  "description": "The front right nozzle in your configuration.",
541
541
  "pattern": "[A-Z][0-100]",
542
542
  "type": "string"
543
543
  }
544
544
  },
545
- "required": ["primary_nozzle", "front_right_nozzle"]
545
+ "required": ["primaryNozzle", "frontRightNozzle"]
546
546
  },
547
547
  "ConfigureNozzleLayoutParams": {
548
548
  "title": "ConfigureNozzleLayoutParams",
@@ -554,8 +554,8 @@
554
554
  "description": "Identifier of pipette to use for liquid handling.",
555
555
  "type": "string"
556
556
  },
557
- "configuration_params": {
558
- "title": "Configuration Params",
557
+ "configurationParams": {
558
+ "title": "Configurationparams",
559
559
  "anyOf": [
560
560
  {
561
561
  "$ref": "#/definitions/AllNozzleLayoutConfiguration"
@@ -575,7 +575,7 @@
575
575
  ]
576
576
  }
577
577
  },
578
- "required": ["pipetteId", "configuration_params"]
578
+ "required": ["pipetteId", "configurationParams"]
579
579
  },
580
580
  "ConfigureNozzleLayoutCreate": {
581
581
  "title": "ConfigureNozzleLayoutCreate",
@@ -167,9 +167,15 @@ interface RetractAxisParams {
167
167
  axis: MotorAxis
168
168
  }
169
169
 
170
+ interface AddressableOffsetVector {
171
+ x: number
172
+ y: number
173
+ z: number
174
+ }
170
175
  export interface MoveToAddressableAreaParams {
171
176
  pipetteId: string
172
177
  addressableAreaName: string
178
+ offset: AddressableOffsetVector
173
179
  speed?: number
174
180
  minimumZHeight?: number
175
181
  forceDirect?: boolean
@@ -179,21 +179,21 @@ const COLUMN = 'COLUMN'
179
179
  const SINGLE = 'SINGLE'
180
180
  const ROW = 'ROW'
181
181
  const QUADRANT = 'QUADRANT'
182
- const EMPTY = 'EMPTY'
182
+ const ALL = 'ALL'
183
183
 
184
184
  export type NozzleConfigurationStyle =
185
185
  | typeof COLUMN
186
186
  | typeof SINGLE
187
187
  | typeof ROW
188
188
  | typeof QUADRANT
189
- | typeof EMPTY
189
+ | typeof ALL
190
190
 
191
191
  interface NozzleConfigurationParams {
192
- primary_nozzle: string
192
+ primaryNozzle: string
193
193
  style: NozzleConfigurationStyle
194
194
  }
195
195
 
196
196
  interface ConfigureNozzleLayoutParams {
197
197
  pipetteId: string
198
- configuration_params: NozzleConfigurationParams
198
+ configurationParams: NozzleConfigurationParams
199
199
  }
package/js/constants.ts CHANGED
@@ -334,3 +334,5 @@ export const WASTE_CHUTE_STAGING_AREA_FIXTURES: CutoutFixtureId[] = [
334
334
  STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
335
335
  STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
336
336
  ]
337
+
338
+ export const LOW_VOLUME_PIPETTES = ['p50_single_flex', 'p50_multi_flex']
package/js/getLabware.ts CHANGED
@@ -1,7 +1,4 @@
1
- import assert from 'assert'
2
1
  import mapValues from 'lodash/mapValues'
3
- // TODO: Ian 2019-06-04 remove the shared-data build process for labware v1
4
- import definitions from '../build/labware.json'
5
2
 
6
3
  import {
7
4
  FIXED_TRASH_RENDER_HEIGHT,
@@ -15,11 +12,6 @@ import type {
15
12
  WellDefinition,
16
13
  } from './types'
17
14
 
18
- assert(
19
- definitions && Object.keys(definitions).length > 0,
20
- 'Expected v1 labware defs. Something went wrong with shared-data/build/labware.json'
21
- )
22
-
23
15
  // do not list in any "available labware" UI.
24
16
  // TODO(mc, 2019-12-3): how should this correspond to RETIRED_LABWARE?
25
17
  // see shared-data/js/helpers/index.js
@@ -0,0 +1,59 @@
1
+ import type { AddressableAreaName } from '../../deck'
2
+ import type { RunTimeCommand } from '../../protocol'
3
+
4
+ export function getAddressableAreasInProtocol(
5
+ commands: RunTimeCommand[]
6
+ ): AddressableAreaName[] {
7
+ return commands.reduce<AddressableAreaName[]>((acc, command) => {
8
+ if (
9
+ command.commandType === 'moveLabware' &&
10
+ command.params.newLocation !== 'offDeck' &&
11
+ 'slotName' in command.params.newLocation &&
12
+ !acc.includes(command.params.newLocation.slotName as AddressableAreaName)
13
+ ) {
14
+ return [
15
+ ...acc,
16
+ command.params.newLocation.slotName as AddressableAreaName,
17
+ ]
18
+ } else if (
19
+ command.commandType === 'moveLabware' &&
20
+ command.params.newLocation !== 'offDeck' &&
21
+ 'addressableAreaName' in command.params.newLocation &&
22
+ !acc.includes(
23
+ command.params.newLocation.addressableAreaName as AddressableAreaName
24
+ )
25
+ ) {
26
+ return [
27
+ ...acc,
28
+ command.params.newLocation.addressableAreaName as AddressableAreaName,
29
+ ]
30
+ } else if (
31
+ (command.commandType === 'loadLabware' ||
32
+ command.commandType === 'loadModule') &&
33
+ command.params.location !== 'offDeck' &&
34
+ 'slotName' in command.params.location &&
35
+ !acc.includes(command.params.location.slotName as AddressableAreaName)
36
+ ) {
37
+ return [...acc, command.params.location.slotName as AddressableAreaName]
38
+ } else if (
39
+ command.commandType === 'loadLabware' &&
40
+ command.params.location !== 'offDeck' &&
41
+ 'addressableAreaName' in command.params.location &&
42
+ !acc.includes(
43
+ command.params.location.addressableAreaName as AddressableAreaName
44
+ )
45
+ ) {
46
+ return [
47
+ ...acc,
48
+ command.params.location.addressableAreaName as AddressableAreaName,
49
+ ]
50
+ } else if (
51
+ command.commandType === 'moveToAddressableArea' &&
52
+ !acc.includes(command.params.addressableAreaName as AddressableAreaName)
53
+ ) {
54
+ return [...acc, command.params.addressableAreaName as AddressableAreaName]
55
+ } else {
56
+ return acc
57
+ }
58
+ }, [])
59
+ }
@@ -27,6 +27,7 @@ export * from './getVectorSum'
27
27
  export * from './getLoadedLabwareDefinitionsByUri'
28
28
  export * from './getOccludedSlotCountForModule'
29
29
  export * from './labwareInference'
30
+ export * from './getAddressableAreasInProtocol'
30
31
 
31
32
  export const getLabwareDefIsStandard = (def: LabwareDefinition2): boolean =>
32
33
  def?.namespace === OPENTRONS_LABWARE_NAMESPACE
@@ -52,7 +52,8 @@ export interface WellSetHelpers {
52
52
 
53
53
  canPipetteUseLabware: (
54
54
  pipetteSpec: PipetteNameSpecs,
55
- labwareDef: LabwareDefinition2
55
+ labwareDef?: LabwareDefinition2,
56
+ trashName?: string
56
57
  ) => boolean
57
58
  }
58
59
 
@@ -123,24 +124,28 @@ export const makeWellSetHelpers = (): WellSetHelpers => {
123
124
 
124
125
  const canPipetteUseLabware = (
125
126
  pipetteSpec: PipetteNameSpecs,
126
- labwareDef: LabwareDefinition2
127
+ labwareDef?: LabwareDefinition2,
128
+ trashName?: string
127
129
  ): boolean => {
128
- if (pipetteSpec.channels === 1) {
130
+ if (pipetteSpec.channels === 1 || trashName != null) {
129
131
  // assume all labware can be used by single-channel
130
132
  return true
131
133
  }
132
-
133
- const allWellSets = getAllWellSetsForLabware(labwareDef)
134
- return allWellSets.some(wellSet => {
135
- const uniqueWells = uniq(wellSet)
136
- // if all wells are non-null, and there are either 1 (reservoir-like)
137
- // or 8 (well plate-like) unique wells in the set,
138
- // then assume both 8 and 96 channel pipettes will work
139
- return (
140
- uniqueWells.every(well => well != null) &&
141
- [1, 8].includes(uniqueWells.length)
142
- )
143
- })
134
+ if (labwareDef != null) {
135
+ const allWellSets = getAllWellSetsForLabware(labwareDef)
136
+ return allWellSets.some(wellSet => {
137
+ const uniqueWells = uniq(wellSet)
138
+ // if all wells are non-null, and there are either 1 (reservoir-like)
139
+ // or 8 (well plate-like) unique wells in the set,
140
+ // then assume both 8 and 96 channel pipettes will work
141
+ return (
142
+ uniqueWells.every(well => well != null) &&
143
+ [1, 8].includes(uniqueWells.length)
144
+ )
145
+ })
146
+ } else {
147
+ return false
148
+ }
144
149
  }
145
150
  return {
146
151
  getAllWellSetsForLabware,