-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'edge' into app_well-selection-component
- Loading branch information
Showing
913 changed files
with
14,822 additions
and
4,592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
"""Get Unique LPC Values from Run logs.""" | ||
"""Automated LPC Data Analysis.""" | ||
import os | ||
import argparse | ||
from abr_testing.automation import google_sheets_tool | ||
import sys | ||
|
||
|
||
def remove_duplicate_data() -> None: | ||
"""Determine unique sets of data.""" | ||
seen = set() | ||
new_values = [] | ||
row_indices = [] | ||
sheet_data = google_sheet_lpc.get_all_data() | ||
for i, row in enumerate(sheet_data): | ||
key = ( | ||
row["Robot"], | ||
row["Software Version"], | ||
row["Errors"], | ||
row["Slot"], | ||
row["Module"], | ||
row["Adapter"], | ||
row["X"], | ||
row["Y"], | ||
row["Z"], | ||
) | ||
|
||
if key not in seen: | ||
seen.add(key) | ||
new_values.append(row) | ||
else: | ||
row_indices.append(i) | ||
if len(row_indices) > 0: | ||
google_sheet_lpc.batch_delete_rows(row_indices) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Read run logs on google drive.") | ||
parser.add_argument( | ||
"storage_directory", | ||
metavar="STORAGE_DIRECTORY", | ||
type=str, | ||
nargs=1, | ||
help="Path to long term storage directory for run logs.", | ||
) | ||
args = parser.parse_args() | ||
storage_directory = args.storage_directory[0] | ||
try: | ||
credentials_path = os.path.join(storage_directory, "credentials.json") | ||
except FileNotFoundError: | ||
print(f"Add credentials.json file to: {storage_directory}.") | ||
sys.exit() | ||
google_sheet_lpc = google_sheets_tool.google_sheet(credentials_path, "ABR-LPC", 0) | ||
print(len(google_sheet_lpc.get_all_data())) | ||
remove_duplicate_data() | ||
num_of_rows = print(len(google_sheet_lpc.get_all_data())) | ||
# TODO: automate data analysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.