From 75256130a030e396af3008273b3ee19b194e309b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sophia=20M=C3=A4dler?= <15019107+sophiamaedler@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:43:29 +0100 Subject: [PATCH] add example notebook gallery --- docs/Makefile | 1 + docs/conf.py | 5 +-- docs/index.rst | 1 + docs/pages/_notebook_sharded_hpa.nblink | 3 ++ docs/pages/_notebook_sharded_large.nblink | 3 ++ docs/pages/example_notebooks.ipynb | 44 +++++++++++++++++++++++ examples/notebooks | 2 +- requirements_dev.txt | 1 + 8 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 docs/pages/_notebook_sharded_hpa.nblink create mode 100644 docs/pages/_notebook_sharded_large.nblink create mode 100644 docs/pages/example_notebooks.ipynb diff --git a/docs/Makefile b/docs/Makefile index 101acc4..868d46e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -23,6 +23,7 @@ help: @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) clean: + rm -rf $(SOURCEDIR)/auto_examples rm -rf $(BUILDDIR)/html/* rm -rf $(BUILDDIR)/latex/* rm -rf $(BUILDDIR)/doctrees/* diff --git a/docs/conf.py b/docs/conf.py index 1243d42..5b345ac 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,6 +34,7 @@ def setup(app): "sphinxarg.ext", "sphinx_rtd_theme", "nbsphinx", + "nbsphinx_link", "sphinx_design", "sphinx_copybutton", "sphinx_gallery.gen_gallery" @@ -92,8 +93,8 @@ def setup(app): html_logo = "_static/scPortrait_logo_light.svg" #set up sphinx gallery -sg_examples_dir = ["../examples/code_snippets"] -sg_gallery_dir = ["auto_examples/code_snippets"] +sg_examples_dir = ["../examples/code_snippets",] +sg_gallery_dir = ["auto_examples/code_snippets",] sphinx_gallery_conf = { "doc_module": "scportrait", diff --git a/docs/index.rst b/docs/index.rst index 839fcd1..a6ed7cf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -58,6 +58,7 @@ Documentation :caption: Code Examples auto_examples/code_snippets/index + pages/example_notebooks.ipynb .. toctree:: :maxdepth: 2 diff --git a/docs/pages/_notebook_sharded_hpa.nblink b/docs/pages/_notebook_sharded_hpa.nblink new file mode 100644 index 0000000..0b2a521 --- /dev/null +++ b/docs/pages/_notebook_sharded_hpa.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../examples/notebooks/example_projects/example_2/processing_notebook.ipynb" +} \ No newline at end of file diff --git a/docs/pages/_notebook_sharded_large.nblink b/docs/pages/_notebook_sharded_large.nblink new file mode 100644 index 0000000..ac0bd20 --- /dev/null +++ b/docs/pages/_notebook_sharded_large.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../examples/notebooks/example_projects/example_1/processing_notebook_sharded.ipynb" +} \ No newline at end of file diff --git a/docs/pages/example_notebooks.ipynb b/docs/pages/example_notebooks.ipynb new file mode 100644 index 0000000..34130b5 --- /dev/null +++ b/docs/pages/example_notebooks.ipynb @@ -0,0 +1,44 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example Projects" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [ + "nbsphinx-gallery" + ] + }, + "source": [ + "* [Sharded Cellpose Segmentation](_notebook_sharded_large.nblink)\n", + "* [Sharded Cellpose Segmentation on human protein atlas images](_notebook_sharded_hpa.nblink)\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/notebooks b/examples/notebooks index e8da8c8..3b8c935 160000 --- a/examples/notebooks +++ b/examples/notebooks @@ -1 +1 @@ -Subproject commit e8da8c863d5f9da93805658ccd0c61761aa84f44 +Subproject commit 3b8c935e7f8f4d5559c2a4e1d08b21698212451d diff --git a/requirements_dev.txt b/requirements_dev.txt index 447430a..0081ee4 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -43,6 +43,7 @@ sphinx sphinx-argparse sphinx-rtd-theme==2.0.0 nbsphinx +nbsphinx-link sphinx-book-theme sphinx-design sphinx-copybutton