Skip to content

DOC fix EX02 errors in docstrings #51236

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
MarcoGorelli opened this issue Feb 8, 2023 · 34 comments · Fixed by #51724
Closed

DOC fix EX02 errors in docstrings #51236

MarcoGorelli opened this issue Feb 8, 2023 · 34 comments · Fixed by #51724

Comments

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Feb 8, 2023

pandas has a script for validating docstrings

pandas/ci/code_checks.sh

Lines 560 to 568 in ced9833

MSG='Partially validate docstrings (EX02)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX02 --ignore_functions \
pandas.DataFrame.plot.line \
pandas.Series.plot.line \
pandas.api.types.is_datetime64_any_dtype \
pandas.api.types.is_datetime64_ns_dtype \
pandas.api.types.is_datetime64tz_dtype \
pandas.plotting.parallel_coordinates
RET=$(($RET + $?)) ; echo $MSG "DONE"

which can be run with

./ci/code_checks.sh docstrings

Currently, many functions fail the EX02 check, and so are excluded from the check.

The task here is:

  1. pick 2-3 functions
  2. run ./ci/code_checks.sh docstrings
  3. fixup the docstrings according to whatever error is reported
  4. stage, commit, push, open pull request 🚀

Please don't comment take as multiple people can work on this simultaneously. You also don't need to ask for permission to work on this, feel free to just start 😄 Though if you're working on some set of functions you can comment that

If you're new here, please check the contributing guide https://pandas.pydata.org/docs/dev/development/contributing.html

TIP: ./ci/code_checks.sh docstrings may take a while to run - you may want to comment-out the docstrings check which checks EX01 and the part which checks all the other codes (these are currently lines 86 - 577)

@albuzenet
Copy link
Contributor

Hi, currently working on :

pandas.factorize
pandas.Index.factorize
pandas.Series.factorize

@albuzenet
Copy link
Contributor

For future Windows contributors. If you get a weird flake8 PermissionError when running scripts/validate_docstrings.py you can fix it by manually adding delete=False in the tempfile context manager (validate_docstrings.py, line 210). Note that you will need to manually delete the temporary file after this change. Also, do not push this change ! Related issue: stackoverflow

@MarcoGorelli
Copy link
Member Author

thanks @albuzenet - if that's the case, it suggests that the current validate_docstrings.py code should probably be improved. Do you want to make a PR to rewrite it using namedtemporaryfile?

@albuzenet
Copy link
Contributor

Sure @MarcoGorelli. Should I open a new issue ?

@MarcoGorelli
Copy link
Member Author

sure (or feel free to just submit a PR directly, thanks for having spotted this)

@DeaMariaLeon
Copy link
Member

Working on:
pandas.api.types.is_bool_dtype
pandas.api.types.is_categorical_dtype
pandas.api.types.is_complex_dtype

@Ramyahkay
Copy link

Hello, I am currently working on:
pandas.api.types.is_integer_dtype
pandas.api.types.is_string_dtype

@natmokval
Copy link
Contributor

Hi, I will work on:
pandas.api.types.is_float_dtype
pandas.api.types.is_int64_dtype

@natmokval
Copy link
Contributor

I am working on:
pandas.api.types.is_object_dtype
pandas.api.types.is_numeric_dtype
pandas.api.types.is_datetime64_dtype

@natmokval
Copy link
Contributor

I am working on:
pandas.Period.strftime \
pandas.Series.floordiv \
pandas.Series.rfloordiv \

@clewarne14
Copy link

Hi, I am currently working on:

pandas.api.types.is_interval_dtype
pandas.api.types.is_period_dtype
pandas.api.types.is_signed_integer_dtype

@natmokval
Copy link
Contributor

I am working on:
pandas.core.groupby.DataFrameGroupBy.take \
pandas.Timestamp.fromtimestamp \

@jaideepmurkute
Copy link

Hi, I will take up the following set:

pandas.io.formats.style.Styler.concat
pandas.io.formats.style.Styler.export
pandas.io.formats.style.Styler.set_td_classes 
pandas.io.formats.style.Styler.use

@phershbe
Copy link
Contributor

I am working on:
pandas.plotting.andrews_curves \
pandas.plotting.autocorrelation_plot \
pandas.plotting.lag_plot \

@natmokval
Copy link
Contributor

I am working on:
pandas.Series.sparse.density
pandas.Series.sparse.npoints
pandas.Series.sparse.sp_values

