xref #213
Updated the pandas validation script to be generic. To validate all docstrings of a project will probably require some work, to consider how the rst
lists all public objects.
Removed from the original script, the next pandas-only features:
- Setting
max_open_warning
setting from matplotlib
- PEP-8 validation of examples (will add in a follow up, but will require a dependency, and also pandas auto-imports modules, and requires updating many docstrings in the tests
- Check to see if numpy or pandas where imported in the examples
- Check to see if docstrings mentioned private classes (in pandas NDFrame)
- GitHub link in the json report
- Changed
pprint_thing
by str
when rendering the wrong parameter error message
- Source file in report is not relative to pandas path
- Methods validated by introspecting
Series
and DataFrame
(besides the ones obtained from the API rst
Tried with a scikit-learn class and it runs the validation correctly:
################################################################################
############## Docstring (sklearn.linear_model.LinearRegression) ##############
################################################################################
Ordinary least squares Linear Regression.
Parameters
----------
fit_intercept : boolean, optional, default True
whether to calculate the intercept for this model. If set
to False, no intercept will be used in calculations
(e.g. data is expected to be already centered).
normalize : boolean, optional, default False
This parameter is ignored when ``fit_intercept`` is set to False.
If True, the regressors X will be normalized before regression by
subtracting the mean and dividing by the l2-norm.
If you wish to standardize, please use
:class:`sklearn.preprocessing.StandardScaler` before calling ``fit`` on
an estimator with ``normalize=False``.
copy_X : boolean, optional, default True
If True, X will be copied; else, it may be overwritten.
n_jobs : int, optional, default 1
The number of jobs to use for the computation.
If -1 all CPUs are used. This will only provide speedup for
n_targets > 1 and sufficient large problems.
Attributes
----------
coef_ : array, shape (n_features, ) or (n_targets, n_features)
Estimated coefficients for the linear regression problem.
If multiple targets are passed during the fit (y 2D), this
is a 2D array of shape (n_targets, n_features), while if only
one target is passed, this is a 1D array of length n_features.
intercept_ : array
Independent term in the linear model.
Notes
-----
From the implementation point of view, this is just plain Ordinary
Least Squares (scipy.linalg.lstsq) wrapped as a predictor object.
################################################################################
################################## Validation ##################################
################################################################################
6 Errors found:
Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
Parameter "fit_intercept" type should use "bool" instead of "boolean"
Parameter "fit_intercept" description should start with a capital letter
Parameter "normalize" type should use "bool" instead of "boolean"
Parameter "copy_X" type should use "bool" instead of "boolean"
3 Warnings found:
No extended summary found
See Also section not found
No examples section found
enhancement