-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Use a standard header for all rst files #23952
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
Comments
If the contents are the same throughout each file, they can be supplied via |
I am claiming this. |
I understand what is required to complete this. But, how should I do the PR? This will require changing about 50 .rst files under 'whatsnew' and another 50 files in doc/source. Given that there are so many files involved, touching all of them would lead to conflicts. I am outlining proposed steps below -
Let me know your thoughts. I think steps 1&2 can be clubbed into one PR. |
Feel free to do it in more than one PR, that's all right. But I wouldn't worry much about conflicts, they are not so likely to happen, as the changes to the files will be very small. And if in some case someone is cleaning that rst file and reorder the imports (that's the main thing that could generate a conflict), it should be quite easy to fix. Besides that, I'll try to merge it asap. Just to be clear, if I'm not missing anything, the PR should mainly replace in all rst files:
by
But as said, feel free to open more than one PR if that makes sense to you. |
@saurav2608 we just merged few changes in rst pages, if you can update the copy of pandas you're working with, I think that will prevent any possible conflict with the changes already done (and I don't think there will be more before merging your PR). |
This change introduces additional bunch of erros on |
I think you need to update the version of |
Add |
We have it in the header, and the header is used in all the files, I don't think that should be necessary, right? Doesn't |
Oh, sorry, just realized that @FHaase can the bootstrap argument be added to @saurav2608 for the other imports failing, there are not many, and I think if you import |
I think the bootstrap argument is to be added to ./ci/code_checks.sh as If I add bootstrap to the file, then I am left with about 25 linting error most of them from cookbook.rst. And almost all of them can be taken care by importing the following packages - 'itertools', 'glob', 'os', and 'StringIO'. We will also get a couple of errors from contributing.rst & comparison_with_sas.rst of the type 'F811 redefinition of unused 'np'' I can add a |
However I think I correct my comment from above. As we basically assume numpy and pandas are imported in both, the documentation and the docstrings i think it's better to add it in the setup.cfg.
Haven't they been added previously in the first
Roles aren't supported currently, just use a |
When we build the documentation from the
.rst
files indoc/source/
, we use a variablecommon_imports
that is added as context for sphinx, and that is used in thewhatsnew
files.But more or less the same imports and options that are used in the
whatsnew
files, are used in most.rst
files.What would be useful is:
common_imports
toheader
, as this will be used for other things in the future (like definingtocdepth
).rst
files in the same way as it's done for thewhatsnew
filescommon_imports
(because it's used in many files), add itThis can have implications on the
flake8-rst
validation, as I assume the content is validated before rendering, and the imports will be missing during the validation.CC: @TomAugspurger @FHaase
The text was updated successfully, but these errors were encountered: