Refactor AareDB backend and update schemas and paths.
Revised backend schema definitions, removing unnecessary attributes and adding new configurations. Updated file path references to align with the aaredb structure. Cleaned up redundant notebook content and commented out unused database regeneration logic in the backend. Added posting a result to the database
This commit is contained in:
@ -171,12 +171,12 @@ async function fetchAndGenerate() {
|
||||
const backendDirectory = (() => {
|
||||
switch (nodeEnv) {
|
||||
case 'prod':
|
||||
return path.resolve('/home/jungfrau/heidi-v2/backend/app'); // Production path
|
||||
return path.resolve('/home/jungfrau/aaredb/backend/app'); // Production path
|
||||
case 'test':
|
||||
return path.resolve('/home/jungfrau/heidi-v2/backend/app'); // Test path
|
||||
return path.resolve('/home/jungfrau/aaredb/backend/app'); // Test path
|
||||
case 'dev':
|
||||
default:
|
||||
return path.resolve('/Users/gotthardg/PycharmProjects/heidi-v2/backend/app'); // Development path
|
||||
return path.resolve('/Users/gotthardg/PycharmProjects/aaredb/backend/app'); // Development path
|
||||
}
|
||||
})();
|
||||
|
||||
|
@ -11,6 +11,8 @@ interface ImageInfo {
|
||||
id: number;
|
||||
filepath: string;
|
||||
comment?: string;
|
||||
event_type: string;
|
||||
run_number?:number;
|
||||
}
|
||||
|
||||
// This represents an experiment run as returned by your API.
|
||||
@ -87,7 +89,7 @@ interface TreeRow {
|
||||
sample_name?: string;
|
||||
puck_name?: string;
|
||||
dewar_name?: string;
|
||||
images?: ImageInfo[];
|
||||
images?: ImageInfo[]; // Images associated explicitly with this row (especially run items)
|
||||
run_number?: number;
|
||||
beamline_parameters?: ExperimentParameters['beamline_parameters'];
|
||||
experimentType?: string;
|
||||
@ -176,7 +178,13 @@ const ResultGrid: React.FC<ResultGridProps> = ({ activePgroup }) => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// Fetch sample details and construct rows
|
||||
if (!OpenAPI.BASE) {
|
||||
console.error('OpenAPI.BASE is not set. Falling back to a default value.');
|
||||
return;
|
||||
}
|
||||
|
||||
setBasePath(`${OpenAPI.BASE}/`);
|
||||
|
||||
SamplesService.getSampleResultsSamplesResultsGet(activePgroup)
|
||||
.then((response: SampleResult[]) => {
|
||||
const treeRows: TreeRow[] = [];
|
||||
@ -190,28 +198,27 @@ const ResultGrid: React.FC<ResultGridProps> = ({ activePgroup }) => {
|
||||
sample_name: sample.sample_name,
|
||||
puck_name: sample.puck_name,
|
||||
dewar_name: sample.dewar_name,
|
||||
images: sample.images,
|
||||
images: sample.images.filter(img => img.event_type === "Centering"),
|
||||
};
|
||||
treeRows.push(sampleRow);
|
||||
|
||||
if (sample.experiment_runs) {
|
||||
sample.experiment_runs.forEach((run) => {
|
||||
const experimentType = getExperimentType(run);
|
||||
const numImages = getNumberOfImages(run);
|
||||
const runRow: TreeRow = {
|
||||
id: `run-${sample.sample_id}-${run.run_number}`,
|
||||
hierarchy: [sample.sample_id, run.run_number],
|
||||
type: 'run',
|
||||
sample_id: sample.sample_id,
|
||||
run_number: run.run_number,
|
||||
beamline_parameters: run.beamline_parameters,
|
||||
experimentType,
|
||||
numberOfImages: numImages,
|
||||
images: sample.images,
|
||||
};
|
||||
treeRows.push(runRow);
|
||||
});
|
||||
}
|
||||
sample.experiment_runs?.forEach(run => {
|
||||
const experimentType = getExperimentType(run);
|
||||
const numImages = getNumberOfImages(run);
|
||||
const runRow: TreeRow = {
|
||||
id: `run-${sample.sample_id}-${run.run_number}`,
|
||||
hierarchy: [sample.sample_id, run.run_number],
|
||||
type: 'run',
|
||||
sample_id: sample.sample_id,
|
||||
run_number: run.run_number,
|
||||
beamline_parameters: run.beamline_parameters,
|
||||
experimentType,
|
||||
numberOfImages: numImages,
|
||||
images: sample.images.filter(img =>
|
||||
img.event_type === "Collecting" ),
|
||||
};
|
||||
treeRows.push(runRow);
|
||||
});
|
||||
});
|
||||
|
||||
setRows(treeRows);
|
||||
@ -221,6 +228,7 @@ const ResultGrid: React.FC<ResultGridProps> = ({ activePgroup }) => {
|
||||
});
|
||||
}, [activePgroup]);
|
||||
|
||||
|
||||
// Define the grid columns
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
|
Reference in New Issue
Block a user