Skip to content

Conversation

@NicolasHug
Copy link
Contributor

@NicolasHug NicolasHug commented Nov 6, 2024

This PR adds docstring to the samplers. This is just docstrings, not the entire docs. Tutorials / examples / user guides will come later.

This PR is best reviewed by checking it out locally, building and visualizing the docs on your own machine. Alternatively you can download the built docs artifacts from the CI job.

You'll see that I went for a non-classical way of specifying the docs. Similar setups exist in repos like pytorch/pytorch. The main advantage is that it can centralize the docs, avoids repetition, and makes edits easier. The main drawback is that docs are harder to figure out when browsing the code - getting the docs require going online to see the html files.

I don't mind reverting to a more conventional setup if you prefer, but I'll ask to do this only later, when the docs are a bit more stable. I will be writing tutorials in follow-up PRs, and I suspect I'll have to update the docstrings. It will be a lot easier to do so in the current setup.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 6, 2024
@NicolasHug NicolasHug marked this pull request as ready for review November 6, 2024 13:18
invalid indices, so the ``policy`` parameter defines how to replace
those frames, with valid indices:
- "repeat": repeats the last valid frame of the clip. We would get
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really minor, but the left quotation mark for "repeat", "wrap" and "error" is facing the wrong way in the rendered docs. I'm not sure how or even if we can fix it. Uses of quotes in the middle of text seem fine (like "dilation" on line 240).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this too lol, no idea why. This is likely related to the pytorch-sphinx-theme css style.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯_(ツ)_/¯

@scotts
Copy link
Contributor

scotts commented Nov 6, 2024

This looks great, all of my comments are just minor improvements.

On the code organization: makes sense to me, let's go with this and see how it feels to live with it. One thought: should we put a comment (not a docstring!) at the top of the functions themselves saying that the official docs are in _common.py?

@NicolasHug NicolasHug merged commit 42fa254 into meta-pytorch:main Nov 6, 2024
20 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants