From 9bf555b67ce3fa552a06f9f62faf86d72c822b93 Mon Sep 17 00:00:00 2001 From: mgcam Date: Wed, 6 Mar 2024 16:33:20 +0000 Subject: [PATCH] Update documentation --- lang_qc/models/pacbio/well.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/lang_qc/models/pacbio/well.py b/lang_qc/models/pacbio/well.py index ad6acf8..64c47b3 100644 --- a/lang_qc/models/pacbio/well.py +++ b/lang_qc/models/pacbio/well.py @@ -37,7 +37,8 @@ def get_field_names(cls): """Returns a list of field names for a class given as an argument. The fields that can only be used at the object initialisation step - are excluded. + are excluded. For fields, which have a validation_alias defined, + this alias is returned rather than the field name. """ field_names = [] @@ -56,12 +57,24 @@ def get_field_names(cls): class PacBioWell: """ A response model for a single PacBio well on a particular PacBio run. - The class contains the attributes that uniquely define this well (`run_name` - and `label`), along with the time line and the current QC state of this well, - if any. + The class contains the attributes that uniquely define this well (`run_name`, + `label`, `plate_number`, `id_product`), along with the time line and the + current QC state of this well, if any. - This model does not contain any information about data that was - sequenced or QC metrics or assessment for such data. + Optionally, the model might contain information about the current QC state + of the well. + + The best way to instantiate the object of this class is via the constructor, + giving it the an ORM object representing a database row with information + about the well and, optionally, the model representing the current qc state. + + Examples: + well_model = PacBioWell(db_well=well_row) + well_model = PacBioWell(db_well=well_row, qc_state=current_qc_state) + + Mapping of the database values to this model's fields is performed by + a pre __init__ hook. To enable automatic mapping, fields of this model have + `validation_alias` defined. """ db_well: PacBioRunWellMetrics = Field(init_var=True) @@ -155,9 +168,13 @@ class PacBioPagedWells(PagedResponse, extra="forbid"): class PacBioWellFull(PacBioWell): """ A response model for a single PacBio well on a particular PacBio run. - The class contains the attributes that uniquely define this well (`run_name` - and `label`), along with the laboratory experiment and sequence run tracking - information, current QC state of this well and QC data for this well. + The class contains the attributes that uniquely define this well (`run_name`, + `label`, `plate_number`, `id_product`), along with the laboratory experiment + and sequence run tracking information, current QC state of this well and + QC data for this well. + + Instance creation is described in the documentation of this class's parent + `PacBioWell`. """ metrics: QCDataWell = Field(