Skip to content
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

DOC: Enforce Numpy Docstring Validation | pandas.Index #58068

Closed
jordan-d-murphy opened this issue Mar 29, 2024 · 28 comments · Fixed by #58682
Closed

DOC: Enforce Numpy Docstring Validation | pandas.Index #58068

jordan-d-murphy opened this issue Mar 29, 2024 · 28 comments · Fixed by #58682

Comments

@jordan-d-murphy
Copy link
Contributor

jordan-d-murphy commented Mar 29, 2024

DOC: Enforce Numpy Docstring Validation (Parent Issue) #58063

Pandas has a script for validating docstrings in code_checks.sh. Currently, some methods fail some of these checks.

pandas.Index

pandas/ci/code_checks.sh

Lines 182 to 230 in c468028

-i "pandas.Index PR07" \
-i "pandas.Index.T SA01" \
-i "pandas.Index.append PR07,RT03,SA01" \
-i "pandas.Index.astype SA01" \
-i "pandas.Index.copy PR07,SA01" \
-i "pandas.Index.difference PR07,RT03,SA01" \
-i "pandas.Index.drop PR07,SA01" \
-i "pandas.Index.drop_duplicates RT03" \
-i "pandas.Index.droplevel RT03,SA01" \
-i "pandas.Index.dropna RT03,SA01" \
-i "pandas.Index.dtype SA01" \
-i "pandas.Index.duplicated RT03" \
-i "pandas.Index.empty GL08" \
-i "pandas.Index.equals SA01" \
-i "pandas.Index.fillna RT03" \
-i "pandas.Index.get_indexer PR07,SA01" \
-i "pandas.Index.get_indexer_for PR01,SA01" \
-i "pandas.Index.get_indexer_non_unique PR07,SA01" \
-i "pandas.Index.get_loc PR07,RT03,SA01" \
-i "pandas.Index.get_slice_bound PR07" \
-i "pandas.Index.hasnans SA01" \
-i "pandas.Index.identical PR01,SA01" \
-i "pandas.Index.inferred_type SA01" \
-i "pandas.Index.insert PR07,RT03,SA01" \
-i "pandas.Index.intersection PR07,RT03,SA01" \
-i "pandas.Index.item SA01" \
-i "pandas.Index.join PR07,RT03,SA01" \
-i "pandas.Index.map SA01" \
-i "pandas.Index.memory_usage RT03" \
-i "pandas.Index.name SA01" \
-i "pandas.Index.names GL08" \
-i "pandas.Index.nbytes SA01" \
-i "pandas.Index.ndim SA01" \
-i "pandas.Index.nunique RT03" \
-i "pandas.Index.putmask PR01,RT03" \
-i "pandas.Index.ravel PR01,RT03" \
-i "pandas.Index.reindex PR07" \
-i "pandas.Index.shape SA01" \
-i "pandas.Index.size SA01" \
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
-i "pandas.Index.slice_locs RT03" \
-i "pandas.Index.str PR01,SA01" \
-i "pandas.Index.symmetric_difference PR07,RT03,SA01" \
-i "pandas.Index.take PR01,PR07" \
-i "pandas.Index.to_list RT03" \
-i "pandas.Index.union PR07,RT03,SA01" \
-i "pandas.Index.unique RT03" \
-i "pandas.Index.value_counts RT03" \
-i "pandas.Index.view GL08" \

The task is:

  1. take 1-5 methods

  2. run: scripts/validate_docstrings.py --format=actions <method-name>

example command: scripts/validate_docstrings.py --format=actions pandas.Categorical.__array__
example output:

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

2 Errors found for `pandas.Categorical.__array__`:
	ES01	No extended summary found
	SA01	See Also section not found
  1. check if validation docstrings passes for those methods, and if it’s necessary fix the docstrings according to whatever error is reported. Note: We've chosen to ignore ES01 errors, these are not required to be fixed.

  2. remove those methods from code_checks.sh if all errors are cleared and the docstring is correct, otherwise, remove the specific error that was fixed from the list of errors for that method.

  3. commit, push, open pull request

Please don't comment take as multiple people can work on this issue. You also don't need to ask for permission to work on this, just comment on which methods are you going to work : )

If you're new contributor, please check the contributing guide

thanks @datapythonista for the inspiration for this issue!

@Aloqeely
Copy link
Member

For some reason, when I run the command on pandas.Index.str I get the following error:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 3662: character maps to <undefined>

@sunwooma
Copy link

sunwooma commented Apr 3, 2024

Can I be assigned to this?

@Aloqeely
Copy link
Member

Aloqeely commented Apr 3, 2024

Can I be assigned to this?

Of course! As Mr. Murphy said, you don't need to ask for permission, just comment which methods you will be working on

