Skip to content

Commit

Permalink
Document how to add Examples and test them in docs.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 613615583
  • Loading branch information
vroulet authored and OptaxDev committed Mar 7, 2024
1 parent de46234 commit 18110a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ build the documentation locally as follows:
* `make html-noplot` (faster, skips running examples)


### Running doctest
You can add examples illustrating how to use the functions in docstrings. For
inspiration see the `Examples:` section of the code source of `adam` in
`optax/_src/alias.py`.

To test locally such examples, run
`python -m doctest -v <path_to_your_file>.py`.

(inclusion_criteria)=
## Inclusion Criteria

Expand All @@ -43,7 +51,6 @@ To ensure Optax remains a focused and high-quality library, we have specific gui
If your algorithm doesn't meet the main package criteria, the {doc}`api/contrib` directory is perfect for sharing innovative work.



#### Design Documents

For more complex or involved features, we recommend starting by writing a
Expand Down

0 comments on commit 18110a4

Please sign in to comment.