opentrons icon indicating copy to clipboard operation
opentrons copied to clipboard

bug: Complex commands don't reject invalid kwargs

Open SyntaxColoring opened this issue 4 years ago • 0 comments

Overview

The transfer(), distribute(), and consolidate() commands (at least; there may be more) silently ignore kwargs that don't actually exist.

So, if you make a silly typo, your protocol will silently do the wrong thing instead of raising an error.

Steps to reproduce

This protocol runs "successfully."

metadata = {"apiLevel": "2.2"}

def run(protocol):
    tip_rack = protocol.load_labware("opentrons_96_tiprack_300ul", 1)
    plate = protocol.load_labware("corning_24_wellplate_3.4ml_flat", 2)
    pipette = protocol.load_instrument("p300_single_gen2", mount="right", tip_racks=[tip_rack])

    pipette.transfer(100, plate.wells()[0], plate.wells()[1], this_kwarg_does_not_exist=True)
    pipette.distribute(100, plate.wells()[0], plate.columns()[2], this_kwarg_does_not_exist=True)
    pipette.consolidate(100, plate.columns()[2], plate.wells()[0], this_kwarg_does_not_exist=True)
    

Expected behavior

This should raise TypeError, which is what Python normally raises when unexpected kwargs are provided.

┆Issue is synchronized with this Wrike Task by Unito

SyntaxColoring avatar Feb 27 '20 20:02 SyntaxColoring