From 3c63b19f13737bca5a2c6379cab200f862973b0d Mon Sep 17 00:00:00 2001 From: Francisco Couzo Date: Fri, 23 Aug 2024 17:21:19 -0300 Subject: [PATCH] Add findings to study-summary endpoint (#349) * Quickfix version upgrade * Add findings to study-summary endpoint * Update test data artifact * Version bump --------- Co-authored-by: James Mathews --- build/apiserver/Dockerfile | 2 +- pyproject.toml.unversioned | 6 +++--- spatialprofilingtoolbox/db/accessors/study.py | 2 ++ spatialprofilingtoolbox/db/exchange_data_formats/study.py | 1 + .../module_tests/expected_study_summary_structured.json | 7 ++++++- version.txt | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build/apiserver/Dockerfile b/build/apiserver/Dockerfile index 7d3db8161..0d1aba451 100644 --- a/build/apiserver/Dockerfile +++ b/build/apiserver/Dockerfile @@ -16,7 +16,7 @@ RUN python -m pip install scikit-learn==1.5.0 RUN python -m pip install Pillow==9.5.0 RUN python -m pip install pydantic==2.7.2 RUN python -m pip install secure==0.3.0 -RUN python -m pip install matplotlib==3.9.0 +RUN python -m pip install matplotlib==3.9.2 RUN python -m pip install squidpy==1.5.0 ARG version ARG service_name diff --git a/pyproject.toml.unversioned b/pyproject.toml.unversioned index 855c32f41..316872506 100644 --- a/pyproject.toml.unversioned +++ b/pyproject.toml.unversioned @@ -31,7 +31,7 @@ repository = "https://github.com/nadeemlab/SPT" [project.optional-dependencies] apiserver = [ - "matplotlib==3.9.0", + "matplotlib==3.9.2", "fastapi==0.111.0", "uvicorn==0.30.0", "pandas==2.2.2", @@ -66,7 +66,7 @@ ondemand = [ "squidpy==1.5.0", ] workflow = [ - "matplotlib==3.9.0", + "matplotlib==3.9.2", "umap-learn==0.5.6", "numpy==1.26.4", "scipy==1.13.1", @@ -82,7 +82,7 @@ workflow = [ all = [ "bokeh==3.4.1", "h5py==3.10.0", - "matplotlib==3.9.0", + "matplotlib==3.9.2", "umap-learn==0.5.6", "uvicorn==0.30.0", "Jinja2==3.1.4", diff --git a/spatialprofilingtoolbox/db/accessors/study.py b/spatialprofilingtoolbox/db/accessors/study.py index eedffe35d..2054d021d 100644 --- a/spatialprofilingtoolbox/db/accessors/study.py +++ b/spatialprofilingtoolbox/db/accessors/study.py @@ -43,11 +43,13 @@ def get_study_summary(self, study: str) -> StudySummary: publication = self._get_publication(study) assay = self._get_assay(components.measurement) sample_cohorts = get_sample_cohorts(self.cursor, study) + findings = self.get_study_findings() return StudySummary( context=Context(institution=institution, assay=assay, contact=contact), products=Products(data_release=data_release, publication=publication), counts=counts_summary, cohorts=sample_cohorts, + findings=findings, ) def get_study_components(self, study: str) -> StudyComponents: diff --git a/spatialprofilingtoolbox/db/exchange_data_formats/study.py b/spatialprofilingtoolbox/db/exchange_data_formats/study.py index 7bd5c0bde..ac0c3f293 100644 --- a/spatialprofilingtoolbox/db/exchange_data_formats/study.py +++ b/spatialprofilingtoolbox/db/exchange_data_formats/study.py @@ -97,3 +97,4 @@ class StudySummary(BaseModel): products: Products counts: CountsSummary cohorts: SampleCohorts + findings: list[str] diff --git a/test/apiserver/module_tests/expected_study_summary_structured.json b/test/apiserver/module_tests/expected_study_summary_structured.json index 20804dcf6..1a6d21243 100644 --- a/test/apiserver/module_tests/expected_study_summary_structured.json +++ b/test/apiserver/module_tests/expected_study_summary_structured.json @@ -87,5 +87,10 @@ "result": "Extreme responder" } ] - } + }, + "findings": [ + "Finding 1.", + "Finding 2.", + "Finding 3." + ] } diff --git a/version.txt b/version.txt index 022a03374..beb3a3f6f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.28.0 \ No newline at end of file +0.29.0 \ No newline at end of file