@kindai321
Copy link

Hi, I am working on:
pandas.api.types.is_datetime64_any_dtype
pandas.api.types.is_datetime64_ns_dtype
pandas.api.types.is_datetime64tz_dtype
This is going to be my first open source contribution and I might need some help :)

@jaideepmurkute
Copy link

Hi,
I won't be able to complete the following set that I had taken up earlier due to bandwidth issues:

pandas.io.formats.style.Styler.concat
pandas.io.formats.style.Styler.export  
pandas.io.formats.style.Styler.set_td_classes
pandas.io.formats.style.Styler.use

Others can pick it up. Apologies for blocking the set.

@natmokval
Copy link
Contributor

Hi. I'll take functions
pandas.io.formats.style.Styler.concat
pandas.io.formats.style.Styler.export
pandas.io.formats.style.Styler.set_td_classes
pandas.io.formats.style.Styler.use

@clewarne14
Copy link

Hello,
I won't be able to complete the following set that I had taken up earlier due to issues with my computer:

pandas.api.types.is_interval_dtype
pandas.api.types.is_period_dtype
pandas.api.types.is_signed_integer_dtype

Others can pick it up. Apologies for blocking the set. I will close my incomplete pull request for this issue.

@phershbe
Copy link
Contributor

The pull request above corrects the docstrings for:
pandas.api.types.is_interval_dtype
pandas.api.types.is_period_dtype
pandas.api.types.is_signed_integer_dtype

Sorry for not mentioning that I would take them in advance, they were dropped by somebody else a few hours ago and I did them to gain some confidence since I'm working on a few for plotting that are more difficult and wanted to use these for experience.

@natmokval
Copy link
Contributor

I am working on:
pandas.api.types.infer_dtype
pandas.api.types.is_sparse
pandas.api.types.is_unsigned_integer_dtype

@lia2710
Copy link
Contributor

lia2710 commented Feb 23, 2023

Hi, I am working on:
pandas.plotting.radviz
pandas.tseries.frequencies.to_offset

@liang3zy22
Copy link
Contributor

liang3zy22 commented Feb 24, 2023

Hi, I am already working on:

 pandas.api.types.is_integer_dtype
 pandas.api.types.is_string_dtype

PR is as above.
UPDATE: Just saw @Ramyahkay already took them. Should I delete my PR and wait for @Ramyahkay 's?

@MarcoGorelli
Copy link
Member Author

Hi, I am already working on:

 pandas.api.types.is_integer_dtype
 pandas.api.types.is_string_dtype

PR is as above. UPDATE: Just saw @Ramyahkay already took them. Should I delete my PR and wait for @Ramyahkay 's?

Thanks - what you've done is fine, if someone leaves a comment and then doesn't submit anything for 1-2 weeks it's perfectly fine to take over

@zgdjcls
Copy link

zgdjcls commented Feb 24, 2023

Hi I'm going to work on:
pandas.plotting.parallel_coordinates
and
pandas.DataFrame.plot.line

@Ramyahkay
Copy link

Ramyahkay commented Feb 28, 2023

Hello everyone, I am going to work on the following:
pandas.Series.sparse.density
pandas.Series.sparse.npoints
pandas.Series.sparse.sp_values
This is my first time contributing to open source and I'm looking forward to learning and contributing to the community. I'll do my best to keep the issue up-to-date with my progress and communicate any questions I have.

@MarcoGorelli
Copy link
Member Author

those are already done

there's only 6 left, we're close to closing this one off

@zgdjcls
Copy link

zgdjcls commented Feb 28, 2023

Sorry, due to some reason, I won't be able to fix
pandas.plotting.parallel_coordinates
pandas.DataFrame.plot.line
anymore, so if anyone else wants to do this you can work on it.

@phershbe
Copy link
Contributor

I'll take the methods mentioned directly above:
pandas.plotting.parallel_coordinates
pandas.DataFrame.plot.line

@MarcoGorelli
Copy link
Member Author

cool, thanks

or feel free to take all the remaining ones, remove the partial EX02 check, and add EX02 to

pandas/ci/code_checks.sh

Lines 82 to 83 in ced9833

MSG='Validate docstrings (EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06

@phershbe
Copy link
Contributor

phershbe commented Mar 1, 2023

Great, I'm working on them now!

@MarcoGorelli
Copy link
Member Author

We did, thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.