Skip to content

Commit

Permalink
Order sheets alphabetically, ignore casing
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharras committed Jan 12, 2024
1 parent 893f67e commit ca43909
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions benchmarks/kmeans/consolidate_result_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from functools import partial
from io import BytesIO
from itertools import zip_longest
from operator import attrgetter

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -403,7 +402,7 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
)
# ensure worksheets are sorted anti-alphabetically
sheet.reorder_worksheets(
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
sorted(sheet.worksheets(), key=lambda worksheet: worksheet.title.lower())
)

# upload all values
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/pca/consolidate_result_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from functools import partial
from io import BytesIO
from itertools import zip_longest
from operator import attrgetter

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -401,7 +400,7 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
)
# ensure worksheets are sorted anti-alphabetically
sheet.reorder_worksheets(
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
sorted(sheet.worksheets(), key=lambda worksheet: worksheet.title.lower())
)

# upload all values
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/ridge/consolidate_result_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ def _gspread_sync(source, gspread_url, gspread_auth_key):
GOOGLE_WORKSHEET_NAME, rows=n_rows + 1, cols=n_cols
)
# ensure worksheets are sorted anti-alphabetically
sheet.reorder_worksheets(
sorted(sheet.worksheets(), key=attrgetter("title"), reverse=True)
)
sheet.reorder_worksheets(sorted(sheet.worksheets(), key=attrgetter("title")))

# upload all values
worksheet.update(
Expand Down

0 comments on commit ca43909

Please sign in to comment.