feat(api): allow setting a fixed override to '..byVolume' properties#18456
Merged
feat(api): allow setting a fixed override to '..byVolume' properties#18456
Conversation
ddcc4
reviewed
May 29, 2025
| # 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 |
Contributor
There was a problem hiding this comment.
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.
ddcc4
reviewed
May 29, 2025
| 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) |
Contributor
There was a problem hiding this comment.
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()?
ddcc4
approved these changes
May 29, 2025
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)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes AUTH-1654
Overview
Adds a method
LiquidHandlingPropertyByVolume.set_fixed_override()which overrides the existing 'by volume' values with the provided valueYou would use this in a protocol like this-
Test Plan and Hands on Testing
Added unit/ smoke tests. Should be enough
Review requests
Risk assessment
Low-None. Very small addition to functionality that doesn't change any existing behavior.