feat: compact sample list headers, move Comment column
CI / lint (pull_request) Successful in 42s
CI / test (3.12) (pull_request) Successful in 1m4s
CI / test (3.14) (pull_request) Successful in 1m3s
CI / test (3.13) (pull_request) Successful in 1m8s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m17s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m25s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m12s
CI / test-with-coverage (pull_request) Successful in 1m26s
CI / lint (push) Successful in 30s
Docs build and publish / docker (push) Successful in 11s
CI / test (3.12) (push) Canceled after 35s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 25s
CI / test (3.13) (push) Canceled after 32s
CI / test (3.14) (push) Canceled after 30s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 27s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 22s
CI / test-with-coverage (push) Canceled after 20s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 22s
CI / coverage-analysis (pull_request) Successful in 14s

Count columns use glyphs instead of long headers to save width, Comment
moves ahead of the data-collection params, transmission shown as the
stored value instead of percent.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit was merged in pull request #213.
This commit is contained in:
2026-09-10 17:04:43 +02:00
committed by duan_j
co-authored by Claude Fable 5.1
parent b27556e4cf
commit d5a7074ec1
2 changed files with 15 additions and 14 deletions
+12 -12
View File
@@ -46,17 +46,17 @@ def get_entry(sample: SampleShortInfo, column: int):
# Data-collection params straight from the AareDB spreadsheet (filled by
# spreadsheetupdater). Nullable: samples without params show blank.
elif column == 11:
return sample.aaredb_params.oscillation if sample.aaredb_params else None
return sample.comment
elif column == 12:
return sample.aaredb_params.exposure if sample.aaredb_params else None
return sample.aaredb_params.oscillation if sample.aaredb_params else None
elif column == 13:
return sample.aaredb_params.totalangle if sample.aaredb_params else None
return sample.aaredb_params.exposure if sample.aaredb_params else None
elif column == 14:
return sample.aaredb_params.totalangle if sample.aaredb_params else None
elif column == 15:
# Model holds a 0-1 fraction; users think in spreadsheet percent.
t = sample.aaredb_params.transmission if sample.aaredb_params else None
return None if t is None else round(t * 100, 1)
elif column == 15:
return sample.comment
return None if t is None else t
return ""
@@ -80,17 +80,17 @@ class UserSampleSpreadsheet(QAbstractTableModel):
"Location",
"Priority",
"User",
"Mount count",
"Raster count",
"", # Mount count
"", # Raster count
# Workflow order: a sample is screened before rotation data is
# collected, so Screening sits left of Rotation.
"Screening count",
"Rotation count",
"", # Screening count
"", # Rotation count
"Comment",
"Oscillation (°)",
"Exposure (s)",
"Total range (°)",
"Transmission (%)",
"Comment",
"Transmission",
]
self.current_sample = current_sample
self.current_puck = current_puck
+3 -2
View File
@@ -289,14 +289,15 @@ def test_spreadsheet_param_columns(status_model):
hdr.index("Oscillation (°)"),
hdr.index("Exposure (s)"),
hdr.index("Total range (°)"),
hdr.index("Transmission (%)"),
hdr.index("Transmission"),
)
model.get_id(_row_of(model, 1)).aaredb_params = DataCollectionParameters(
oscillation=0.1, exposure=0.01, totalangle=360, transmission=0.125
)
row = _row_of(model, 1)
d = lambda c: model.data(model.index(row, c), Qt.ItemDataRole.DisplayRole)
assert (d(osc), d(exp), d(tot), d(trans)) == (0.1, 0.01, 360, 12.5)
# Transmission shown as stored, no percent conversion.
assert (d(osc), d(exp), d(tot), d(trans)) == (0.1, 0.01, 360, 0.125)
# No params -> blank, and sorting a mostly-None column must not raise;
# the real value sorts first.
assert model.data(model.index(_row_of(model, 2), osc), Qt.ItemDataRole.DisplayRole) is None