diff --git a/.github/workflows/publish_docs.yaml b/.github/workflows/publish_docs.yaml new file mode 100644 index 000000000..f2654dc09 --- /dev/null +++ b/.github/workflows/publish_docs.yaml @@ -0,0 +1,64 @@ +name: Build Documentation + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - created + +permissions: + contents: write + pages: write + +jobs: + build-deploy: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python 3.9 + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Install prerequisites + run: | + pip install --upgrade \ + pip \ + wheel \ + setuptools \ + setuptools-scm + + - name: Install TileDB-Cloud-Py with doc dependencies + run: | + pip install .[docs] + + - name: Qartodoc Build + run: | + quartodoc build --config docs/_quarto.yaml + + - name: Render Docs + uses: quarto-dev/quarto-actions/render@v2 + with: + path: docs/ + + # Publish Docs only when a new release is created + - name: Publish Rendered Docs + if: github.event_name == 'release' + uses: quarto-dev/quarto-actions/publish@v2 + with: + target: gh-pages + path: docs/ + render: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 2e8ded98c..ba4b83046 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,17 @@ See [Quickstart](https://docs.tiledb.com/cloud/quickstart) section of the docs. See https://tiledb-inc.github.io/TileDB-Cloud-Py/ +#### Contribute to documentation + +Documentation uses [Quarto](https://quarto.org/) style documentation. + +- Install [Quarto for your OS](https://quarto.org/docs/get-started/) +- Install documentation dependencies: `pip install .[docs]` +- Update the [docs/\_quarto.yaml](docs/_quarto.yaml) file accordingly ([read the quartodoc documentation on how to do that](https://quarto.org/docs/get-started/)) +- Build the docs: `quartodoc build --config docs/_quarto.yaml` +- Preview the generated docs: `quarto preview docs/` +- Create a relevant PR + ### Testing - Selection: diff --git a/docs/.gitignore b/docs/.gitignore index 009afebba..44f341313 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,5 +1,7 @@ +/.quarto/ _build -_static -#_templates -build -_autosummary +reference + +# interlinks +objects.json +_sidebar.yml diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d0c3cbf10..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/TileDB_logo_primary.png b/docs/TileDB_logo_primary.png new file mode 100644 index 000000000..8448fd3a7 Binary files /dev/null and b/docs/TileDB_logo_primary.png differ diff --git a/docs/_quarto.yaml b/docs/_quarto.yaml new file mode 100644 index 000000000..503dabeca --- /dev/null +++ b/docs/_quarto.yaml @@ -0,0 +1,192 @@ +project: + type: website + output-dir: _build + +website: + # title: "Cloud-Py" + description: "TileDB's Cloud Client for Python" + repo-url: https://github.com/TileDB-Inc/TileDB-Cloud-Py/ + favicon: "t_favicon.png" + page-navigation: true + navbar: + background: light + logo: "TileDB_logo_primary.png" + pinned: true + left: + - text: Get Started + file: get_started.qmd + - text: API + file: reference/index.qmd + + sidebar: + style: "floating" + collapse-level: 1 + contents: + - Cloud-Py + - section: Cloud Services + contents: + - text: "`array`" + href: reference/array.qmd + - text: "`asset`" + href: reference/asset.qmd + - text: "`client`" + href: reference/client.qmd + - text: "`cloudarray`" + href: reference/cloudarray.qmd + - text: "`config`" + href: reference/config.qmd + - text: "`file`" + href: reference/file.qmd + - text: "`groups`" + href: reference/groups.qmd + - text: "`invites`" + href: reference/invites.qmd + - text: "`notebook`" + href: reference/notebook.qmd + - text: "`pool_manager_wrapper`" + href: reference/pool_manager_wrapper.qmd + - text: "`tasks`" + href: reference/tasks.qmd + - text: "`tiledb_cloud_error`" + href: reference/tiledb_cloud_error.qmd + - text: "`udf`" + href: reference/udf.qmd + - text: "`utils`" + href: reference/utils.qmd + - section: Bio-Imaging + contents: + - text: "`exportation`" + href: reference/bioimg.exportation.qmd + - text: "`helpers`" + href: reference/bioimg.helpers.qmd + - text: "`ingestion`" + href: reference/bioimg.ingestion.qmd + - section: Compute + contents: + - text: "`delayed`" + href: reference/compute.delayed.qmd + - section: DAG + contents: + - text: "`dag`" + href: reference/dag.dag.qmd + - text: "`mode`" + href: reference/dag.mode.qmd + - text: "`status`" + href: reference/dag.status.qmd + - text: "`visualization`" + href: reference/dag.visualization.qmd + - section: Files + contents: + - text: "`indexing`" + href: reference/files.indexing.qmd + - text: "`ingestion`" + href: reference/files.ingestion.qmd + - text: "`udfs`" + href: reference/files.udfs.qmd + - text: "`utils`" + href: reference/files.utils.qmd + - section: Geospatial + contents: + - text: "`ingestion`" + href: reference/geospatial.ingestion.qmd + - section: SOMA + contents: + - text: "`ingest`" + href: reference/soma.ingest.qmd + - text: "`mapper`" + href: reference/soma.mapper.qmd + - section: VCF + contents: + - text: "`allele_frequency`" + href: reference/vcf.allele_frequency.qmd + - text: "`ingestion`" + href: reference/vcf.ingestion.qmd + - text: "`query`" + href: reference/vcf.query.qmd + - text: "`utils`" + href: reference/vcf.utils.qmd + - section: Utilities + contents: + - text: "`consolidate`" + href: reference/utilities.consolidate.qmd + - text: "`profiler`" + href: reference/utilities.profiler.qmd + +quartodoc: + style: pkgdown + parser: sphinx + package: tiledb.cloud + title: API Reference + + sections: + - title: Cloud Services + desc: Cloud Interaction Services + contents: + - array + - asset + - client + - cloudarray + - config + - file + - groups + - invites + - notebook + - pool_manager_wrapper + - tasks + - tiledb_cloud_error + - udf + - utils + + - title: bioimg + desc: Bio imaging API + contents: + - bioimg.exportation + - bioimg.helpers + - bioimg.ingestion + + - title: compute + desc: Compute API + contents: + - compute.delayed + + - title: dag + desc: DAG API + contents: + - dag.dag + - dag.mode + - dag.status + - dag.visualization + + - title: files + desc: File API. + contents: + - files.indexing + - files.ingestion + - files.udfs + - files.utils + + - title: geospatial + desc: Geospatial API + contents: + - geospatial.ingestion + + - title: soma + desc: SOMA API + contents: + - soma.ingest + - soma.mapper + + - title: vcf + desc: VCF API + contents: + - vcf.allele_frequency + - vcf.ingestion + - vcf.query + - vcf.utils + + - title: utilities + desc: Common Utilities API + contents: + - utilities.consolidate + - utilities.profiler + # - wheel diff --git a/docs/get_started.qmd b/docs/get_started.qmd new file mode 100644 index 000000000..76cc33247 --- /dev/null +++ b/docs/get_started.qmd @@ -0,0 +1,35 @@ +--- +title: Get started with TileDB Cloud for Python +--- + +This is a starting guide for the TileDB-Cloud-Py client.
+ +# Login + +To login programmatically you will need either + +- Username and Password [of your TileDB account](https://cloud.tiledb.com/). +- Or an API Token [generated from your TileDB account](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens). + +## Username and Password method + +```python +import tiledb.cloud + +tiledb.cloud.login( + host=, + username=, + password= +) +``` + +## Token method + +```python +import tiledb.cloud + +tiledb.cloud.login( + host=, + token= +) +``` diff --git a/docs/index.qmd b/docs/index.qmd new file mode 100644 index 000000000..23939f65c --- /dev/null +++ b/docs/index.qmd @@ -0,0 +1,25 @@ +# Cloud-Py + +Welcome to TileDB's Cloud [Python client](https://github.com/TileDB-Inc/TileDB-Cloud-Py/).
+This client offers programmatic access to [TileDB Cloud](https://docs.tiledb.com/cloud). + +# Installation + +You can install the Cloud-Py SDK client as follows: + +```python +pip install tiledb-cloud +``` + +While the preferred method of running code samples and notebooks in this section is directly within TileDB Cloud (as all dependencies are installed for you), you can run most of the code samples and notebooks in this section locally. To run these code samples and notebooks locally, install the following dependencies: + +```python +pip install ipykernel jupyterlab graphviz +pip install tiledb-cloud[all] +``` + +For Life Science capabilities: + +```python +pip install tiledb-cloud[life-sciences] +``` diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 6247f7e23..000000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index e7724e060..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -sphinx >= 3.0 diff --git a/docs/source/_templates/custom-class-template.rst b/docs/source/_templates/custom-class-template.rst deleted file mode 100644 index b29757c52..000000000 --- a/docs/source/_templates/custom-class-template.rst +++ /dev/null @@ -1,32 +0,0 @@ -{{ fullname | escape | underline}} - -.. currentmodule:: {{ module }} - -.. autoclass:: {{ objname }} - :members: - :show-inheritance: - :inherited-members: - - {% block methods %} - .. automethod:: __init__ - - {% if methods %} - .. rubric:: {{ _('Methods') }} - - .. autosummary:: - {% for item in methods %} - ~{{ name }}.{{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block attributes %} - {% if attributes %} - .. rubric:: {{ _('Attributes') }} - - .. autosummary:: - {% for item in attributes %} - ~{{ name }}.{{ item }} - {%- endfor %} - {% endif %} - {% endblock %} diff --git a/docs/source/_templates/custom-module-template.rst b/docs/source/_templates/custom-module-template.rst deleted file mode 100644 index 6adfe405d..000000000 --- a/docs/source/_templates/custom-module-template.rst +++ /dev/null @@ -1,66 +0,0 @@ -{{ fullname | escape | underline}} - -.. automodule:: {{ fullname }} - - {% block attributes %} - {% if attributes %} - .. rubric:: Module Attributes - - .. autosummary:: - :toctree: - {% for item in attributes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block functions %} - {% if functions %} - .. rubric:: {{ _('Functions') }} - - .. autosummary:: - :toctree: - {% for item in functions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block classes %} - {% if classes %} - .. rubric:: {{ _('Classes') }} - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - {% for item in classes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block exceptions %} - {% if exceptions %} - .. rubric:: {{ _('Exceptions') }} - - .. autosummary:: - :toctree: - {% for item in exceptions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - -{% block modules %} -{% if modules %} -.. rubric:: Modules - -.. autosummary:: - :toctree: - :template: custom-module-template.rst - :recursive: -{% for item in modules %} - {{ item }} -{%- endfor %} -{% endif %} -{% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index b1b3019fa..000000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,86 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys - -sys.path.insert(0, os.path.abspath("../../src")) - -# -- ReadTheDocs configuration --------------------------------------------- - -# Special handling on ReadTheDocs builds. -# Some of this code is from https://github.com/robotpy/robotpy-docs/blob/master/conf.py -readthedocs = os.environ.get("READTHEDOCS", None) == "True" -rtd_version = os.environ.get("READTHEDOCS_VERSION", "latest") -rtd_version = rtd_version if rtd_version in ["stable", "latest"] else "stable" - -# -- Project information ----------------------------------------------------- - -project = "TileDB-Cloud-Py" -copyright = "2020–2023, TileDB, Inc." -author = "TileDB, Inc." - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - # 'sphinx.ext.autodoc', - #'sphinxcontrib.apidoc', - "sphinx.ext.autodoc", # Core library for html generation from docstrings - "sphinx.ext.autosummary", # Create neat summary tables -] -autosummary_generate = True -autodoc_mock_imports = [ - "networkx", - "tiledb.cloud.cloudarray", - "tiledb.cloud.testonly", - "tiledb.cloud.rest_api.test", -] - -source_suffix = [".rst", ".md"] - -master_doc = "index" - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_autosummary/tiledb.cloud.rest_api.test.*"] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -# html_theme = 'alabaster' -if readthedocs: - html_theme = "default" -else: - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -html_sidebars = { - "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"] -} diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index d2fd865e7..000000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. TileDB-Cloud-Py documentation master file, created by - sphinx-quickstart on Wed Sep 16 07:29:52 2020. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to TileDB-Cloud-Py's documentation! -=========================================== - -.. autosummary:: - :toctree: _autosummary - :template: custom-module-template.rst - :recursive: - - tiledb.cloud - tiledb.cloud.array - tiledb.cloud.client - tiledb.cloud.compute - tiledb.cloud.config - tiledb.cloud.dag - tiledb.cloud.file - tiledb.cloud.groups - tiledb.cloud.invites - tiledb.cloud.notebook - tiledb.cloud.pool_manager_wrapper - tiledb.cloud.rest_api - tiledb.cloud.sql - tiledb.cloud.taskgraphs - tiledb.cloud.tasks - tiledb.cloud.tiledb_cloud_error - tiledb.cloud.udf - tiledb.cloud.utils - tiledb.cloud.version - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` -.. * :ref:`api/modules` diff --git a/docs/t_favicon.png b/docs/t_favicon.png new file mode 100644 index 000000000..6888c28a3 Binary files /dev/null and b/docs/t_favicon.png differ diff --git a/pyproject.toml b/pyproject.toml index b08182c58..60f59281a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ viz-tiledb = ["networkx>=2", "pydot", "tiledb-plot-widget>=0.1.7"] viz-plotly = ["networkx>=2", "plotly>=4", "pydot"] all = ["networkx>=2", "plotly>=4", "pydot", "tiledb-plot-widget>=0.1.7"] life-sciences = ["tiledbsoma"] - +docs = ["quartodoc"] dev = ["black", "pytest", "ruff"] tests = [ "xarray",