Skip to content

DOC: Validate that the docstrings do not import pandas or numpy #23134

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
datapythonista opened this issue Oct 13, 2018 · 5 comments
Closed

DOC: Validate that the docstrings do not import pandas or numpy #23134

datapythonista opened this issue Oct 13, 2018 · 5 comments
Labels
CI Continuous Integration Docs good first issue
Milestone

Comments

@datapythonista
Copy link
Member

datapythonista commented Oct 13, 2018

scripts/validate_docstrings.py validates that the content of a docstring follows our standards. There are still some of those standards that the script does not validate, and this gives the users the wrong impression that the docstring is all right, when it's not really the case. All the missing validations are listed in #20298.

One of those standards is that we do not show the import numpy as np or import pandas as pd in the examples section, but we assume it's there. We should automatically validate that these imports do not exist in the examples.

For this issue is required:

  • Change scripts/validate_docstings.py to give an error if the imports are found
  • Add tests in scripts/tests/test_validate_docstrings.py
  • Run the script for all docstrings (i.e. ./scripts/validate_docstings.py) and check in the resulting report how many of the docstrings in pandas have these imports. If any, remove them in the same PR.
@thoo
Copy link
Contributor

thoo commented Oct 13, 2018

@datapythonista I am a first time contributor. Can I work on this issue? Thanks.

@datapythonista
Copy link
Member Author

Please do it @thoo, that's why I created the issue and labeled as "good first issue" :)

@thoo
Copy link
Contributor

thoo commented Oct 13, 2018

@datapythonista Thanks!!!

@thoo
Copy link
Contributor

thoo commented Oct 15, 2018

@datapythonista I don't find any import with numpy or pandas.

@datapythonista
Copy link
Member Author

that makes sense, besides the unit tests you can add an import locally and see if your changes capture it

@jreback jreback added this to the 0.24.0 milestone Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Docs good first issue
Projects
None yet
Development

No branches or pull requests

3 participants