Skip to content

feat(api): allow setting a fixed override to '..byVolume' properties#18456

Merged
sanni-t merged 2 commits intoedgefrom
AUTH-1654-api-add_flow_rate_static_overriders
May 29, 2025
Merged

feat(api): allow setting a fixed override to '..byVolume' properties#18456
sanni-t merged 2 commits intoedgefrom
AUTH-1654-api-add_flow_rate_static_overriders

Conversation

@sanni-t
Copy link
Copy Markdown
Member

@sanni-t sanni-t commented May 29, 2025

Closes AUTH-1654

Overview

Adds a method LiquidHandlingPropertyByVolume.set_fixed_override() which overrides the existing 'by volume' values with the provided value

You would use this in a protocol like this-

water = simulated_protocol_context.define_liquid_class("water")
water_props = water.get_for(pipette_50, tiprack)

# Set flow rate of 20uL/sec for all volumes
water_props.aspirate.flow_rate_by_volume.set_for_all_volumes(20)

Test Plan and Hands on Testing

Added unit/ smoke tests. Should be enough

Review requests

  • any objections to the method name?

Risk assessment

Low-None. Very small addition to functionality that doesn't change any existing behavior.

@sanni-t sanni-t requested a review from jbleon95 May 29, 2025 18:51
@sanni-t sanni-t requested a review from a team as a code owner May 29, 2025 18:51
@sanni-t sanni-t requested a review from ddcc4 May 29, 2025 19:21
# Test resetting to default
subject.reset_values()
assert subject.as_dict() == {5.0: 50, 10.0: 250}
assert subject.get_for_volume(7) == 130.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since you're testing for volume=7 here, it would be nice if the test above (line 459) also tested for volume=7, to demonstrate how the value changes as you call the API functions.

def set_fixed_override(self, value: float) -> None:
"""Override all existing volume-dependent values with the given value."""
self.clear_values()
self.set_for_volume(0, value)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, would it make sense to call your new function set_for_all_volumes(), as a nice contrast to the existing function set_for_volume()?

@sanni-t sanni-t merged commit 6e1e58d into edge May 29, 2025
24 checks passed
ddcc4 pushed a commit that referenced this pull request May 29, 2025
…18456)

Closes AUTH-1654

# Overview

Adds a method `LiquidHandlingPropertyByVolume.set_fixed_override()`
which overrides the existing 'by volume' values with the provided value

You would use this in a protocol like this-
```
water = simulated_protocol_context.define_liquid_class("water")
water_props = water.get_for(pipette_50, tiprack)

# Set flow rate of 20uL/sec for all volumes
water_props.aspirate.flow_rate_by_volume.set_for_all_volumes(20)
```

## Risk assessment

Low-None. Very small addition to functionality that doesn't change any
existing behavior.

(cherry picked from commit 6e1e58d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants