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

Write new JSON schema for V3 #3110

Closed
IanLondon opened this issue Feb 21, 2019 · 1 comment · Fixed by #3312
Closed

Write new JSON schema for V3 #3110

IanLondon opened this issue Feb 21, 2019 · 1 comment · Fixed by #3312

Comments

@IanLondon
Copy link
Contributor

IanLondon commented Feb 21, 2019

This ticket should be updated to include any changes we want to make in the V3 protocol json schema. The result of this ticket will be a protocolSchemaV3.json file added to shared-data/.

This ticket does NOT include making PD save V3 protocols, or loading V3 protocols in Run App / JSON executor/ etc. This ticket is a prereq of all that work, and is just concerned with writing the schema definition which we will move towards.

Changes for the next JSON schema:

  • Convert all kebab-cased keys to camelCase
  • Remove pipette-model and all pipette "model" related fields. Require "name" field for pipette, no longer optional.
  • Set the version number as part of the schema (eg schemaVersion: 3 is required, value must be the integer 3 for it to be a valid schema v3 protocol). From v3 onward, schema-version / schemaVersion will be an integer, not a semver string.
  • make touchTipMmFromTop required under defaultValues - no longer optional (WIP: any missing defaultValues?)
  • Make labware key contain labware definitions, remove labware.model and use newlabware.definition
  • ! Make sure all params are sealed with "additionalProperties": false -- unless it's impossible w/ ref reuse :/

STUFF WE HAVEN'T ALL TALKED ABOUT: Breaking procedure up

Make procedure a flat array (call it commands), and use an optional commandAnnotations object to keep an arbitrarily-nested array of description objects that references indicies in commands. The commandAnnotations could be used for the RA run log when it is present.

Since we aren't sure what kind of data will go in there, let's leave commandAnnotations permissive - it's an optional object of arbitrary shape. That means to use it, the consumer (Run App) will need to be defensive, or we'll have to release a new JSON protocol schema version.

The 2 motivations are that procedures/subProcedures does not allow arbitrarily deep nesting, only one level -- but annotations in the Run Log might be better deep. And, keeping commands flat and un-annotated will make the JSON executor's task simpler.

@Koeng101
Copy link

Koeng101 commented Mar 6, 2019

A json command including move_to-like command with coords would be very beneficial for colony picking applications. For example,

"command": "moveToCoords", "params": { "pipette": pipette, "labware": labware, "coordinates": coords}

In addition, it would be useful to be able to set offsets in the commands themselves. For example, here is exactly what I'd want to do in a plating protocol to avoid agar stabs blocking the pipette:

    {
      "command": "moveToLocation",
      "params": {
        "pipette": pipette,
        "labware": labware,
        "well": well,
        "offset": { "x": 0, "y": 0, "z": -10}
    {
      "command": "dispense",
      "params": {
        "pipette": pipette,
        "volume": 7.5,
        "labware": labware,
        "well": well,
        "offset": { "x": 0, "y": 0, "z": -10}
      }
    {
      "command": "moveToLocation",
      "params": {
        "pipette": pipette,
        "labware": labware,
        "well": well,
        "offset": { "x": 0, "y": 0, "z": 0}
    },

I appreciate flattening of commands: this can basically be summed up with zen of python rule #5

@IanLondon IanLondon changed the title Write new JSON schema for V2 Write new JSON schema for V3 Mar 22, 2019
IanLondon added a commit that referenced this issue Apr 3, 2019
note: only for APIv2 executor

Closes #3110
IanLondon added a commit that referenced this issue Apr 4, 2019
@IanLondon IanLondon removed the WIP label Apr 4, 2019
@IanLondon IanLondon added the large label Apr 4, 2019
@IanLondon IanLondon self-assigned this Apr 4, 2019
IanLondon added a commit that referenced this issue Apr 5, 2019
* define v3 json protocol schema
* support v3 JSON protocol execution in APIv2 executor

Closes #3110
IanLondon added a commit that referenced this issue Apr 5, 2019
* define v3 json protocol schema
* support v3 JSON protocol execution in APIv2 executor

Closes #3110
IanLondon added a commit that referenced this issue Apr 9, 2019
* define v3 json protocol schema
* support v3 JSON protocol execution in APIv2 executor

Closes #3110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment