This saves about
31.5 hours per year
vs conventional diff tools
jameslamb
authored of work between July 26 and September 8
Diff Delta:
631
About 38 Diff Delta/hour
Classified as:
Bug Fix, Feature Add, General
jameslamb's Description of Work
Fixes #7362
Contributes to #7327
The Python package has 7 scikit-learn compatible estimators, and there is a lot of overlap in their docstrings. To keep them consistent, the estimators reference build up their docstrings at import time from templates and inherited docstrings, like this:
This proposes removing that stuff in favor of just using literal docstrings.
Changes in this PR
- removes all the import-time docstring-templating stuff, in favor of literal docstrings
- adds unit tests to ensure the docstrings remain consistent with each other
- adds tests in CI that
import lightgbmworks when run underPYTHONOPTIMIZE=1andPYTHONOPTIMIZE=2
Benefits of this change
- allows
lightgbmto be imported when usingPYTHONOPTIMIZE=2(fixes #7362) - very slightly reduces import time (in my local testing, by around 10ms)
- makes it easier to reason about the docs and edit them
How I tested this
- all those unit tests I added
- import-timing code from #7327
- built the docs on readtehdocs
- build: https://app.readthedocs.org/projects/lightgbm/builds/?version__slug=python-no-runtime-doc-parsing
- docs: https://lightgbm.readthedocs.io/en/python-no-runtime-doc-parsing
- build: https://app.readthedocs.org/projects/lightgbm/builds/?version__slug=python-no-runtime-doc-parsing
8 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
End of PR:
Like the credits, but with fewer stunts.