Refactor shaker backend API to use start_shaking#907
Open
j0nch wants to merge 1 commit intoPyLabRobot:mainfrom
Open
Refactor shaker backend API to use start_shaking#907j0nch wants to merge 1 commit intoPyLabRobot:mainfrom
j0nch wants to merge 1 commit intoPyLabRobot:mainfrom
Conversation
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.
Summary
This PR refactors shaker backend naming to make backend semantics explicit and consistent:
start_shaking(...)+stop_shaking(...).Shaker.shake(..., duration=None)remains the orchestration entrypoint for users.shake(...)aliases are kept in concrete implementations for compatibility.Motivation
Previously, backend
shake(...)semantically meant "start shaking", while frontendShaker.shake(...)also handled optional duration/stop behavior. This naming overlap was ambiguous.Using
start_shaking(...)at backend level makes intent clearer and aligns withstop_shaking(...).Changes
Shaker backend contract
pylabrobot/shaking/backend.pyShakerBackendnow defines abstractstart_shaking(speed: float).Shaker frontend
pylabrobot/shaking/shaker.pyShaker.shake(...)now callsbackend.start_shaking(...).durationsupport unchanged).Chatterbox backend
pylabrobot/shaking/chatterbox.pystart_shaking(...).shake(...)alias with warning, forwarding tostart_shaking(...)for migration parity with hardware backends.Heater-shaker backend implementations aligned
pylabrobot/heating_shaking/hamilton_backend.pystart_shaking(...).shake(...)alias forwarding tostart_shaking(...).pylabrobot/heating_shaking/inheco/thermoshake_backend.pystart_shaking(...).shake(...)alias forwarding tostart_shaking(...).pylabrobot/heating_shaking/bioshake_backend.pystart_shaking(...)shake(...)alias forwarding tostart_shaking(...).Backward compatibility
.shake(...)continue to work in concrete backends via deprecation aliases..start_shaking(...)at backend level.Testing / validation
Executed: