alab_management.sample_view.completed_sample_view module#

This module contains the CompletedSampleView class, which is responsible for saving samples to the completed database.

class CompletedSampleView[source]#

Bases: object

Sample view manages the sample status, which is a collection of tasks.

append_measurement(sample_id, measurement)[source]#

Append one measurement ref onto metadata.measurements for an archived sample.

Same shape as SampleView.append_measurement, but writes Alab(completed). Used when the live copy was pruned after Ending (e.g. late SEM Path A ingest).

Return type:

None

exists(sample_id)[source]#

Check if a sample exists in the database.

Parameters:

sample_id (ObjectId) – id of the sample within sample collection

Return type:

bool

Returns:

bool: True if sample exists in the database

save_sample(sample_id)[source]#

Saves a sample dictionary to the completed database. This should be copying a sample from the working database to the completed database.