Skip to content
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

DOC: Add examples for (most) user-facing functions [pyOpenSci review] #237

Open
NickleDave opened this issue Jan 19, 2024 · 1 comment
Open

Comments

@NickleDave
Copy link

The pyOpenSci review requires examples "for all user-facing functions".

My impression reading the API docs is that there are some examples, e.g. for the load method of the plenoptic.synthesize.Metamer class:
https://plenoptic.readthedocs.io/en/latest/api/plenoptic.synthesize.html#plenoptic.synthesize.metamer.Metamer.load

But that there are some frequently used methods and functions that do not have examples, e.g.

I know that adding an example for every single solitary user-facing function can get quite tedious, so I would use your best judgement, but it seems like there should examples for most functions, at least for the core functionality.

Probably you will want to add built-in data first as in #235 and then leverage that in the examples.
Looks like you are already set up to use your plots in the docs? https://github.com/LabForComputationalVision/plenoptic/blob/de8f9308d0fcd24050a93b326390eb4444b9aff2/docs/conf.py#L48.
But you might need to do more set up to get images in rendered docstrings, like
https://github.com/librosa/librosa/blob/8dae20c66353190749486abf6b332d93c4ab2b46/docs/conf.py#L107C1-L113C4

@billbrod
Copy link
Collaborator

When I've done this, should also use pytest to run doctests, testing these examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants