Separate documentation for contributing and developing estimators in to different files #14582#14611
Conversation
NicolasHug
left a comment
There was a problem hiding this comment.
Thanks for taking care of this @arpanchowdhry .
Just a few comments for now. You will also need to add the reference to doc/developers/index.rst for the new file to be rendered.
| .. _api_overview: | ||
|
|
||
| APIs of scikit-learn objects | ||
| ============================ |
There was a problem hiding this comment.
Maybe this should come first?
| @@ -0,0 +1,761 @@ | |||
| .. _developing_estimators: | |||
There was a problem hiding this comment.
This section is intended to be about development in general, not just developing estimator. Maybe change the ref/file/section to e.g. "Developing scikit-learn" ? (not great either, others will have better ideas)
|
@NicolasHug Hi, I made the required changes, but I am seeing all sorts for failures due the reference addition in index.rst. Any thoughts? |
|
I think the CI is going berserk lately, your docs build correctly on my machine. |
jnothman
left a comment
There was a problem hiding this comment.
Thanks for this. It does need a little more work.
doc/developers/developing_scikit.rst
Outdated
| @@ -0,0 +1,761 @@ | |||
| .. _developing_scikit: | |||
|
|
|||
| ============ | |||
There was a problem hiding this comment.
Please extend these lines to match the length of the text
doc/developers/developing_scikit.rst
Outdated
| .. _developing_scikit: | ||
|
|
||
| ============ | ||
| Developing scikit-learn |
There was a problem hiding this comment.
| Developing scikit-learn | |
| Developing scikit-learn estimators |
doc/developers/developing_scikit.rst
Outdated
| 3. Loop. | ||
|
|
||
|
|
||
| Issue Tracker Tags |
There was a problem hiding this comment.
I'm pretty sure this belongs in the contributer guide, not here: it is about the specific development processes for the scikit-learn project
doc/developers/developing_scikit.rst
Outdated
| Coding guidelines | ||
| ================= | ||
|
|
||
| The following are some guidelines on how new code should be written. Of |
There was a problem hiding this comment.
Thesl issue suggests that the top matter from this section goes into the contributing guide, not here. Or maybe we can just say that the following are some standards used within scikit-learn, which may be appropriate to adopt in external projects for the sake of consistency
There was a problem hiding this comment.
@jnothman Thanks for the feedback. I have made all the requested changes. But I am still not sure about how to properly handle the 'Coding guidelines' section in the new file. I just changed the first line to reflect what you had commented above. But if further modifications are needed please let me know.
doc/developers/developing_scikit.rst
Outdated
| Coding guidelines | ||
| ================= | ||
|
|
||
| The following are some standards used within scikit-learn, which may |
There was a problem hiding this comment.
Despite being my words, I'm not happy with this result. Let's use the existing "The following are some guidelines on how new code should be written for inclusion in scikit-learn, and which may be appropriate to adopt in external projects."
doc/developers/developing_scikit.rst
Outdated
|
|
||
| .. _coding-guidelines: | ||
|
|
||
| Coding guidelines |
There was a problem hiding this comment.
I think this belongs below "Rolling your own estimator"
doc/developers/developing_scikit.rst
Outdated
| find bugs in scikit-learn. | ||
|
|
||
| * Use the `numpy docstring standard | ||
| <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_ |
There was a problem hiding this comment.
This should be updated: https://numpy.readthedocs.io/en/latest/format.html
doc/developers/developing_scikit.rst
Outdated
|
|
||
| .. _testing_coverage: | ||
|
|
||
| Testing and improving test coverage |
There was a problem hiding this comment.
I'm now thinking this belongs back in the contributing guide. It's more specific to scikit-learn core than I had realised. (It would be nice to eventually include some general comments here on how to test estimators.)
doc/developers/developing_scikit.rst
Outdated
|
|
||
| * **Please don't use** ``import *`` **in any case**. It is considered harmful | ||
| by the `official Python recommendations | ||
| <https://docs.python.org/2/howto/doanddont.html#from-module-import>`_. |
There was a problem hiding this comment.
This URL should be updated: https://docs.python.org/3.1/howto/doanddont.html#at-module-level
There was a problem hiding this comment.
@jnothman Thanks for the feedback. I made all the changes you recommended above.
|
@jnothman Let me know if you have any other feedback. |
jnothman
left a comment
There was a problem hiding this comment.
The Coding Guidelines section is still somewhat duplicated between the two sections. The sections on "Deprecation" and "Change the default value of a parameter" could be under a new heading called "Maintaining backwards compatibility" instead of the Coding Guidelines. I don't think "
Python versions supported" needs to be in this file.
doc/developers/developing_scikit.rst
Outdated
| @@ -0,0 +1,671 @@ | |||
| .. _developing_scikit: | |||
There was a problem hiding this comment.
We're going to need to give this a better filename. I'm not sure yet what's right. coding? implementation? api?
There was a problem hiding this comment.
Personally I like 'developing' more than 'coding', but I will rely on your judgement.
There was a problem hiding this comment.
"Developing" wrt an OSS project often includes project & issue management, personnel, etc. So it covers "contributing" as well as this. Rather this section is a guide to engineering, etc.
There was a problem hiding this comment.
Grasping at straws now, but maybe use 'enhancement' or 'enhancing_scikit'. That word is used heavily at my day job :)
There was a problem hiding this comment.
This is not about enhancing. This is about how to implement/develop/code/build your own estimators. The filename should be a single word, not two. I'm okay with you choosing one of those words. Thanks
| ================================== | ||
| Developing scikit-learn estimators | ||
| ================================== | ||
|
|
There was a problem hiding this comment.
Insert .. currentmodule:: sklearn
There was a problem hiding this comment.
@jnotham I am not sure why but I am getting build failures with '.. currentmodule:: sklearn'. But once I removed it all the failures are gone.
@jnothman I can take out 'Coding Guidelines' from one of the files in you would like, but seems useful in both places though. |
|
I think we should make it clear that people reading the Contributing guide
should also read the other section.
|
|
Those build failures were not due to any of your changes, but due to failures elsewhere that we subsequently fixed. |
jnothman
left a comment
There was a problem hiding this comment.
I'm happy to approve this apart from that filename.
doc/developers/developing_scikit.rst
Outdated
| @@ -0,0 +1,671 @@ | |||
| .. _developing_scikit: | |||
There was a problem hiding this comment.
This is not about enhancing. This is about how to implement/develop/code/build your own estimators. The filename should be a single word, not two. I'm okay with you choosing one of those words. Thanks
|
@jnothman Thanks for the feedback. I changed the filename to develop. |
jnothman
left a comment
There was a problem hiding this comment.
Seems a big improvement to me.
|
Could we get another pair of eyes on this and merge? |
thomasjpfan
left a comment
There was a problem hiding this comment.
This is great @arpanchowdhry !
|
Thanks for the work @arpanchowdhry! @jnothman @thomasjpfan sorry I wasn't able to review earlier. I feel that the |
|
Both sections are kind of awkward for
Plotting API most likely needs its own section, considering with PDPs we have space stealing. |
|
I thought it was about this specific library, for now??? No strong opinion.
|
|
I thought too, especially considering we have coding style recommendation |
|
After describing what is an estimator, it goes into “rolling your own estimator”. Then estimator tags. These topics are very generic about “how to create an estimator” Finally, at the end it goes into sklearn specific “coding guidelines”. |
|
It is also well targeted for this specific library as well. ;) |
Addresses #14582
I used the following as a guideline to separate sections. Also this is just an initial version to get feedback. The new file with developing estimators is pretty bare bones and might need more verbiage.
Ways to contribute - Contributing
Submitting a bug report or a feature request - Contributing
How to make a good bug report
Contributing code - Contributing
How to contribute
Pull request checklist
Continuous Integration (CI)
Stalled pull requests
Issues for New Contributors
Documentation - Contributing
Building the documentation
Guidelines for writing documentation
Generated documentation on CircleCI
Testing and improving test coverage - Developing
Writing matplotlib related tests
Workflow to improve test coverage
Issue Tracker Tags - Contributing - I don't think this belongs here in any case
Coding guidelines - Contributing for top matter
Input validation - Developing?
Random Numbers - Developing
Deprecation - Contributing
Change the default value of a parameter - Contributing
Python versions supported - Contributing
Code Review Guidelines - Contributing
APIs of scikit-learn objects - Developing
Different objects
Estimators
Instantiation
Fitting
Estimated Attributes
Optional Arguments
Pairwise Attributes
Rolling your own estimator - Developing
get_params and set_params
Parameters and init
Cloning
Pipeline compatibility
Estimator types
Specific models
Estimator Tags
Reading the existing code base - Contributing