Expand sample data handling and grid display.

Integrated additional sample parameters into backend and frontend for enhanced data collection. Updated pyproject version to reflect these changes. This improves user interface flexibility and enriches displayed sample metadata.
This commit is contained in:
GotthardG 2025-01-08 09:52:15 +01:00
parent 9b4f8599f3
commit 6d67d02259
3 changed files with 44 additions and 29 deletions

View File

@ -330,35 +330,12 @@ async def get_dewar_samples(dewar_id: int, db: Session = Depends(get_db)):
{ {
"id": sample.id, "id": sample.id,
"position": sample.position, "position": sample.position,
"dewar_name": dewar.dewar_name, # Add Dewar name here "dewar_name": dewar.dewar_name,
"sample_name": sample.sample_name, "sample_name": sample.sample_name,
"priority": sample.priority, "priority": sample.priority,
"comments": sample.comments, "comments": sample.comments,
# "directory":sample.directory,
"proteinname": sample.proteinname, "proteinname": sample.proteinname,
# "oscillation": datacollection.oscillation, **(sample.data_collection_parameters or {}),
# "aperture": 10,
# "exposure": 11,
# "totalrange": 12,
# "transmission": 13,
# "dose": 14,
# "targetresolution": 15,
# "datacollectiontype": 16,
# "processingpipeline": 17,
# "spacegroupnumber": 18,
# "cellparameters": 19,
# "rescutkey": 20,
# "rescutvalue": 21,
# "userresolution": 22,
# "pdbid": 23,
# "autoprocfull": 24,
# "procfull": 25,
# "adpenabled": 26,
# "noano": 27,
# "ffcscampaign": 28,
# "trustedhigh": 29,
# "autoprocextraparams": 30,
# "chiphiangles": 31,
} }
for sample in samples for sample in samples
], ],

View File

@ -37,14 +37,33 @@ const SampleSpreadsheet: React.FC<SampleSpreadsheetProps> = ({ dewarId }) => {
proteinName: sample.proteinname, proteinName: sample.proteinname,
priority: sample.priority, priority: sample.priority,
comments: sample.comments, comments: sample.comments,
directory: sample.directory,
oscillation: sample.oscillation,
aperture: sample.aperture,
exposure: sample.exposure,
totalRange: sample.totalrange,
transmission: sample.transmission,
dose: sample.dose,
targetResolution: sample.targetresolution,
datacollectiontype: sample.datacollectiontype,
processingpipeline: sample.processingpipeline,
spacegroupnumber: sample.spacegroupnumber,
cellparameters: sample.cellparameters,
rescutkey: sample.rescutkey,
//rescutvalues: sample.rescutvalues,
pdbid: sample.pdbid,
autoprocfull: sample.autoprocfull,
procfull: sample.procfull,
adpenabled: sample.adpenabled,
noano: sample.noano,
ffcscampaign: sample.ffcscampaign,
}); });
}); });
}); });
setRows(allRows); setRows(allRows);
// Define table columns if not already set
setColumns([ setColumns([
{ field: "dewarName", headerName: "Dewar Name", width: 150, editable: false }, // Display Dewar Name { field: "dewarName", headerName: "Dewar Name", width: 150, editable: false },
{ field: "puckName", headerName: "Puck Name", width: 150 }, { field: "puckName", headerName: "Puck Name", width: 150 },
{ field: "puckType", headerName: "Puck Type", width: 150 }, { field: "puckType", headerName: "Puck Type", width: 150 },
{ field: "crystalName", headerName: "Crystal Name", width: 200, editable: true }, { field: "crystalName", headerName: "Crystal Name", width: 200, editable: true },
@ -52,6 +71,25 @@ const SampleSpreadsheet: React.FC<SampleSpreadsheetProps> = ({ dewarId }) => {
{ field: "position", headerName: "Position", width: 100, editable: true, type: "number" }, { field: "position", headerName: "Position", width: 100, editable: true, type: "number" },
{ field: "priority", headerName: "Priority", width: 100, editable: true, type: "number" }, { field: "priority", headerName: "Priority", width: 100, editable: true, type: "number" },
{ field: "comments", headerName: "Comments", width: 300, editable: true }, { field: "comments", headerName: "Comments", width: 300, editable: true },
{ field: "directory", headerName: "Directory", width: 200 },
{ field: "oscillation", headerName: "Oscillation", width: 150, editable: true, type: "number" },
{ field: "aperture", headerName: "Aperture", width: 150, editable: true, type: "number" },
{ field: "exposure", headerName: "Exposure", width: 150, editable: true, type: "number" },
{ field: "totalRange", headerName: "Total Range", width: 150, editable: true, type: "number" },
{ field: "transmission", headerName: "Transmission", width: 150, editable: true, type: "number" },
{ field: "dose", headerName: "Dose", width: 150, editable: true, type: "number" },
{ field: "targetResolution", headerName: "Target Resolution", width: 200, editable: true, type: "number" },
{ field: "datacollectiontype", headerName: "Data Collection Type", width: 200 },
{ field: "processingpipeline", headerName: "Processing Pipeline", width: 200 },
{ field: "spacegroupnumber", headerName: "Space Group Number", width: 150, type: "number" },
{ field: "cellparameters", headerName: "Cell Parameters", width: 200 },
{ field: "rescutkey", headerName: "Rescut Key", width: 150 },
{ field: "pdbid", headerName: "PDB ID", width: 150 },
{ field: "autoprocfull", headerName: "Auto Proc Full", width: 150 },
{ field: "procfull", headerName: "Proc Full", width: 150 },
{ field: "adpenabled", headerName: "ADP Enabled", width: 150, editable: true, type: "boolean" },
{ field: "noano", headerName: "No Ano", width: 150, editable: true, type: "boolean" },
{ field: "ffcscampaign", headerName: "FFCS Campaign", width: 200 },
]); ]);
} catch (error) { } catch (error) {
console.error("Error fetching dewar samples:", error); console.error("Error fetching dewar samples:", error);

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "aareDB" name = "aareDB"
version = "0.1.0a9" version = "0.1.0a10"
description = "Backend for next gen sample management system" description = "Backend for next gen sample management system"
authors = [{name = "Guillaume Gotthard", email = "guillaume.gotthard@psi.ch"}] authors = [{name = "Guillaume Gotthard", email = "guillaume.gotthard@psi.ch"}]
license = {text = "MIT"} license = {text = "MIT"}