Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rpc): ensure load name is attached to RPC "containers" #4530

Merged
merged 1 commit into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/src/opentrons/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ def __init__(self, container, instruments=None, context=None):
self.is_legacy = container.properties.get(
'labware_hash') is None
else:
# will be labware's load name or label
self.name = container.name
self.type = container.name
# type must be load_name so client can load correct definition
self.type = container.load_name
slot, position = _get_parent_slot_and_position(container)
self.slot = slot
self.position = position
self.is_legacy = False
self.is_tiprack = container.is_tiprack
self.instruments = [
Instrument(instrument)
for instrument in instruments]
Expand Down
6 changes: 6 additions & 0 deletions api/src/opentrons/protocol_api/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ def name(self, new_name):
""" Set the labware name"""
self._name = new_name

@property # type: ignore
@requires_version(2, 0)
def load_name(self) -> str:
""" The API load name of the labware definition """
return self._parameters['loadName']

@property # type: ignore
@requires_version(2, 0)
def parameters(self) -> Dict[str, Any]:
Expand Down
8 changes: 6 additions & 2 deletions app/src/robot/api-client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { getCustomLabwareDefinitions } from '../../custom-labware/selectors'
const RUN_TIME_TICK_INTERVAL_MS = 1000
const NO_INTERVAL = -1
const RE_VOLUME = /.*?(\d+).*?/
const RE_TIPRACK = /tiprack/i
const RE_TIPRACK = /tip ?rack/i

const THIS_ROBOT_DOES_NOT_SUPPORT_BUNDLES =
'This robot does not support ZIP protocol bundles. Please update its software to the latest version and upload this protocol again'
Expand Down Expand Up @@ -573,7 +573,11 @@ export default function client(dispatch) {
position,
is_legacy: isLegacy,
} = apiContainer
const isTiprack = RE_TIPRACK.test(type)
const isTiprack =
apiContainer.is_tiprack != null
? apiContainer.is_tiprack
: RE_TIPRACK.test(type)

const labware = { _id, name, slot, position, type, isTiprack, isLegacy }

if (isTiprack && apiContainer.instruments.length > 0) {
Expand Down