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

Upload Scale Value to google sheet #14691

Merged
merged 6 commits into from
Mar 19, 2024
Merged

Upload Scale Value to google sheet #14691

merged 6 commits into from
Mar 19, 2024

Conversation

rclarke0
Copy link
Contributor

Overview

Reads scale value until it becomes stable and uploads value to google sheet and local csv.

Test Plan

Tested with ABR scale.

Changelog

Moved abr_scale script to abr_tools folder
Added labware, robot, measurement step, storage directory, google sheet name as arguments
saves only the stable value, rather than all of the unstable values
asks the user if they want to measure another sample to reduce the number of times all arguments need to be put in .
deleted analyze_abr script because no longer needed. Analysis is automated on the google sheet.

Review requests

Risk assessment

@rclarke0 rclarke0 requested a review from a team as a code owner March 19, 2024 16:42
from .abr_read_logs import create_abr_data_sheet


def write_to_sheets(file_name_csv: str, google_sheet: Any, row_list: List) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

We're using this function quite a lot, right? Like we use it in pretty much all of our scripts at this point? Might be better to put it in a reusable module.

print("No google sheets credentials. Add credentials to storage notebook.")
# Scale Loop
break_all = False
while is_stable is False:
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this blow up your terminal with print messages waiting for the scale to stabilize? If so, you might add a small sleep at the end of your while false statement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I like seeing that though because it gives you an indication of how long the scale is taking.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could take the time before you enter the while false loop and then take it when you enter the true loop and print that difference.
Whatever you prefer though.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Ok, looks good!

@rclarke0 rclarke0 merged commit eb4692a into edge Mar 19, 2024
6 checks passed
@rclarke0 rclarke0 deleted the abr-scale-googlesheet branch March 19, 2024 21:35
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
<!--
Thanks for taking the time to open a pull request! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview

Reads scale value until it becomes stable and uploads value to google
sheet and local csv.

# Test Plan

Tested with ABR scale.

# Changelog

Moved abr_scale script to abr_tools folder
Added labware, robot, measurement step, storage directory, google sheet
name as arguments
saves only the stable value, rather than all of the unstable values
asks the user if they want to measure another sample to reduce the
number of times all arguments need to be put in .
deleted analyze_abr script because no longer needed. Analysis is
automated on the google sheet.

# Review requests

<!--
Describe any requests for your reviewers here.
-->

# Risk assessment

<!--
Carefully go over your pull request and look at the other parts of the
codebase it may affect. Look for the possibility, even if you think it's
small, that your change may affect some other part of the system - for
instance, changing return tip behavior in protocol may also change the
behavior of labware calibration.

Identify the other parts of the system your codebase may affect, so that
in addition to your own review and testing, other people who may not
have the system internalized as much as you can focus their attention
and testing there.
-->
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.

3 participants