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): plate reader python commands #17646

Merged
merged 3 commits into from
Mar 5, 2025

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Mar 4, 2025

closes AUTH-1512

Overview

this PR creates the python commands for the 4 plate reader commands: open lid, close lid, initialize, and read. For reading, the output is a CSV file and not imbedded in the python protocol, since PD only supports outputting into a CSV file right now.

Test Plan and Hands on Testing

Review the unit tests and smoke test!

Changelog

  • add python command for the 4 plate reader commands
  • add unit test coverage

Risk assessment

low, behind ff

@jerader jerader requested a review from a team as a code owner March 4, 2025 16:32
@jerader jerader requested review from ddcc4 and ncdiehl11 March 4, 2025 16:32
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.89%. Comparing base (8a9bb57) to head (cad7a3d).
Report is 14 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #17646      +/-   ##
==========================================
+ Coverage   25.69%   25.89%   +0.20%     
==========================================
  Files        2850     2851       +1     
  Lines      219383   220087     +704     
  Branches    17970    18220     +250     
==========================================
+ Hits        56363    56998     +635     
- Misses     163005   163074      +69     
  Partials       15       15              
Flag Coverage Δ
protocol-designer 19.10% <4.76%> (+0.15%) ⬆️
step-generation 4.59% <100.00%> (+0.21%) ⬆️

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

Files with missing lines Coverage Δ
...commandCreators/atomic/absorbanceReaderCloseLid.ts 100.00% <100.00%> (ø)
...mmandCreators/atomic/absorbanceReaderInitialize.ts 100.00% <100.00%> (ø)
.../commandCreators/atomic/absorbanceReaderOpenLid.ts 100.00% <100.00%> (ø)
...src/commandCreators/atomic/absorbanceReaderRead.ts 80.55% <100.00%> (+2.43%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -19,5 +24,8 @@ export const absorbanceReaderInitialize: CommandCreator<
},
},
],
python: `${pythonName}.initialize(${formatPyStr(
measureMode
)}, [${sampleWavelengths}], ${referenceWavelengthPython})`,
Copy link
Contributor

Choose a reason for hiding this comment

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

sampleWavelengths is an array, right? Please use formatPyList() for formatting Python arrays instead of stringifying it yourself. (Your output is missing the space between numbers idiomatic Python would use.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops, thanks! didn't realize i would need to use formatPyList() for that

@@ -36,5 +40,6 @@ export const absorbanceReaderRead: CommandCreator<
},
},
],
python: `${pythonName}.read(${pythonfileName})`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you include the export_filename= argument name here, since the argument is optional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yup see line 28!

@@ -36,5 +40,6 @@ export const absorbanceReaderRead: CommandCreator<
},
},
],
python: `${pythonName}.read(${pythonfileName})`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, is this the correct way to use the filename? According the docs, the argument is just a prefix, and the files will be saved under names like "my_data_450.csv". Is that the behavior we expect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah i think that's correct!

@@ -19,5 +24,8 @@ export const absorbanceReaderInitialize: CommandCreator<
},
},
],
python: `${pythonName}.initialize(${formatPyStr(
measureMode
)}, ${formatPyList(sampleWavelengths)}, ${referenceWavelengthPython})`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is referenceWavelengthPython optional? Would this produce code like

initialize("single", [123], )

if referenceWavelength is null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ya, good catch, i should have added a test case for this. addressing it now

@jerader jerader merged commit d097caf into edge Mar 5, 2025
18 checks passed
@jerader jerader deleted the sg_plate-reader-python branch March 5, 2025 21:59
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