Opentrons / opentrons

Software for writing protocols and running them on the Opentrons Flex and Opentrons OT-2
https://opentrons.com
Apache License 2.0
429 stars 179 forks source link

Shared data: add `metadata.format` and other metadata fields to labware defs; use in API/PD/RunApp #1499

Closed IanLondon closed 5 years ago

IanLondon commented 6 years ago

All of Python API, Run App, and PD need to know if a given labware is a tiprack. Right now they're inferring it from labware type (to the effect of is_tiprack = 'tiprack' in 'tiprack-200ul')

This is hacky. Instead, we should have a flag in labware definitions that tells us if a labware is a tiprack or not.

Also, PD would benefit from a general displayCategory metadata field in order to sort labware by category. If we don't put this field in the definitions, PD will have to keep its own external labware type: category data to display labware by category.

It seems like a nice metadata to have for any consumers of our labware definitions to have.

Acceptance criteria

Labware Definitions

FINISHED :heavy_check_mark:

TODO: :pencil2:

Protocol Designer

PD should look in shared-data/definitions and check metadata.isTiprack to determine tiprack or not.

  1. Tiprack inference in protocol-designer/src/file-data/selectors/commands.js - getInitialRobotState reducer. This is to populate the initial tip state of all tiprack labware for tip tracking.
  2. Tiprack inference in protocol-designer/src/labware-ingred/reducers/index.js - labwareOptions reducer. This is to remove tipracks from the Labware selection dropdowns.

TODO: split this out into its own ticket

Python API

Run App

mcous commented 6 years ago

Run App should NOT look in shared-data to determine the isTiprack boolean. It should get isTiprack from the Python server.

I agree that API should tend to be the source of truth for these sorts of things, but given that the app already leans heavily on shared-data for pipettes, until the API is the source of all truth about pipettes, I'm fine to use shared-data for labware, too.

IanLondon commented 6 years ago

@mcous I talked to @btmorr about this late Friday & he's planning to stop keeping user's shared-data in the CD card & instead put it in the wheel so it's tied to each version. So Run App could safely use shared-data as long as it's the same version as the app.

(Related: we don't need separate JSON files for custom labware because instead they can be defined in either the .py's or the .json protocols, which aids reproducibility.)

For JSON protocols, app can get labware category from the protocol

Right now the labware "type" eg trough-12row is all that is supplied in JSON protocols (along with nickname & slot), so presently JSON protocols rely on their interpreter having synchronized labware definitions. Makes sense to include other data too, though, as you suggest. Maybe all of it?

mcous commented 5 years ago

@IanLondon this ticket looks to be closed based on its acceptance criteria. Please re-open if I'm mistaken!