Skip to content

Commit

Permalink
logic is hard
Browse files Browse the repository at this point in the history
  • Loading branch information
ecormany committed May 2, 2024
1 parent b12942e commit f086614
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/docs/v2/parameters/use_case_dry_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ Returning Tips
Tips used in a dry run should be reusable — for another dry run, if nothing else. It doesn't make sense to dispose of them in a trash container, unless you specifically need to test movement to the trash. You can choose whether to use :py:meth:`.drop_tip` or :py:meth:`.return_tip` based on the value of ``protocol.params.dry_run``. If the protocol doesn't have too many tip drop actions, you can use an ``if`` statement each time::

if protocol.params.dry_run == True:
pipette.drop_tip()
else:
pipette.return_tip()
else:
pipette.drop_tip()

However, repeating this block every time you handle tips could significantly clutter your code. Instead, you could define it as a function::

def return_or_drop(pipette):
if protocol.params.dry_run == True:
pipette.drop_tip()
else:
pipette.return_tip()
else:
pipette.drop_tip()

Then call that function throughout your protocol::

Expand Down

0 comments on commit f086614

Please sign in to comment.