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

feat(step-generation): python commands for temperature module #17650

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Mar 4, 2025

closes AUTH-1100

Overview

This PR adds python command support for the temperature module (deactivate and waitForTemprature). NOTE: setTemperature support is added here

Test Plan and Hands on Testing

Review code but there are unit tests. Also smoke test!

Changelog

  • add temperature module python command support
  • add unit test coverage

Risk assessment

low, behind ff

@jerader jerader requested a review from a team as a code owner March 4, 2025 20:26
@jerader jerader requested a review from ddcc4 March 4, 2025 20:26
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Project coverage is 25.68%. Comparing base (507da17) to head (4b72f82).
Report is 2 commits behind head on edge.

Files with missing lines Patch % Lines
...rc/commandCreators/atomic/deactivateTemperature.ts 66.66% 2 Missing ⚠️
...n/src/commandCreators/atomic/waitForTemperature.ts 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #17650   +/-   ##
=======================================
  Coverage   25.68%   25.68%           
=======================================
  Files        2851     2851           
  Lines      219457   219468   +11     
  Branches    17971    17973    +2     
=======================================
+ Hits        56363    56371    +8     
- Misses     163079   163082    +3     
  Partials       15       15           
Flag Coverage Δ
protocol-designer 18.94% <15.38%> (-0.01%) ⬇️
step-generation 4.38% <76.92%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
step-generation/src/fixtures/robotStateFixtures.ts 97.82% <100.00%> (+0.01%) ⬆️
...n/src/commandCreators/atomic/waitForTemperature.ts 68.96% <80.00%> (+0.29%) ⬆️
...rc/commandCreators/atomic/deactivateTemperature.ts 55.38% <66.66%> (+0.38%) ⬆️

const moduleType = invariantContext.moduleEntities[moduleId]?.type
const module = invariantContext.moduleEntities[moduleId]
const moduleType = module?.type
const modulePythonName = module?.pythonName
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there ever a case where module is undefined? Are you only doing the module? thing because the typechecker wants it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm actually, good question. i don't think we should hit this since we throw an error if it is null. i'll remove it

@@ -83,6 +84,7 @@ export const waitForTemperature: CommandCreator<TemperatureParams> = (
},
],
warnings: warnings.length > 0 ? warnings : undefined,
python: pythonCommand,
Copy link
Contributor

Choose a reason for hiding this comment

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

Stylistic question: Do people prefer to name the variable python so that you can just say:

{
  ...,
  python,
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh good call, i can change that!

const moduleType = invariantContext.moduleEntities[moduleId]?.type
const module = invariantContext.moduleEntities[moduleId]
const moduleType = module?.type
const pythonCommand = `${module?.pythonName}.wait_for_temperature(${celsius})`
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey, I'm having trouble finding the wait_for_temperature() function in the API that takes a temperature argument. Could you point me to where it is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ahh good question. i just looked in the api docs, and i don't see it either. i don't see the temperature module even emitting wait_for_temperature, i only see it referenced for a heater-shaker 🤔 let me double check with the backend team

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