-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from wtsi-npg/devel
Release 1.5.0 to master
- Loading branch information
Showing
27 changed files
with
882 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "npg-longue-vue", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "UI for LangQC", | ||
"author": "Kieron Taylor <[email protected]>", | ||
"license": "GPL-3.0-or-later", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.4.1" | ||
__version__ = "1.5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# Authors: | ||
# Adam Blanchet | ||
# Marina Gourtovaia <[email protected]> | ||
# Kieron Taylor <[email protected]> | ||
# | ||
# This file is part of npg_langqc. | ||
# | ||
|
@@ -19,8 +20,9 @@ | |
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from fastapi import APIRouter, Depends, HTTPException | ||
from pydantic import PositiveInt | ||
from typing import Annotated | ||
|
||
from fastapi import APIRouter, Depends, HTTPException, Query | ||
from sqlalchemy.orm import Session | ||
from starlette import status | ||
|
||
|
@@ -75,7 +77,6 @@ | |
in models in lang_qc.models.qc_state). | ||
""" | ||
|
||
|
||
router = APIRouter( | ||
prefix="/pacbio", | ||
tags=["pacbio"], | ||
|
@@ -84,6 +85,10 @@ | |
}, | ||
) | ||
|
||
OptionalPositiveInt = Annotated[int | None, Query(gt=0)] | ||
# We cannot get this from pydantic as of v2, so we use Python 3.9 annotated type support | ||
# and FastAPI query constraints on URL query chunks. | ||
|
||
|
||
@router.get( | ||
"/wells", | ||
|
@@ -104,8 +109,8 @@ | |
response_model=PacBioPagedWells, | ||
) | ||
def get_wells_filtered_by_status( | ||
page_size: PositiveInt, | ||
page_number: PositiveInt, | ||
page_size: OptionalPositiveInt, | ||
page_number: OptionalPositiveInt, | ||
qc_status: QcFlowStatusEnum = QcFlowStatusEnum.INBOX, | ||
qcdb_session: Session = Depends(get_qc_db), | ||
mlwh_session: Session = Depends(get_mlwh_db), | ||
|
@@ -138,8 +143,8 @@ def get_wells_filtered_by_status( | |
) | ||
def get_wells_in_run( | ||
run_name: str, | ||
page_size: PositiveInt = 20, | ||
page_number: PositiveInt = 1, | ||
page_size: OptionalPositiveInt = 20, | ||
page_number: OptionalPositiveInt = 1, | ||
qcdb_session: Session = Depends(get_qc_db), | ||
mlwh_session: Session = Depends(get_mlwh_db), | ||
): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Authors: | ||
# Marina Gourtovaia <[email protected]> | ||
# Kieron Taylor <[email protected]> | ||
# | ||
# This file is part of npg_langqc. | ||
# | ||
|
@@ -20,7 +21,7 @@ | |
|
||
from typing import List | ||
|
||
from pydantic import BaseModel, Extra, Field | ||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
from lang_qc.db.mlwh_schema import PacBioRun | ||
|
||
|
@@ -100,10 +101,7 @@ class PacBioExperiment(BaseModel): | |
The pac_bio_library_tube_barcode from TRACTION, AKA pool name | ||
""", | ||
) | ||
|
||
class Config: | ||
orm_mode = True | ||
extra = Extra.forbid | ||
model_config = ConfigDict(from_attributes=True, extra="forbid") | ||
|
||
@classmethod | ||
def from_orm(cls, lims_db_rows: List[PacBioRun]): | ||
|
@@ -151,4 +149,4 @@ def from_orm(cls, lims_db_rows: List[PacBioRun]): | |
for key in ("library_type", "study_id"): | ||
lims_data[key] = sorted(lims_data[key]) | ||
|
||
return cls.parse_obj(lims_data) | ||
return cls.model_validate(lims_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
# Copyright (c) 2022, 2023 Genome Research Ltd. | ||
# | ||
# Author: Marina Gourtovaia <[email protected]> | ||
# Authors: | ||
# Marina Gourtovaia <[email protected]> | ||
# Kieron Taylor <[email protected]> | ||
# | ||
# | ||
# This file is part of npg_langqc. | ||
# | ||
|
@@ -17,7 +20,7 @@ | |
# You should have received a copy of the GNU General Public License along with | ||
# this program. If not, see <http://www.gnu.org/licenses/> | ||
|
||
from pydantic import BaseModel, Field | ||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
from lang_qc.db.mlwh_schema import PacBioRunWellMetrics | ||
|
||
|
@@ -122,16 +125,14 @@ class QCDataWell(BaseModel): | |
percentage_deplexed_bases: dict = Field( | ||
default=None, title="Percentage of bases deplexed" | ||
) | ||
|
||
class Config: | ||
orm_mode = True | ||
model_config = ConfigDict(from_attributes=True) | ||
|
||
@classmethod | ||
def from_orm(cls, obj: PacBioRunWellMetrics): | ||
|
||
# Introspect the class definition, get a dictionary of specs | ||
# for properties with property names as the keys. | ||
attrs = cls.schema()["properties"] | ||
attrs = cls.model_json_schema()["properties"] | ||
qc_data = {} | ||
|
||
for name in attrs: | ||
|
@@ -151,4 +152,4 @@ def from_orm(cls, obj: PacBioRunWellMetrics): | |
else: | ||
qc_data[name]["value"] = getattr(obj, name, None) | ||
|
||
return cls.parse_obj(qc_data) | ||
return cls.model_validate(qc_data) |
Oops, something went wrong.