-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desired structure for examples in the code base #2327
Comments
Thanks for this clear summary. Clearly the organisation is not good and the main purpose was technical because the sphinx-gallery is making a separate folder. |
Thanks! Overall I think the docs are very comprehensive and contain a lot of important information. Mostly I would suggest structural changes so that users can quickly find relevant information related to their use case. As a relatively naive user of the documentation I would suggest the following changes, mostly based on the [https://diataxis.fr/] approach
Thing I would suggest are removed from the front page are:
Would be happy to help with any of these! |
I think 1 is a great idea and 2 I think is more related to sphinx's own recommendation to pin once you get things working, but it's easy enough to do a test PR with it pinned to a recent version just to see how things look. For 3 maybe we create a section called
Then we have a Tutorials and Examples section (as you described), but since the module_gallery is created by sphinx-gallery combining that with How to/tutorials will just require some toctree troubleshooting. I personally still like having a narrative section. So for me I would like to have the modules documentation in its narrative form as a separate section. I think some duplication between the narrative docs and the example docs would be nice. For me I don't need to see examples, but I always go to the Widgets docs to remember the names of functions. So in my dream world the index would be: Overview I also don't know where Viewers would go. |
I think that the core principle is that documentation (and decisions about documentation) should be made in terms of how they will be used and not in terms of how we are producing it. The latter is a programming problem that we can solve with scripts or CI and coupling these two concepts has if they were one has lead to the current confusion. @JoeZiminski said:
I agree with this and I will add that having a framework like the one proposed by Daniele Procida and already used in projects like Django will avoid a lot of discussion among us of where things should be: |
I actually support this (in case that wasn't clear). For me I meant more from an indexing perspective I would like it to be split at a first level as:
Or if you prefer:
Right now I think how_to (more structured like traditional full tutorials) vs gallery (which are examples, but also easy quick how_to) |
@h-mayorquin, just wanted to bring this back on your radar. With the big api change maybe we can also get @chrishalcrow's opinion on re-organizing some of the documentation to best facilitate end-user learning. :) |
I've also been learning to use spikeinterface in the past couple of months, so just had the "new user" experience! I think there's a consensus that we should have a Tutorials page with longer form learning guides. Then "how to"s which are shorter. To me, the current modules documentation seems closer to the "Explanation" part of in @h-mayorquin 's graph. Then the API is a full reference guide. So my proposal would be
And these four cover the four quadrants of the graph. Or my reading of @zm711 's proposal is something like:
Which works too! Just to explain the sphinx-build complications. In the tutorials (and maybe other places), you often want to use some real dataset to show off some features. And sometimes do some long calculations. We don't want these to become part of the CI, so at the moment we write a .py file, convert it to a jupyter notebook, run it, save the output, convert it to .rst all locally. Then put that (+ the output'd figures etc) in the We should definitely update sphinx! I've been playing with some fun sphinx-design stuff too! (TABS! I also think we should improve the "how to contribute" documentation for people with little git experience (me!). Neo has a nice page: https://neo.readthedocs.io/en/latest/contributing.html which I've been using. If we agree on an overall structure, I have time to work on this stuff. |
I'm fine with either layout. Probably the first is a bit closer to what I would expect the toctree to be
Maybe @samuelgarcia and @alejoe91 can weigh in if they feel strongly against it?
I think @h-mayorquin did a big push for that and I did the most recent update, but if you have more suggestions I'd be happy to hear them. I think eventually it'd be nice to be able to say make a dev environment run pytest and you're good to go. But that doesn't work for windows yet, so I also want to be careful how much we promise there. I don't even know who wrote neo's... but kudos to them! Finally,
Maybe @h-mayorquin has a better idea but couldn't we do like a cron job of running this. So once a month (a quarter ou trimestre) it refreshes the examples and then opens a PR that we could merge or close. Right now the big tutorials get some edits but don't necessarily get rerun, so we've had stale tutorials for a while (before your big push @chrishalcrow!). I think a cron opening a PR will at least force us to not let those get stale. |
Also closing this. Let's move future discussions of this over to #2800 since we've completed the broad reorganization and now everything else will be more granular changes. |
Hey @zm711 would you mind reopening this for some additional discussion I'd like to have on How To vs. Tutorials? At present (on main branch) these are split based on whether they are built with sphinx-gallery or not. However thematically some are how-to and some are full tutorials (I have my take on their split here, although how I think handling-drift is a tutorial). This is a little bit tricky because sphinx-gallery by default uses a 'gallery examples' frontpage that displays cards that link to each individual sphinx-gallery page. In theory this makes it difficult to mix-and-match sphinx-gallery pages and non-sphinx-gallery pages linked to from the same page. For the 'Tutorials', I think it makes sense that these are all sphinx-gallery pages. For 'How To' however, some necessarily contain a reasonable amount of code while others have no code. I think it is best to use sphinx-gallery for anything with code, but it is a pain to use them for non-code pages because the formatting is kind of annoying and you lose some intrinsic sphinx features. For the 'How To' page I might suggest we make our own There are a few long-form tutorials with a lot of code in the 'How To' section (like the handling drift) that are manually built. I would suggest converting these to sphinx-gallery pages. Therefore a plan could be:
I'm very happy to get started on this ASAP if there is agreement. |
Sure @JoeZiminski I'll reopen for discussion! |
Agree strongly with this. I think is only one thing, right? It is also making the diff worse because we need the images there.
Can we change this? I would not like a sphinx-gallery default to determine the way that we structure our documentation. That is, maybe we like the format of sphinx-gallery presentation and want everything to look like it but we shouldn't have to if we don't want or is not the best. |
I agree with this, I played around with building a custom index 'gallery-like' page that can link to both normal pages and sphinx-gallery pages and it worked well. I'll open a PR to start on (1) as I don't think there will be much disagreement on it, and do an example for (2) and (3). |
I agree with the plan @JoeZiminski ! Sounds great. A (much worse!) version of the idea, which tries to keep the auto-generated sphinx frontpage, is currently seen on the Tutorials page: https://spikeinterface.readthedocs.io/en/latest/tutorials/index.html I'm not a huge fan of the sphinx-gallery cards, so I like that we'll have some styling control of them on the HowTo page! |
That's nice I think that's very useful too, if there are many tutorials or how-tos all on one page it might be useful to split them up and link between them as text links! I'll push a PR soon on converting the article on working with drift correction and see what people say. |
Are we done with this issue for now? ie should we open a fresher issue for newer discussions? |
I think not quite, once #2881 is solved it will unlock everything related to this as it will allow us to place pages on How To / Tutorials however we like. I believe the approach outlined in #2879 is not optimal and from our discussions the best approach is to have everything as sphinx-gallery using simulated data and then build / don't build certain files using the sphinx machinery based on the tags (i.e. for fast local building). I'm really keen on this, it's definitely on the TODO list but new things keep pushing it further down 😅 |
Inspired by #2316,
There are two main places to put actual examples in the documentation:
The
modules_gallery
or thehow_to
. It is currently unclear what the separate goals for these two sections are/ought to be. Either way both are stored in examples, butmodules_gallery
are run bysphinx-gallery
whereashow_to
are run locally (by Sam or Alessio) and added to the documentation later.Topics of Discussion
What are the purposes for these two separate example streams?
Are they currently appropriately discoverable (ie do they need better names)?
Do they need to be improved (ie even we are keeping the
modules_gallery
what improvements need to be made to make it as useful as possible)?What rules (if any) do developers need to know to provide examples for the documentation code base?
Outputs
If there is a clear consensus/set of rules we can add this to the developer docs so we can keep track of this and try to ensure our examples documentation follows a rough set of guidelines (even if they are not hard rules)
The text was updated successfully, but these errors were encountered: