-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): simulation allows aspirating and dispensing on a tip rack (#…
…7788) * fix(api): simulation allows aspirating and dispensing on a tip rack Doing the most basic fix and testing whether the destination is a tip-rack. I don't like it. It seems like there is a nicer and more general solution to validation problems. Though it looks like validation is often combined with type constraining. Will either put up a draft PR or pursue alternative: - refactor `aspirate` to see if the destination is a tiprack and raise runtime error if it is. - create a test protocol to unit test - adding change to .gitignore to include package-lock.json as it does not seem to be in the project but is generated if one does `npm install` on the root. * - refactor test protocol name so that it doesn't deviate from the convention already used (though no bug protocol scripts, I don't think) * Refactoring my initial approach 'cause old man linter complained about complexity. And happily he did 'cause I totally disregarded dispense. Have since: - moved validation to keep validation in instrument.py company - unit test them - fix linting issues * - fix my comments * - fix linting * - addressing PR feedback and updating such that we constrain `validate_can_dispense` to locations as it cannot be anything other - updating unit tests * - bumping version as requested and documenting change * - API version checking validation and have come full circle and am causing lint complexity issues. Silencing 'cause I don't feel like refactoring the method as there is no complexity introduced that the method has not already had a taste of. * - addressing more feedback which pointed out that I am able to constrain types that may be aspirated and dispensed to `Location` * - taking suggested change to change log Co-authored-by: Mike Cousins <[email protected]> * - update version to next release as suggested Co-authored-by: Mike Cousins <[email protected]> Co-authored-by: Mike Cousins <[email protected]>
- Loading branch information
Showing
8 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from opentrons import protocol_api | ||
|
||
# metadata | ||
metadata = { | ||
'protocolName': 'Bug 7552', | ||
'author': 'Name <[email protected]>', | ||
'description': 'Simulation allows aspirating and dispensing on a tip rack', | ||
'apiLevel': '2.11' | ||
} | ||
|
||
|
||
# protocol run function. the part after the colon lets your editor know | ||
# where to look for autocomplete suggestions | ||
def run(protocol: protocol_api.ProtocolContext): | ||
# labware | ||
plate = protocol.load_labware('geb_96_tiprack_10ul', 4) | ||
|
||
# pipettes | ||
pipette = protocol.load_instrument('p300_single', 'left', tip_racks=[plate]) | ||
|
||
# commands | ||
pipette.transfer(5, plate.wells_by_name()['A1'], plate.wells_by_name()['B1']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters