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

Automated ABR Calibration Data Uploading #14782

Merged
merged 3 commits into from
Apr 3, 2024
Merged

Automated ABR Calibration Data Uploading #14782

merged 3 commits into from
Apr 3, 2024

Conversation

rclarke0
Copy link
Contributor

@rclarke0 rclarke0 commented Apr 2, 2024

Overview

Pulls Calibration Data from Robots and Uploads to google_drive/google_sheet

Test Plan

Tested on ABR robots. Successfully pulls calibration data, uploads to google drive, and saves to google sheet.

Changelog

  • Adds abr_calibration_logs.py
  1. Connects to google drive folder
  2. Connects to google sheet
  3. Pulls module, instrument, and deck calibration data and compiles into one .json file per robot via http requests
  4. Uploads new files to google drive folder
  5. adds new rows to instrument, module, and deck calibration sheets if the serial and calibration lastmodified timestamp pairing do not already exist
  • Split jira_tool up into a file with just jira_tools and a file that uses the tools with the robots.
  • For all scripts uploading to google drive, changed the folder_name argument to folder_id so that the service_account is writing to the correct folder. Adds email as argument to allow for permission sharing by service account.

Review requests

Risk assessment

@rclarke0 rclarke0 requested a review from a team as a code owner April 2, 2024 20:48
@rclarke0 rclarke0 requested review from a team and sfoster1 April 2, 2024 20:53
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.

This is great!

@@ -72,8 +74,8 @@ def upload_file(self, file_path: str) -> str:
"""Upload file to Google Drive."""
file_metadata = {
"name": os.path.basename(file_path),
"mimeType": "application/vnd.google-apps.folder",
"parents": [self.parent_folder] if self.parent_folder else "",
"mimeType": "application/json",
Copy link
Member

Choose a reason for hiding this comment

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

definitely shouldn't be folder, but should this maybe depend on the kind of file? You can use the standard library mimetypes.guess_type() for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to mimetypes.guess_type! Thanks for suggestion

@rclarke0 rclarke0 merged commit 80abd2e into edge Apr 3, 2024
5 checks passed
@rclarke0 rclarke0 deleted the abr0-calibration branch April 3, 2024 15:22
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

Pulls Calibration Data from Robots and Uploads to
google_drive/google_sheet

# Test Plan

Tested on ABR robots. Successfully pulls calibration data, uploads to
google drive, and saves to google sheet.

# Changelog

- Adds abr_calibration_logs.py 

1. Connects to google drive folder
2. Connects to google sheet
3. Pulls module, instrument, and deck calibration data and compiles into
one .json file per robot via http requests
4. Uploads new files to google drive folder
5. adds new rows to instrument, module, and deck calibration sheets if
the serial and calibration lastmodified timestamp pairing do not already
exist

- Split jira_tool up into a file with just jira_tools and a file that
uses the tools with the robots.
- For all scripts uploading to google drive, changed the folder_name
argument to folder_id so that the service_account is writing to the
correct folder. Adds email as argument to allow for permission sharing
by service account.

# 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.

2 participants