Skip to content

Show example plots as part of documentation #1604

Closed

Description

@fidelram

In seaborn, the docstring example plots are shown as part of the documentation. Would be great to have this as part of scanpy as this will motivate the creation of more examples as part of the docstring while keeping them up-to-date.

See for example: https://seaborn.pydata.org/generated/seaborn.catplot.html
image

Does anyone has experience on how to achieve this?

Activity

  1. giovp commented on Jan 22, 2021

    @giovp
    Member

    @fidelram that's a really great point and something I'd like to discuss at next meeting (already put it in the agenda).

    Another great example of such examples 😅 is the way @michalk8 set it up for cellrank and squidpy [not yet public].
    The even nicer thing is that @michalk8 implemented a CI pipeline for the tutorials/examples part of the repo so that every time there is a change in master of the original repo, the examples are refreshed in the notebooks repo, so to have them always up to date.

    Would be really cool to concentrate efforts and try to get this logic also in scanpy (makes it both very user friendly and robust from a maintainer perspective)

  2. ivirshup commented on Jan 24, 2021

    @ivirshup
    Member

    I would love to have this! I've been talking about this with @falexwolf and a bit with @flying-sheep.

    Seaborn uses a sphinx extension from matplotlib to generate the plots (plot directive).

    I would definitely like to get tutorials running on CI as well, but think this is a little separate (some previous discussion: #302).

    1. Tutorials can use a lot more computational resources than plotting.
    2. These examples are written in the docstrings, while tutorials are currently in notebooks. It'll probably be a different set of tools to render these.
  3. fidelram commented on Jan 29, 2021

    @fidelram
    CollaboratorAuthor

    I tried the sphinx extension but could not get any result. Can somebody take over this?

  4. added this to the 1.8.0 milestone on Feb 4, 2021
  5. ivirshup commented on May 11, 2021

    @ivirshup
    Member

    Closed, as the initial issue is done, and being tracked elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions