From 1e22ec3cfc7a3d8fa959f622f9661ed379bcdd44 Mon Sep 17 00:00:00 2001 From: Leland McInnes Date: Wed, 14 Sep 2022 17:07:50 +0000 Subject: [PATCH 1/3] API and links messing --- doc/api.rst | 21 +++++++++++++-------- doc/basic_concepts.rst | 5 ++++- doc/building_panels.rst | 4 ++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index e8b7680..b70025b 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -5,34 +5,39 @@ TNT Provides a number of different Pane classes that can be combined and linked in various ways. The core Panes are the Plot Panes, with various associated other panes. +.. currentmodule:: {{ thisnotthat }} + Plot Panes ---------- -.. autoclass:: thisnotthat.bokeh_plot.BokehPlotPane +.. autoclass:: BokehPlotPane + + .. automethod:: __init__ + :members: -.. autoclass:: thisnotthat.deck_plot.DeckglPlotPane +.. autoclass:: DeckglPlotPane :members: Data Panes ---------- -.. autoclass:: thisnotthat.instance_viewer.InformationPane +.. autoclass:: InformationPane :members: -.. autoclass:: thisnotthat.data_viewer.DataPane +.. autoclass:: DataPane :members: Search and Edit Widgets ----------------------- -.. autoclass:: thisnotthat.search.SearchWidget +.. autoclass:: SearchWidget :members: -.. autoclass:: thisnotthat.label_editor.LabelEditorWidget +.. autoclass:: LabelEditorWidget :members: -.. autoclass:: thisnotthat.plot_controls.PlotControlWidget +.. autoclass:: PlotControlWidget :members: @@ -42,5 +47,5 @@ There are various methods for achieving this. Cluster Labelling Methods ------------------------- -.. automodule:: thisnotthat.map_cluster_labelling +.. automodule:: map_cluster_labelling :members: diff --git a/doc/basic_concepts.rst b/doc/basic_concepts.rst index 60435eb..20fc5d5 100644 --- a/doc/basic_concepts.rst +++ b/doc/basic_concepts.rst @@ -105,4 +105,7 @@ in Panel, and you can even make use of `templates`_ for more polished apps. .. _Param documentation: https://param.holoviz.org/getting_started.html .. _linking docs: https://panel.holoviz.org/user_guide/Links.html .. _layout options: https://panel.holoviz.org/reference/index.html#layouts -.. _templates: https://panel.holoviz.org/user_guide/Templates.html \ No newline at end of file +.. _templates: https://panel.holoviz.org/user_guide/Templates.html +.. _Row: https://panel.holoviz.org/reference/layouts/Row.html +.. _Column: https://panel.holoviz.org/reference/layouts/Column.html +.. _GridSpec: https://panel.holoviz.org/reference/layouts/GridSpec.html \ No newline at end of file diff --git a/doc/building_panels.rst b/doc/building_panels.rst index 959289b..46381bd 100644 --- a/doc/building_panels.rst +++ b/doc/building_panels.rst @@ -20,8 +20,8 @@ functionality and performance. Choosing the right PlotPane type for your task wi go a long way toward making your Panel effective. Currently TNT supports the following PlotPane types: -* :py:class:`~thisnotthat.BokehPlotPane` -* :py:class:`~thisnotthat.DeckglPlotPane` +* :py:class:`~BokehPlotPane` +* :py:class:`~DeckglPlotPane` and we hope that more can be added in the future. The API documentation for each PlotPane type will provide the most details on the capabilities of the PlotPanes, but here is a useful From 127f7f1cde29bfe1f8fcd5e9401dcafe81c729eb Mon Sep 17 00:00:00 2001 From: Leland McInnes Date: Wed, 14 Sep 2022 20:36:43 +0000 Subject: [PATCH 2/3] Try to work better with Param in formatting doctsrings --- doc/api.rst | 23 +++++++++++------------ doc/conf.py | 14 ++++++++++++++ doc/requirements.txt | 2 ++ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index b70025b..52cdd07 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -5,40 +5,37 @@ TNT Provides a number of different Pane classes that can be combined and linked in various ways. The core Panes are the Plot Panes, with various associated other panes. -.. currentmodule:: {{ thisnotthat }} +.. currentmodule:: thisnotthat Plot Panes ---------- .. autoclass:: BokehPlotPane - - .. automethod:: __init__ - - :members: + :members: add_cluster_labels .. autoclass:: DeckglPlotPane - :members: + :members: add_cluster_labels Data Panes ---------- .. autoclass:: InformationPane - :members: + :members: link_to_plot .. autoclass:: DataPane - :members: + :members: link_to_plot Search and Edit Widgets ----------------------- .. autoclass:: SearchWidget - :members: + :members: link_to_plot .. autoclass:: LabelEditorWidget - :members: + :members: link_to_plot .. autoclass:: PlotControlWidget - :members: + :members: link_to_plot Finally TNT provides tools for annotating plots with cluster labels. @@ -47,5 +44,7 @@ There are various methods for achieving this. Cluster Labelling Methods ------------------------- -.. automodule:: map_cluster_labelling +.. automodule:: thisnotthat.map_cluster_labelling :members: + + diff --git a/doc/conf.py b/doc/conf.py index 81d5c19..e401551 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -16,6 +16,10 @@ sys.path.insert(0, os.path.abspath("..")) sys.path.insert(0, os.path.abspath(".")) +import param_docs +from param_docs.paramdoc import param_format_basic, print_lines +import param +import numpydoc # -- Project information ----------------------------------------------------- @@ -29,7 +33,12 @@ master_doc = "index" +def setup(app): + app.connect("autodoc-process-docstring", param_format_basic, priority=-100) + + # -- General configuration --------------------------------------------------- +autodoc_member_order = "bysource" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -39,8 +48,13 @@ "sphinx.ext.intersphinx", "nbsphinx", "sphinx.ext.mathjax", + "numpydoc", ] +# this is needed for some reason... +# see https://github.com/numpy/numpydoc/issues/69 +numpydoc_show_class_members = False + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/doc/requirements.txt b/doc/requirements.txt index 2ce104a..7d0e3b2 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -8,3 +8,5 @@ scikit-learn umap-learn hdbscan apricot-select +numpydoc +git+https://github.com/lmcinnes/param_docs \ No newline at end of file From 7c66d4c1f79220bc138b28ed7007839db3b1adf9 Mon Sep 17 00:00:00 2001 From: Leland McInnes Date: Wed, 14 Sep 2022 20:55:12 +0000 Subject: [PATCH 3/3] Try to work better with Param in formatting doctsrings --- doc/api.rst | 4 ++-- doc/conf.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 52cdd07..4c4eb1f 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -1,9 +1,9 @@ TNT API Guide ============= -TNT Provides a number of different Pane classes that can be combined and +TNT Provides a number of different Pane adn Widget classes that can be combined and linked in various ways. The core Panes are the Plot Panes, with various -associated other panes. +associated other panes and widgets. .. currentmodule:: thisnotthat diff --git a/doc/conf.py b/doc/conf.py index e401551..1506b42 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -34,7 +34,7 @@ def setup(app): - app.connect("autodoc-process-docstring", param_format_basic, priority=-100) + app.connect("autodoc-process-docstring", param_format_basic, priority=-200) # -- General configuration ---------------------------------------------------