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

docs(api): describe new distribute() volume clamping behavior #14315

Merged
merged 6 commits into from
Feb 14, 2024

Conversation

ecormany
Copy link
Contributor

@ecormany ecormany commented Jan 12, 2024

Overview

Brings the docs up to date with changes in #14253.

Tagged "do not merge" because this has PAPI 2.17 features. This PR should eventually be retargeted on the feature branch for the first robot stack version that supports 2.17.

Addresses RTC-383.

Test Plan

Check the sandbox.

Changelog

  • Rewrote note about dispense volumes and moved it up in the section (it's not really about push_out anymore)
    • Clamped down on "clamping"
  • Updated bullet on Versioning page
  • Cleaned up docstring for volume argument of dispense()

Review requests

Is there anything more we'd like to say about dispense volumes vis-a-vis push out? I drafted this but I think it's not actually a good real-world example.

If you want to move the plunger a certain amount, regardless of how much has been
aspirated, you can calculate the values of ``volume`` and ``push_out`` based on the
:py:obj:`~InstrumentContext.current_volume` held in the pipette::

    pipette.pick_up_tip()
    plunger_amount=105
    pipette.aspirate(100, plate['A1'])
    pipette.dispense(
        volume=min(plunger_amount, pipette.current_volume), 
        location=plate['B1'], 
        push_out=max(pipette.current_volume-plunger_amount, 0)
    )   # dispense 100, push out 5
    pipette.aspirate(120, plate['A2'])
    pipette.dispense(
        volume=min(plunger_amount, pipette.current_volume), 
        location=plate['B2'], 
        push_out=max(pipette.current_volume-plunger_amount, 0)
    )   # dispense 105, push out 0, 15 left in tip
    pipette.drop_tip()
    
Note that when passing large ``push_out`` values, the plunger can't pass its physical
lower limit. For example, ``push_out=100`` will not have the effect of moving the
plunger the same distance as during a 100 µL dispense. For clearing large amounts
through the pipette, blow out instead.

Risk assessment

v v low, docs and docstrings only.

@ecormany ecormany added docs DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available papi-v2 Python API V2 labels Jan 12, 2024
Copy link

codecov bot commented Jan 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c142da1) 67.79% compared to head (12d8462) 67.79%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #14315      +/-   ##
==========================================
- Coverage   67.79%   67.79%   -0.01%     
==========================================
  Files        2518     2518              
  Lines       72017    72017              
  Branches     9244     9244              
==========================================
- Hits        48826    48824       -2     
- Misses      20989    20990       +1     
- Partials     2202     2203       +1     
Flag Coverage Δ
app 64.58% <ø> (-0.01%) ⬇️
components 49.41% <ø> (ø)
g-code-testing 92.43% <ø> (ø)
labware-library 41.11% <ø> (ø)
protocol-designer 37.93% <ø> (ø)
react-api-client 66.16% <ø> (ø)
step-generation 86.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...i/src/opentrons/protocol_api/instrument_context.py 89.09% <ø> (ø)

... and 1 file with indirect coverage changes

@ecormany ecormany changed the title docs(api): describe new clamping behavior docs(api): describe new distribute() volume clamping behavior Jan 12, 2024
Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks correct to me. Thanks!

api/src/opentrons/protocol_api/instrument_context.py Outdated Show resolved Hide resolved
@ecormany ecormany changed the base branch from edge to docs_release-2.17 February 14, 2024 16:12
@ecormany ecormany marked this pull request as ready for review February 14, 2024 16:13
@ecormany ecormany requested a review from a team as a code owner February 14, 2024 16:13
@ecormany ecormany merged commit 1bb01a9 into docs_release-2.17 Feb 14, 2024
45 of 46 checks passed
@ecormany ecormany removed the DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available label Feb 15, 2024
ecormany added a commit that referenced this pull request Mar 6, 2024
* move and rewrite note

* update versioning entry

* "API version" instead of "version…of the API"

Co-authored-by: Joe Wojak <jwojak@gmail.com>

* revise note text

* clean up dispense() docstring

* get location out of volume

---------

Co-authored-by: Joe Wojak <jwojak@gmail.com>
@ecormany ecormany deleted the docs-dispense-note branch October 16, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs papi-v2 Python API V2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants