Apply doctest to existing documents.
See original GitHub issueThough we’ve introduced doctest in #702, many existing examples are still incompatible with doctest. This issue is to ~list up those examples and~ apply doctest to them.
Below are files to be fixed, listed up in https://github.com/optuna/optuna/issues/734#issuecomment-586678423. (Thanks @keisuke-umezawa for your consolidating the information!)
- optuna/visualization/parallel_coordinate
- optuna/visualization/slice
- optuna/visualization/intermediate_values
- optuna/visualization/optimization_history
- optuna/visualization/contour
- optuna/logging
- optuna/storages/rdb/storage
- optuna/trial
- optuna/pruners/successive_halving
- optuna/pruners/nop
- optuna/pruners/median
- optuna/pruners/percentile
- optuna/integration/cma
- optuna/integration/lightgbm
- optuna/integration/mxnet
- optuna/integration/chainermn
- optuna/integration/fastai
- optuna/integration/keras
- optuna/integration/pytorch_ignite
- optuna/integration/tensorflow
- optuna/integration/sklearn
- optuna/integration/skopt
- optuna/integration/pytorch_lightning
- optuna/integration/xgboost
- optuna/integration/tfkeras
- optuna/integration/chainer
- ~optuna/structs~
- see also the discussion about
structs.py
- see also the discussion about
- optuna/samplers/tpe/sampler
- optuna/samplers/random
- optuna/exceptions
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (24 by maintainers)
Top Results From Across the Web
doctest — Test interactive Python examples — Python 3.11.1 ...
Another simple application of doctest is testing interactive examples in a text file. This can be done with the testfile() function:.
Read more >Python's doctest: Document and Test Your Code at Once
With doctest , you can execute test cases from your documentation, your dedicated test files, and the docstrings in your code files. In...
Read more >doctest – Testing through documentation - PyMOTW
doctest lets you test your code by running examples embedded in the documentation and verifying that they produce the expected results.
Read more >How To Write Doctests in Python - DigitalOcean
In a program, we can import and call the doctest module in our if __name__ == "__main__": clause at the bottom of our...
Read more >How to run doctests — pytest documentation
By default, all files matching the test*.txt pattern will be run through the python standard doctest module. You can change the pattern by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I greped files which use
.. code ::
. I think it means we need to fix them.Also, I greped by
>>>
. Additionally above, we found the following files.@g-votte @keisuke-umezawa
Thanks for listing up!
optuna/exceptions.py
(#958) andoptuna/trial.py
(#882) are already merged. Could you mark them as completed? Also, doctest foroptuna/structs
is removed in this discussion.I will tackle
optuna/pruners/**
next. Thanks!