Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make sphinx build without warnings, let circle IO error on warnings #6025

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

Closed
amueller opened this issue Dec 14, 2015 · 5 comments · Fixed by #15633
Closed

Make sphinx build without warnings, let circle IO error on warnings #6025

amueller opened this issue Dec 14, 2015 · 5 comments · Fixed by #15633

Comments

@amueller
Copy link
Member

We should fix the remaining sphinx warnings here:
https://circleci.com/gh/scikit-learn/scikit-learn/1629

and then make circle IO error if there are any warnings (grep'ing for WARNINGS I guess?).

This way we immediately see if someone broke anything in the docs.

@mrshu
Copy link
Contributor

mrshu commented Dec 14, 2015

@amueller Which sphinx warnings do you have in mind? There seem to be quite a few of them:

/home/ubuntu/scikit-learn/doc/about.rst:163: WARNING: nonlocal image URI found: http://f.hypotheses.org/wp-content/blogs.dir/331/files/2011/03/Logo-TPT.jpg
/home/ubuntu/scikit-learn/doc/about.rst:163: WARNING: nonlocal image URI found: http://www.tinyclues.com/static/img/logo.png
/home/ubuntu/scikit-learn/doc/about.rst:163: WARNING: nonlocal image URI found: http://www.afpy.org/logo.png
/home/ubuntu/scikit-learn/doc/about.rst:163: WARNING: nonlocal image URI found: http://www.fnrs.be/uploaddocs/images/COMMUNIQUER/FRS-FNRS_rose_transp.png
/home/ubuntu/scikit-learn/doc/about.rst:174: WARNING: nonlocal image URI found: http://f.hypotheses.org/wp-content/blogs.dir/331/files/2011/03/Logo-TPT.jpg
/home/ubuntu/scikit-learn/doc/about.rst:179: WARNING: nonlocal image URI found: http://www.tinyclues.com/static/img/logo.png
/home/ubuntu/scikit-learn/doc/about.rst:184: WARNING: nonlocal image URI found: http://www.afpy.org/logo.png
/home/ubuntu/scikit-learn/doc/about.rst:189: WARNING: nonlocal image URI found: http://www.svi.cnrs-bellevue.fr/wikimedia/images/Logo_svi_inp.png
/home/ubuntu/scikit-learn/doc/about.rst:193: WARNING: nonlocal image URI found: http://www.fnrs.be/uploaddocs/images/COMMUNIQUER/FRS-FNRS_rose_transp.png
/home/ubuntu/scikit-learn/doc/about.rst:None: WARNING: nonlocal image URI found: http://sites.uclouvain.be/dysco/pmwiki/uploads/Main/dysco.gif
../sklearn/datasets/descr/breast_cancer.rst:33: WARNING: Field list ends without a blank line; unexpected unindent.
datasets/covtype.rst:5: WARNING: duplicate label covtype, other instance in /home/ubuntu/scikit-learn/doc/datasets/covtype.rst
/home/ubuntu/scikit-learn/doc/datasets/labeled_faces.rst:4: WARNING: duplicate label labeled_faces_in_the_wild, other instance in /home/ubuntu/scikit-learn/doc/datasets/index.rst
/home/ubuntu/scikit-learn/doc/datasets/mldata.rst:10: WARNING: duplicate label mldata, other instance in /home/ubuntu/scikit-learn/doc/datasets/index.rst
/home/ubuntu/scikit-learn/doc/datasets/olivetti_faces.rst:5: WARNING: duplicate label olivetti_faces, other instance in /home/ubuntu/scikit-learn/doc/datasets/index.rst
/home/ubuntu/scikit-learn/doc/datasets/rcv1.rst:5: WARNING: duplicate label rcv1, other instance in /home/ubuntu/scikit-learn/doc/datasets/index.rst
/home/ubuntu/scikit-learn/doc/datasets/twenty_newsgroups.rst:4: WARNING: duplicate label 20newsgroups, other instance in /home/ubuntu/scikit-learn/doc/datasets/index.rst
/home/ubuntu/scikit-learn/doc/developers/advanced_installation.rst:6: WARNING: Duplicate explicit target name: "pypi".
/home/ubuntu/scikit-learn/doc/modules/classes.rst:2: WARNING: Literal block expected; none found.
/home/ubuntu/scikit-learn/doc/modules/classes.rst:2: WARNING: Literal block expected; none found.
/home/ubuntu/scikit-learn/doc/modules/classes.rst:2: WARNING: Literal block expected; none found.

There are also things like

/home/ubuntu/scikit-learn/doc/datasets/kddcup99.rst:: WARNING: document isn't included in any toctree
/home/ubuntu/scikit-learn/doc/documentation.rst:: WARNING: document isn't included in any toctree
/home/ubuntu/scikit-learn/doc/themes/scikit-learn/static/ML_MAPS_README.rst:: WARNING: document isn't included in any toctree
/home/ubuntu/scikit-learn/doc/tune_toc.rst:: WARNING: document isn't included in any toctree

which I do not think is really a good reason for breaking a build.

In any case I am happy to implement whatever you decide would is best!

@amueller
Copy link
Member Author

these are easy to fix failures.
Why do you think these are not good things to fail on?

The current mode is that these errors accumulate and before the release I spend half a week on fixing these.

There is things like

[u"cross_val_predict(estimator, X, y=None, labels=None, cv=None, n_jobs=1, verbose=0, fit_params=None, pre_dispatch='2*n_jobs')", u':module: sklearn.model_selection', u'', u'', u'', u'Generate cross-validated estimates for each input data point', u'', u'Read more in the :ref:`User Guide <cross_validation>`.', u'', u':Parameters:', u'', u"    **estimator** : estimator object implementing 'fit' and 'predict'", u'', u'        The object to use to fit the data.', u'        ', u'', u'    **X** : array-like', u'', u'        The data to fit. Can be, for example a list, or an array at least 2d.', u'        ', u'', u'    **y** : array-like, optional, default: None', u'', u'        The target variable to try to predict in the case of', u'        supervised learning.', u'        ', u'', u'    **labels** : array-like, with shape (n_samples,), optional', u'', u'        Group labels for the samples used while splitting the dataset into', u'        train/test set.', u'        ', u'', u'    **cv** : int, cross-validation generator or an iterable, optional', u'', u'        Determines the cross-validation splitting strategy.', u'        Possible inputs for cv are:', u'          - None, to use the default 3-fold cross validation,', u'          - integer, to specify the number of folds in a `(Stratified)KFold`,', u'          - An object to be used as a cross-validation generator.', u'          - An iterable yielding train, test splits.', u'        ', u'        For integer/None inputs, ``StratifiedKFold`` is used for classification', u'        tasks, when ``y`` is binary or multiclass.', u'        ', u'        See the :mod:`sklearn.model_selection` module for the list of', u'        cross-validation strategies that can be used here.', u'        ', u'        Also refer :ref:`cross-validation documentation <_cross_validation>`', u'        ', u'', u'    **n_jobs** : integer, optional', u'', u'        The number of CPUs to use to do the computation. -1 means', u"        'all CPUs'.", u'        ', u'', u'    **verbose** : integer, optional', u'', u'        The verbosity level.', u'        ', u'', u'    **fit_params** : dict, optional', u'', u'        Parameters to pass to the fit method of the estimator.', u'        ', u'', u'    **pre_dispatch** : int, or string, optional', u'', u'        Controls the number of jobs that get dispatched during parallel', u'        execution. Reducing this number can be useful to avoid an', u'        explosion of memory consumption when more jobs get dispatched', u'        than CPUs can process. This parameter can be:', u'        ', u'            - None, in which case all the jobs are immediately', u'              created and spawned. Use this for lightweight and', u'              fast-running jobs, to avoid delays due to on-demand', u'              spawning of the jobs', u'        ', u'            - An int, giving the exact number of total jobs that are', u'              spawned', u'        ', u'            - A string, giving an expression as a function of n_jobs,', u"              as in '2*n_jobs'", u'', u':Returns:', u'', u'    **predictions** : ndarray', u'', u"        This is the result of calling 'predict'"]:42: WARNING: undefined label: _cross_validation (if the link has no caption the label must precede a section header)" etc.

@mrshu
Copy link
Contributor

mrshu commented Dec 14, 2015

@amueller Those errors you pointed out are probably easy to fix but I am not sure how to fix problems with document not being included in any toctree.

Thanks for the clarification, I'll start by fixing those easy issues and updating the test script.

@amueller
Copy link
Member Author

there is some issue about how the datasets are included. there is a part in the index that has a hidden toc for inclusion.

@raghavrv
Copy link
Member

Fix in #6030. "Need Contrib" tag to be removed

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