Skip to content

DOC: ex03 - no fix required #56861

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

Merged
merged 1 commit into from
Jan 13, 2024
Merged

DOC: ex03 - no fix required #56861

merged 1 commit into from
Jan 13, 2024

Conversation

asishm
Copy link
Contributor

@asishm asishm commented Jan 13, 2024

Used this script to validate:

import subprocess as sp

def validate_func(func_name):
    proc = sp.Popen(['./scripts/validate_docstrings.py', '--errors=EX03', func_name], stdout=sp.PIPE, stderr=sp.PIPE)
    proc.wait()
    out = proc.stderr.read().decode().strip()
    return out.endswith(f'Docstring for "{func_name}" correct. :)')

funcs = ['pandas.DataFrame.var',
 'pandas.DatetimeIndex.day_name',
 'pandas.core.groupby.DataFrameGroupBy.apply',
 'pandas.DatetimeIndex.month_name',
 'pandas.core.groupby.DataFrameGroupBy.hist',
 'pandas.core.groupby.SeriesGroupBy.apply',
 'pandas.core.groupby.SeriesGroupBy.transform',
 'pandas.DataFrame.hist',
 'pandas.DataFrame.tz_localize',
 'pandas.CategoricalIndex.set_categories',
 'pandas.core.groupby.DataFrameGroupBy.boxplot',
 'pandas.core.groupby.SeriesGroupBy.pipe',
 'pandas.DataFrame.plot.bar',
 'pandas.DataFrame.tz_convert',
 'pandas.core.groupby.DataFrameGroupBy.pipe',
 'pandas.DataFrame.skew',
 'pandas.core.window.rolling.Rolling.corr']

for func in funcs:
    print(func, validate_func(func))

Let me know if it's too many at once.

@asishm asishm requested a review from mroeschke as a code owner January 13, 2024 15:39
@mroeschke mroeschke added the Docs label Jan 13, 2024
@mroeschke mroeschke added this to the 3.0 milestone Jan 13, 2024
@mroeschke mroeschke merged commit 43d5dfc into pandas-dev:main Jan 13, 2024
@mroeschke
Copy link
Member

Thanks @asishm

pandas.DataFrame.plot.hexbin \
pandas.DataFrame.plot.line \
pandas.DataFrame.hist \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait! For the function 'pandas.DataFrame.hist', my output for this function is

################################################################################
################################## Validation ##################################
################################################################################

1 Errors found for `pandas.DataFrame.hist`:
        Return value has no description

I have created a PR to fix this: #56864

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM, just find out scripts/validate_docstrings.py --format=actions --errors=EX03 method-name will output all errors not only the EX03 error if only provide one method name.

def main(func_name, prefix, errors, output_format, ignore_deprecated, ignore_functions):
"""
Main entry point. Call the validation for one or for all docstrings.
"""
if func_name is None:
return print_validate_all_results(
prefix,
errors,
output_format,
ignore_deprecated,
ignore_functions,
)
else:
print_validate_one_results(func_name)

Also mentioned here #56804 (comment)

@asishm asishm deleted the ex03_fix branch February 7, 2024 14:52
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants