Skip to content

automatic database register from google sheet data

Zhicai Zhang requested to merge zhicaiz/reporting:zz_autoDB into master

This MR automize the whole itk DB registrations steps for powerboards based on data from google sheet.

To avoid conflict, please merge this MR first: !73 (merged)

The main change is the add of a new script: database/pbv3_autoRegister.py

  • The script runs in an infinite loop by continuously scanning the whole google sheet and do updates when needed.

  • The script will only run over panels which has a 'Yes' value of the "Ready for DB register?" column. The idea is that once you have filled the powerboard and amac numbers for that panel and do a double check, you set that "Ready for DB register?" to be "Yes" and then this script will do the DB registration job for you.

  • This script will read the panel id, powerboard numbers, amac wafer and die numbers of the panel from a given google sheet, and then register the powerboard flex array, load linpol, load bpol, load coils, load shield box, bond into carrier card, load hv mux, load amac, etc. in DB for the panel.

  • In addition, the script will also update the cells in google sheet about the panel stage, current location, shipment destination, whether pass all tests, and a link to the database.

  • In some rare cases, if the panel has a unusual combination of components, for example, if it contains amacs from different wafers or powerboards from different batch/version, then we should not flag that "Ready for DB register?" to "Yes" and we should do a manual upload in DB.

Screen_Shot_2022-04-13_at_15.43.18

To run the database/pbv3_autoRegister.py script, one needs to get a google service account credentials (private key) saved in googleToken.json. See here for how: https://developers.google.com/sheets/api/quickstart/python

This MR also tries to fix a bunch of small issues in various database scripts, to handle some rare cases and exceptions, such that the auto-register script will (ideally) never crash/stop running.

Edited by Zhicai Zhang

Merge request reports