@KeiOshima
Copy link
Contributor

Will work on

pandas.Index.size
pandas.Index.shape
pandas.Index.ndim

@KeiOshima
Copy link
Contributor

KeiOshima commented Apr 20, 2024

will work on

pandas.Index.name
pandas.Index.dtype 
pandas.Index.equals

@shriyakalakata
Copy link
Contributor

Working on pandas.Index.map, pandas.Index.hasnans, pandas.Index.nbytes,

@Nrezhang
Copy link
Contributor

Nrezhang commented Apr 21, 2024

working on pandas.Index.astype

@sunwooma
Copy link

working on pandas.DataFrame.to_parquet, pandas.DatetimeIndex.hour

@KeiOshima
Copy link
Contributor

working on

pandas.Index.empty 
pandas.Index.T

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented Apr 24, 2024

working on

-i "pandas.Index.to_list  RT03" \
-i "pandas.Index.unique RT03" \ 
-i "pandas.Index.item SA01" \ 

@tuhinsharma121
Copy link
Contributor

working on

-i "pandas.Index.fillna RT03" \ 

@KeiOshima
Copy link
Contributor

KeiOshima commented Apr 25, 2024

working on

 -i "pandas.Index.duplicated RT03" \ 
 -i "pandas.Index.nunique RT03" \ 

@KeiOshima
Copy link
Contributor

working on

pandas.Index.memory_usage RT03
pandas.Index.drop_duplicates RT03

@shriyakalakata
Copy link
Contributor

Working on

-i "pandas.Index.droplevel RT03,SA01" \
-i "pandas.Index.dropna RT03,SA01" \
-i "pandas.Index.fillna RT03" \

@shriyakalakata
Copy link
Contributor

Working on

-i "pandas.Index.inferred_type SA01" \
-i "pandas.Index.item SA01" \
-i "pandas.Index.slice_locs RT03" \

@shriyakalakata
Copy link
Contributor

Working on

 -i "pandas.Index.insert PR07,RT03,SA01" \ 
 -i "pandas.Index.intersection PR07,RT03,SA01" \ 

@KeiOshima
Copy link
Contributor

working on

 -i "pandas.Index.get_indexer_non_unique PR07,SA01" \ 
-i "pandas.Index.get_indexer PR07,SA01" \

@shriyakalakata
Copy link
Contributor

Working on

 -i "pandas.Index.symmetric_difference PR07,RT03,SA01" \ 
 -i "pandas.Index.union PR07,RT03,SA01" \

@shriyakalakata
Copy link
Contributor

shriyakalakata commented Apr 29, 2024

Working on

 -i "pandas.Index.join PR07,RT03,SA01" \ 

@aBiR1D
Copy link

aBiR1D commented Apr 29, 2024

Working on

-i "pandas.Index PR07" \

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented Apr 30, 2024

@mroeschke @jordan-d-murphy This issue is not closed yet. We need to keep it open. Following items are still remaining

        -i "pandas.Index PR07" \
        -i "pandas.Index.append PR07,RT03,SA01" \
        -i "pandas.Index.difference PR07,RT03,SA01" \
        -i "pandas.Index.get_indexer PR07,SA01" \
        -i "pandas.Index.get_indexer_for PR01,SA01" \
        -i "pandas.Index.get_indexer_non_unique PR07,SA01" \
        -i "pandas.Index.get_loc PR07,RT03,SA01" \
        -i "pandas.Index.join PR07,RT03,SA01" \
        -i "pandas.Index.names GL08" \
        -i "pandas.Index.putmask PR01,RT03" \
        -i "pandas.Index.ravel PR01,RT03" \
        -i "pandas.Index.slice_indexer PR07,RT03,SA01" \
        -i "pandas.Index.str PR01,SA01" \
        -i "pandas.Index.take PR01,PR07" \
        -i "pandas.Index.view GL08" \

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented Apr 30, 2024

I am working on the following

-i "pandas.Index.view GL08" \
-i "pandas.Index.take PR01,PR07" \
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented Apr 30, 2024

I am working on the following

        -i "pandas.Index.get_indexer PR07,SA01" \
        -i "pandas.Index.get_indexer_for PR01,SA01" \
        -i "pandas.Index.get_indexer_non_unique PR07,SA01" \
        -i "pandas.Index.get_loc PR07,RT03,SA01" \
        -i "pandas.Index.putmask PR01,RT03" \

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented May 2, 2024

workin on

        -i "pandas.Index.join PR07,RT03,SA01" \
        -i "pandas.Index.ravel PR01,RT03" \
        -i "pandas.Index.str PR01,SA01" \
        -i "pandas.Index.names GL08" \

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

Successfully merging a pull request may close this issue.

9 participants