Skip to content

Commit

Permalink
fix(shared-data): fix well util for partial-column 8-channel (#16458)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff authored Oct 11, 2024
1 parent 7e42388 commit 83ed3df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions shared-data/js/helpers/__tests__/wellSets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,27 +421,27 @@ describe('getWellSetForMultichannel with pipetteNozzleDetails', () => {
it('returns partial column for 8-channel pipette with partial column config', () => {
const result = getWellSetForMultichannel({
labwareDef: labwareDef,
wellName: 'C1',
wellName: 'G1',
channels: 8,
pipetteNozzleDetails: {
nozzleConfig: 'column',
activeNozzleCount: 4,
},
})
expect(result).toEqual(['C1', 'D1', 'E1', 'F1'])
expect(result).toEqual(['D1', 'E1', 'F1', 'G1'])
})

it('handles edge cases for 8-channel partial column selection', () => {
const bottomEdgeResult = getWellSetForMultichannel({
const result = getWellSetForMultichannel({
labwareDef: labwareDef,
wellName: 'G1',
wellName: 'C1',
channels: 8,
pipetteNozzleDetails: {
nozzleConfig: 'column',
activeNozzleCount: 4,
},
})
expect(bottomEdgeResult).toEqual(['G1', 'H1'])
expect(result).toEqual(['A1', 'B1', 'C1'])
})

it('returns full plate for 96-channel pipette with no config', () => {
Expand Down
7 changes: 6 additions & 1 deletion shared-data/js/helpers/wellSets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export const makeWellSetHelpers = (): WellSetHelpers => {
return wellSetByPrimaryWell
}

// TODO(jh 10-10-24): The partial tip logic is strongly coupled to lower-level partial tip API changes.
// Consider alternative methods for deriving well sets when in partial nozzle configurations.
const getWellSetForMultichannel = ({
labwareDef,
wellName,
Expand Down Expand Up @@ -142,7 +144,10 @@ export const makeWellSetHelpers = (): WellSetHelpers => {
const wellIndex = targetColumn.indexOf(wellName)

// If there are fewer wells than active nozzles, only select as many wells as there are nozzles.
return targetColumn.slice(wellIndex, wellIndex + activeNozzleCount)
return targetColumn.slice(
Math.max(wellIndex - activeNozzleCount + 1, 0),
wellIndex + 1
)
}

if (channels === 8) {
Expand Down

0 comments on commit 83ed3df

Please sign in to comment.