Skip to content

Commit 67c1ed9

Browse files
committed
Fix sorting bug
1 parent c2406c9 commit 67c1ed9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crystal_toolkit/core/mpcomponent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,11 @@ def matrix_element(idx, value=0):
497497

498498
# arrange the input boxes in two dimensions (rows, columns)
499499
matrix_div_contents = []
500-
for columns in sorted(matrix_contents.values()):
500+
print("matrix_contents", matrix_contents)
501+
for column_idx in sorted(matrix_contents.keys()):
501502
row = []
502-
for element in sorted(columns.values()):
503-
row.append(element)
503+
for row_idx in sorted(matrix_contents[column_idx].keys()):
504+
row.append(matrix_contents[column_idx][row_idx])
504505
matrix_div_contents.append(html.Div(row))
505506

506507
matrix = html.Div(matrix_div_contents)

0 commit comments

Comments
 (0)