From e52275f6a7739a37923515b22a7cf20209a435e6 Mon Sep 17 00:00:00 2001 From: nayib-jose-gloria Date: Fri, 8 Mar 2024 10:07:57 -0500 Subject: [PATCH 01/19] feat: set-up docsite --- .github/workflows/build-docs.yml | 39 +++++++++++++++++++ .github/workflows/push-tests.yml | 2 +- .../src/cellxgene_ontology_guide/__init__.py | 4 +- .../{constants.py => _constants.py} | 0 .../ontology_parser.py | 3 +- .../supported_versions.py | 2 +- 6 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build-docs.yml rename api/python/src/cellxgene_ontology_guide/{constants.py => _constants.py} (100%) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000..d595454 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,39 @@ +name: Build Docsite + +on: + push: + branches: + - main + - nayib/docsite # TODO: remove this line after testing + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies + run: | + cd api/python + pip install pdoc + make install + - run: pdoc --html --output-dir docs/ cellxgene_ontology_guide + - uses: actions/upload-pages-artifact@v3 + with: + path: docs/ + + # Deploy the artifact to GitHub pages. + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/push-tests.yml b/.github/workflows/push-tests.yml index ffb00c7..dd3103d 100644 --- a/.github/workflows/push-tests.yml +++ b/.github/workflows/push-tests.yml @@ -26,7 +26,7 @@ jobs: - name: lint checks uses: pre-commit/action@v3.0.0 - unit-test-ontonolgy-builder: + unit-test-ontology-builder: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/api/python/src/cellxgene_ontology_guide/__init__.py b/api/python/src/cellxgene_ontology_guide/__init__.py index ad2ffa4..95e5075 100644 --- a/api/python/src/cellxgene_ontology_guide/__init__.py +++ b/api/python/src/cellxgene_ontology_guide/__init__.py @@ -1,3 +1,3 @@ -import _version +import cellxgene_ontology_guide._version as version -__version__ = _version.__version__ +__version__ = version.__version__ diff --git a/api/python/src/cellxgene_ontology_guide/constants.py b/api/python/src/cellxgene_ontology_guide/_constants.py similarity index 100% rename from api/python/src/cellxgene_ontology_guide/constants.py rename to api/python/src/cellxgene_ontology_guide/_constants.py diff --git a/api/python/src/cellxgene_ontology_guide/ontology_parser.py b/api/python/src/cellxgene_ontology_guide/ontology_parser.py index 75db597..3ce33e0 100644 --- a/api/python/src/cellxgene_ontology_guide/ontology_parser.py +++ b/api/python/src/cellxgene_ontology_guide/ontology_parser.py @@ -1,8 +1,7 @@ import re from typing import Any, Dict, List, Union -from entities import Ontology, OntologyFileType, OntologyVariant - +from cellxgene_ontology_guide.entities import Ontology, OntologyFileType, OntologyVariant from cellxgene_ontology_guide.supported_versions import CXGSchema diff --git a/api/python/src/cellxgene_ontology_guide/supported_versions.py b/api/python/src/cellxgene_ontology_guide/supported_versions.py index a47ba9e..e2eace1 100644 --- a/api/python/src/cellxgene_ontology_guide/supported_versions.py +++ b/api/python/src/cellxgene_ontology_guide/supported_versions.py @@ -4,9 +4,9 @@ import os from typing import Any, Dict, List, Optional -from constants import DATA_ROOT, ONTOLOGY_FILENAME_SUFFIX, ONTOLOGY_INFO_FILENAME from semantic_version import Version +from cellxgene_ontology_guide._constants import DATA_ROOT, ONTOLOGY_FILENAME_SUFFIX, ONTOLOGY_INFO_FILENAME from cellxgene_ontology_guide.entities import Ontology From 2d034cb689893f06328a5a7ce90c53636a0d6169 Mon Sep 17 00:00:00 2001 From: nayib-jose-gloria Date: Fri, 8 Mar 2024 10:11:30 -0500 Subject: [PATCH 02/19] fix cmd typo --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index d595454..4b8e1a1 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -19,7 +19,7 @@ jobs: cd api/python pip install pdoc make install - - run: pdoc --html --output-dir docs/ cellxgene_ontology_guide + - run: pdoc --output-dir docs/ cellxgene_ontology_guide - uses: actions/upload-pages-artifact@v3 with: path: docs/ From d204f0a248401b6f8fdbbabe96587aa499d07243 Mon Sep 17 00:00:00 2001 From: nayib-jose-gloria Date: Fri, 8 Mar 2024 10:17:07 -0500 Subject: [PATCH 03/19] lint --- .github/workflows/build-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 4b8e1a1..89ba41a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Install dependencies run: | cd api/python @@ -36,4 +36,4 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 From e6fb46a6134ecaeb4cd5141c1fcc24ca6345ef24 Mon Sep 17 00:00:00 2001 From: nayib-jose-gloria Date: Fri, 8 Mar 2024 10:44:09 -0500 Subject: [PATCH 04/19] make docs cmd --- .github/workflows/build-docs.yml | 6 ++---- api/python/Makefile | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 89ba41a..887b26c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -14,12 +14,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Install dependencies + - name: Generate docs run: | cd api/python - pip install pdoc - make install - - run: pdoc --output-dir docs/ cellxgene_ontology_guide + make docs - uses: actions/upload-pages-artifact@v3 with: path: docs/ diff --git a/api/python/Makefile b/api/python/Makefile index 9c36497..2498cab 100644 --- a/api/python/Makefile +++ b/api/python/Makefile @@ -4,6 +4,11 @@ install: package-data install-dev: package-data pip install -e .[test] +docs: + pip install . + pip install pdoc + pdoc --output-dir docs/ cellxgene_ontology_guide + uninstall: pip uninstall -y cellxgene-ontology-guide From 7fa1b419b9118d7cbc9d64c811bca1929a800069 Mon Sep 17 00:00:00 2001 From: nayib-jose-gloria Date: Fri, 8 Mar 2024 10:47:26 -0500 Subject: [PATCH 05/19] docs folder --- docs/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/.gitkeep diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 0000000..e69de29 From a8f325d3c685cc9eddcda9d5a6bc7bf1949be9aa Mon Sep 17 00:00:00 2001 From: nayib-jose-gloria Date: Fri, 8 Mar 2024 11:12:41 -0500 Subject: [PATCH 06/19] make file fixes --- .github/workflows/build-docs.yml | 6 ++++-- Makefile | 6 ++++++ api/python/Makefile | 3 +-- docs/.gitkeep | 0 4 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 docs/.gitkeep diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 887b26c..7e2194e 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -14,10 +14,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Generate docs + - name: Install dependencies run: | cd api/python - make docs + make install-docs + - name: Build the docsite + run: make docs - uses: actions/upload-pages-artifact@v3 with: path: docs/ diff --git a/Makefile b/Makefile index 6d5d8a4..11648cd 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,8 @@ lint: pre-commit run --all-files + +docs: + pdoc --output-dir docs/ cellxgene_ontology_guide + +docs-local: + pdoc cellxgene_ontology_guide \ No newline at end of file diff --git a/api/python/Makefile b/api/python/Makefile index 2498cab..4f2a299 100644 --- a/api/python/Makefile +++ b/api/python/Makefile @@ -4,10 +4,9 @@ install: package-data install-dev: package-data pip install -e .[test] -docs: +install-docs: pip install . pip install pdoc - pdoc --output-dir docs/ cellxgene_ontology_guide uninstall: pip uninstall -y cellxgene-ontology-guide diff --git a/docs/.gitkeep b/docs/.gitkeep deleted file mode 100644 index e69de29..0000000 From f60185c151b26b961303e635e0acc33b85877088 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Tue, 19 Mar 2024 15:40:11 -0700 Subject: [PATCH 07/19] install pdocs from pyproject.toml --- api/python/Makefile | 5 ++--- api/python/pyproject.toml | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/python/Makefile b/api/python/Makefile index 4f2a299..f76fc49 100644 --- a/api/python/Makefile +++ b/api/python/Makefile @@ -4,9 +4,8 @@ install: package-data install-dev: package-data pip install -e .[test] -install-docs: - pip install . - pip install pdoc +install-docs: package-data + pip install -e .[docs] uninstall: pip uninstall -y cellxgene-ontology-guide diff --git a/api/python/pyproject.toml b/api/python/pyproject.toml index d47f772..f1c85c9 100644 --- a/api/python/pyproject.toml +++ b/api/python/pyproject.toml @@ -16,6 +16,7 @@ dependencies = ["semantic_version==2.10.0"] [project.optional-dependencies] test = ["pytest"] +docs = ["pdoc"] [tool.setuptools.packages.find] where = ["src"] From 93d21ce15c88ef320a4466d7bdfbbe8db0bcdfde Mon Sep 17 00:00:00 2001 From: Bento007 Date: Tue, 19 Mar 2024 15:40:43 -0700 Subject: [PATCH 08/19] Include README and CHANGELOGS in docs --- Makefile | 4 ++-- api/python/src/cellxgene_ontology_guide/__init__.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 11648cd..8ee3617 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ lint: pre-commit run --all-files docs: - pdoc --output-dir docs/ cellxgene_ontology_guide + pdoc --output-dir docs/ ./api/python/src/cellxgene_ontology_guide docs-local: - pdoc cellxgene_ontology_guide \ No newline at end of file + pdoc ./api/python/src/cellxgene_ontology_guide diff --git a/api/python/src/cellxgene_ontology_guide/__init__.py b/api/python/src/cellxgene_ontology_guide/__init__.py index 95e5075..3363aab 100644 --- a/api/python/src/cellxgene_ontology_guide/__init__.py +++ b/api/python/src/cellxgene_ontology_guide/__init__.py @@ -1,3 +1,8 @@ +""" +.. include:: ../../README.md +.. include:: ../../CHANGELOG.md +""" + import cellxgene_ontology_guide._version as version __version__ = version.__version__ From 73b6861d6fa72d0d0b781da4cf0483554fa8f7f9 Mon Sep 17 00:00:00 2001 From: Trent Smith <1429913+Bento007@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:57:01 -0700 Subject: [PATCH 09/19] Update build-docs.yml --- .github/workflows/build-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7e2194e..7b1651e 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - nayib/docsite # TODO: remove this line after testing jobs: build: From 5ab9543314a8b54aa056ef659c58e88a20d30a36 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 15:08:51 -0700 Subject: [PATCH 10/19] add top level readme --- api/python/README.md | 12 +++++++++--- api/python/pyproject.toml | 2 +- api/python/src/cellxgene_ontology_guide/__init__.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api/python/README.md b/api/python/README.md index bf99b50..668d381 100644 --- a/api/python/README.md +++ b/api/python/README.md @@ -1,18 +1,24 @@ # Python API -# Install +API Documentation: https://chanzuckerberg.github.io/cellxgene-ontology-guide/cellxgene_ontology_guide.html + +pypi: https://pypi.org/project/cellxgene-ontology-guide/ + +# Developer Setup + +## Install ```bash make install ``` -# Uninstall +## Uninstall ```bash make uninstall ``` -# Run Unit Tests +## Run Unit Tests ```bash make install-dev diff --git a/api/python/pyproject.toml b/api/python/pyproject.toml index b3380b4..cd04340 100644 --- a/api/python/pyproject.toml +++ b/api/python/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "cellxgene_ontology_guide" dynamic = ["version"] -description = "Access ontology data used by CZ cellxgene" +description = "Access ontology metadata used by CZ cellxgene" authors = [ { name = "Chan Zuckerberg Initiative Foundation", email = "cellxgene@chanzuckerberg.com" } ] diff --git a/api/python/src/cellxgene_ontology_guide/__init__.py b/api/python/src/cellxgene_ontology_guide/__init__.py index 3363aab..c9abfef 100644 --- a/api/python/src/cellxgene_ontology_guide/__init__.py +++ b/api/python/src/cellxgene_ontology_guide/__init__.py @@ -1,5 +1,5 @@ """ -.. include:: ../../README.md +.. include:: ../../../../README.md .. include:: ../../CHANGELOG.md """ From b8755717e37c0c247f9cdb3f257296d5571fa101 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 16:18:26 -0700 Subject: [PATCH 11/19] flesh out project toml --- api/python/pyproject.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/python/pyproject.toml b/api/python/pyproject.toml index cd04340..d4c687c 100644 --- a/api/python/pyproject.toml +++ b/api/python/pyproject.toml @@ -14,6 +14,22 @@ readme = "README.md" requires-python = "~= 3.10" dependencies = ["semantic_version>=2.10.0,<3"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" +] + +[project.urls] +Documentation = "https://chanzuckerberg.github.io/cellxgene-ontology-guide/cellxgene_ontology_guide.html" +Repository = "https://github.com/chanzuckerberg/cellxgene-ontology-guide.git" +Issues = "https://github.com/chanzuckerberg/cellxgene-ontology-guide/issues" +Changelog = "https://github.com/chanzuckerberg/cellxgene-ontology-guide/blob/main/api/python/CHANGELOG.md" + [project.optional-dependencies] test = ["pytest"] docs = ["pdoc"] From c3f3aef7859242ba5d134bf999698856d75f74ff Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 16:27:53 -0700 Subject: [PATCH 12/19] use a separate readme for pypi --- api/python/README.md | 9 +++++++++ api/python/pypi_README.md | 1 + api/python/pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 api/python/pypi_README.md diff --git a/api/python/README.md b/api/python/README.md index 668d381..bc0733e 100644 --- a/api/python/README.md +++ b/api/python/README.md @@ -24,3 +24,12 @@ make uninstall make install-dev make unit-tests ``` + +## Release + +The [release.yml](../../.github/workflows/release.yml) GHA should handle the release process for the pypi package. +However if you need to manually release the package, you can use the following commands: + +```bash +make release/pypi +``` diff --git a/api/python/pypi_README.md b/api/python/pypi_README.md new file mode 100644 index 0000000..e03a73d --- /dev/null +++ b/api/python/pypi_README.md @@ -0,0 +1 @@ +API Documentation: https://chanzuckerberg.github.io/cellxgene-ontology-guide/cellxgene_ontology_guide.html diff --git a/api/python/pyproject.toml b/api/python/pyproject.toml index d4c687c..21ccf86 100644 --- a/api/python/pyproject.toml +++ b/api/python/pyproject.toml @@ -10,7 +10,7 @@ authors = [ { name = "Chan Zuckerberg Initiative Foundation", email = "cellxgene@chanzuckerberg.com" } ] license = { file = "LICENSE" } -readme = "README.md" +readme = "pypi_README.md" requires-python = "~= 3.10" dependencies = ["semantic_version>=2.10.0,<3"] From 99a2cf673c2eab0ad22684d9e5403ec30a9fb6f8 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 16:53:35 -0700 Subject: [PATCH 13/19] adjust make recipes test doc generation in pushtest --- .github/workflows/build-docs.yml | 9 +++++++-- .github/workflows/push-tests.yml | 27 +++++++++++++++++++++++++++ Makefile | 6 ------ api/python/Makefile | 8 +++++++- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7b1651e..89edbfc 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - "*" jobs: build: @@ -18,10 +21,12 @@ jobs: cd api/python make install-docs - name: Build the docsite - run: make docs + run: | + cd api/python + make docs/build - uses: actions/upload-pages-artifact@v3 with: - path: docs/ + path: api/python/docs/ # Deploy the artifact to GitHub pages. deploy: diff --git a/.github/workflows/push-tests.yml b/.github/workflows/push-tests.yml index d0ec5d3..040723c 100644 --- a/.github/workflows/push-tests.yml +++ b/.github/workflows/push-tests.yml @@ -79,3 +79,30 @@ jobs: run: | cd api/python make unit-tests + + test-doc-generation: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Python cache + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/api/python/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + cd api/python + make docs/install + - name: Test pdoc + run: | + cd api/python + make docs/build diff --git a/Makefile b/Makefile index 8ee3617..6d5d8a4 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,2 @@ lint: pre-commit run --all-files - -docs: - pdoc --output-dir docs/ ./api/python/src/cellxgene_ontology_guide - -docs-local: - pdoc ./api/python/src/cellxgene_ontology_guide diff --git a/api/python/Makefile b/api/python/Makefile index c911f34..61e0b63 100644 --- a/api/python/Makefile +++ b/api/python/Makefile @@ -4,9 +4,15 @@ install: package-data install-dev: package-data pip install -e .[test] -install-docs: package-data +docs/install: package-data pip install -e .[docs] +docs/local: + pdoc src/cellxgene_ontology_guide + +docs/build: + pdoc --html --output-dir docs/ src/cellxgene_ontology_guide + uninstall: pip uninstall -y cellxgene-ontology-guide From ce28e05770a19ba780dcc8426a8dbdf824fb055b Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 16:54:53 -0700 Subject: [PATCH 14/19] fix make recipe --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 89edbfc..b1bd401 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -19,7 +19,7 @@ jobs: - name: Install dependencies run: | cd api/python - make install-docs + make docs/install - name: Build the docsite run: | cd api/python From 6d725d4bab81c91c47a95aef1bc0f796b71a8616 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 16:56:20 -0700 Subject: [PATCH 15/19] fix make recipe --- api/python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/python/Makefile b/api/python/Makefile index 61e0b63..e549caa 100644 --- a/api/python/Makefile +++ b/api/python/Makefile @@ -11,7 +11,7 @@ docs/local: pdoc src/cellxgene_ontology_guide docs/build: - pdoc --html --output-dir docs/ src/cellxgene_ontology_guide + pdoc --output-dir docs/ src/cellxgene_ontology_guide uninstall: pip uninstall -y cellxgene-ontology-guide From 2d6093d014ba2594a1278c290e0240ca62c61c0f Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 21 Mar 2024 17:01:01 -0700 Subject: [PATCH 16/19] remove test branch code --- .github/workflows/build-docs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index b1bd401..a9bddda 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - "*" jobs: build: From 29f722aff1a7e57bdb3df63d06025ea2d973f468 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Mon, 25 Mar 2024 11:06:45 -0700 Subject: [PATCH 17/19] fix documentation --- README.md | 2 +- api/python/src/cellxgene_ontology_guide/__init__.py | 1 + api/python/src/cellxgene_ontology_guide/ontology_parser.py | 3 +++ .../src/cellxgene_ontology_guide/supported_versions.py | 7 +++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04b3f7f..d6ddeae 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # CellxGene Ontology Guide -CellxGene Ontology Guide is a filtered and currated collection of ontological metadata from different public sources. +CellxGene Ontology Guide is a filtered and curated collection of ontological metadata from different public sources. The primary goal is to serve the ontology needs of the [CellxGene](https://cellxgene.cziscience.com/) project and its associated tools. An [API](./api) for querying the data is also provided. diff --git a/api/python/src/cellxgene_ontology_guide/__init__.py b/api/python/src/cellxgene_ontology_guide/__init__.py index c9abfef..ab0ec43 100644 --- a/api/python/src/cellxgene_ontology_guide/__init__.py +++ b/api/python/src/cellxgene_ontology_guide/__init__.py @@ -6,3 +6,4 @@ import cellxgene_ontology_guide._version as version __version__ = version.__version__ +__all__ = ["curated_ontology_term_lists", "entities", "ontology_parser", "supported_versions"] diff --git a/api/python/src/cellxgene_ontology_guide/ontology_parser.py b/api/python/src/cellxgene_ontology_guide/ontology_parser.py index 1e1a320..a366d34 100644 --- a/api/python/src/cellxgene_ontology_guide/ontology_parser.py +++ b/api/python/src/cellxgene_ontology_guide/ontology_parser.py @@ -11,6 +11,9 @@ class OntologyParser: An object to parse ontology term metadata from ontologies corresponding to a given CellxGene Schema Version. """ + cxg_schema: CXGSchema + """ CXGSchema object to fetch ontology metadata from """ + def __init__(self, schema_version: str): """ Initialize an OntologyParser object with the ontology metadata corresponding to the given CellxGene schema diff --git a/api/python/src/cellxgene_ontology_guide/supported_versions.py b/api/python/src/cellxgene_ontology_guide/supported_versions.py index e2eace1..ca38811 100644 --- a/api/python/src/cellxgene_ontology_guide/supported_versions.py +++ b/api/python/src/cellxgene_ontology_guide/supported_versions.py @@ -44,6 +44,13 @@ def load_supported_versions() -> Any: class CXGSchema: """A class to represent the ontology information used by a cellxgene schema version.""" + version: str + """The schema version used by the class instance.""" + supported_ontologies: Dict[str, Any] + """A dictionary of supported ontologies for the schema version.""" + ontology_file_names: Dict[str, str] + """A dictionary of ontology names and their corresponding file names.""" + def __init__(self, version: Optional[str] = None): """ From 96f8c998498ea2b2c8e3ea55db9437742c8e83d2 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Mon, 25 Mar 2024 11:13:56 -0700 Subject: [PATCH 18/19] release --- .github/workflows/build-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index a9bddda..b1bd401 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - "*" jobs: build: From 4b0eaf68e38d0aeb5742f6b37bd93eb53a9827b7 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Mon, 25 Mar 2024 11:14:43 -0700 Subject: [PATCH 19/19] undo --- .github/workflows/build-docs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index b1bd401..a9bddda 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - "*" jobs: build: