Skip to content

DOC: Validating that the word pandas is correctly capitalized #32613

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
wants to merge 29 commits into from

Conversation

joybh98
Copy link
Contributor

@joybh98 joybh98 commented Mar 11, 2020

As suggested by @datapythonista , I've added checks in ci/code_checks.sh to look if the pandas is being referenced in a standardized way i.e pandas, not *pandas* or Pandas

@datapythonista I've only added checks to see if pandas is being referenced correctly, but not showing where it's changed or how many references are wrong.
Should I add checks for that also ? What do you think ?

@datapythonista
Copy link
Member

Can you have a look at the diff? I think something went wrong, there are lots of unrelated changes.

@datapythonista datapythonista changed the title [TST] Added checks for standardized pandas DOC: Validating that the word pandas is correctly capitalized Mar 11, 2020
@datapythonista datapythonista added CI Continuous Integration Docs labels Mar 11, 2020
@joybh98
Copy link
Contributor Author

joybh98 commented Mar 11, 2020

@datapythonista you're right, let me check what went wrong.

@ShaharNaveh
Copy link
Member

@joybhallaa Can you run the following and push?

git checkout add-check-standard-pandas
git fetch upstream
git merge upstream/master
git reset --soft upstream/master
git commit -m "Fixed wrong diff"

Taken all of the commands above from https://datapythonista.me/blog/useful-git-commands.html

@joybh98
Copy link
Contributor Author

joybh98 commented Mar 12, 2020

@MomIsBestFriend okay, I'll do that !

@joybh98
Copy link
Contributor Author

joybh98 commented Mar 12, 2020

git checkout add-check-standard-pandas
git fetch upstream
git merge upstream/master
git reset --soft upstream/master
git commit -m "Fixed wrong diff"

@MomIsBestFriend I executed all these commands, and when pushing using git push origin add-check-standard-pandas, I got the error hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Let me check what's causing the problem and I'll push ASAP

@ShaharNaveh
Copy link
Member

@joybhallaa Have you followed the steps in the Contributing guide?

@datapythonista
Copy link
Member

@joybhallaa first try git diff upstream/master and see if now you've got the changes you're proposing in this PR. If that's the case, you need a git push --force, since you're rewriting the history here (replacing all these unwanted commits by the new single commit you just did).

@joybh98 joybh98 force-pushed the add-check-standard-pandas branch from 6be9787 to 591cdc6 Compare March 17, 2020 19:24
@joybh98
Copy link
Contributor Author

joybh98 commented Mar 17, 2020

@joybhallaa first try git diff upstream/master and see if now you've got the changes you're proposing in this PR. If that's the case, you need a git push --force, since you're rewriting the history here (replacing all these unwanted commits by the new single commit you just did).

@datapythonista done

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

You are adding this code in the linting section (flake8...). We have a section named patterns where we are checking for many patterns in the same way as you need to check for this one.

@@ -80,6 +80,13 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
flake8-rst doc/source --filename=*.rst --format="$FLAKE8_FORMAT"
RET=$(($RET + $?)) ; echo $MSG "DONE"

# Check if pandas is referenced as pandas, not *pandas* or Pandas
MSG='Checking if pandas reference is standardized or not' ; echo $MSG
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
MSG='Checking if pandas reference is standardized or not' ; echo $MSG
MSG='Checking if the pandas word is always used lowercase (has to be pandas, not Pandas or PANDAS...)' ; echo $MSG

# Check if pandas is referenced as pandas, not *pandas* or Pandas
MSG='Checking if pandas reference is standardized or not' ; echo $MSG
grep -nr '*pandas*|Pandas' doc/*
grep -nr '*pandas*|Pandas' web/*
Copy link
Member

Choose a reason for hiding this comment

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

I guess the next code works. You can't have two statements, since you are checking the exit code later, and you're only checking the code of the last statement.

Suggested change
grep -nr '*pandas*|Pandas' web/*
grep -nr '*pandas*|Pandas' web/* doc/*

Also, please use invgrep as in the rest of this script, you're doing here the opposite of what you want to do. And we have lots of validations where we already do this for other patterns, don't need to reinvent the wheel, just so the same, so we also keep consistent.

grep -nr '*pandas*|Pandas' web/*
RET=$(($RET + $?)) ; echo $MSG "DONE"


Copy link
Member

Choose a reason for hiding this comment

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

Don't leave extra blank lines, keep the same style and formatting as the rest of the script.

@datapythonista
Copy link
Member

@joybhallaa do you have time to have a look at the previous comments?

@joybh98
Copy link
Contributor Author

joybh98 commented Mar 23, 2020

@datapythonista yep was busy with college stuff. Will start work ASAP

@@ -229,6 +229,11 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
invgrep -RI --exclude=\*.{svg,c,cpp,html,js} --exclude-dir=env "\s$" *
RET=$(($RET + $?)) ; echo $MSG "DONE"
unset INVGREP_APPEND

# Check if pandas is referenced as pandas, not *pandas* or Pandas
MSG='Checking if the pandas word reference is always used lowercase (pandas,not Pandas or PANDAS' ; echo $MSG
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@datapythonista I forgot to add ) on line 234, please let me know if everything else besides this right or not.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

CI is green, and I don't think we fixed all the cases of Pandas and *pandas* in the docs and web, did we? If we didn't, this is not working.

We use invgrep -R everywhere else, I think we should use the same, may be that's the problem.

Also, can you add PANDAS please?


# Check if pandas is referenced as pandas, not *pandas* or Pandas
MSG='Checking if the pandas word reference is always used lowercase (pandas,not Pandas or PANDAS' ; echo $MSG
invgrep -nr '*pandas*|Pandas' web/* doc/*
Copy link
Member

Choose a reason for hiding this comment

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

I think the problem is with the astriks in the end, does the CI fail if we remove those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MomIsBestFriend CI passes even after removing the asterisk

@joybh98
Copy link
Contributor Author

joybh98 commented Mar 31, 2020

CI is green, and I don't think we fixed all the cases of Pandas and *pandas* in the docs and web, did we? If we didn't, this is not working.

We use invgrep -R everywhere else, I think we should use the same, may be that's the problem.

Also, can you add PANDAS please?

Sure

@datapythonista
Copy link
Member

Something is wrong here, @joybhallaa can you have a look at the diff, and leave things so this is ready for review please?

jbrockmendel and others added 6 commits March 31, 2020 09:39
* CLN: cimporting time instead of going to python space

pandas/_libs/tslibs/conversion.pyx

* cimporting time instead of going to python space

pandas/_libs/tslibs/timestamps.pyx

* cimporting time instead of going to python space

pandas/_libs/tslibs/period.pyx

Co-authored-by: MomIsBestFriend <>
@joybh98
Copy link
Contributor Author

joybh98 commented Apr 1, 2020

@datapythonista yes.Working on it right now

EDIT: There is still one file with conflict.

@joybh98
Copy link
Contributor Author

joybh98 commented Apr 1, 2020

@datapythonista should I open a new PR with a new branch ? This branch keeps giving me problems.

@ShaharNaveh
Copy link
Member

@joybhallaa I suggest you read https://datapythonista.me/blog/useful-git-commands.html

I've got some cool changes, but my history is a mess

@joybh98
Copy link
Contributor Author

joybh98 commented Apr 1, 2020

@datapythonista the 2nd last commit only has the changes that I've made.
Let me know if that's suitable

@datapythonista
Copy link
Member

@datapythonista the 2nd last commit only has the changes that I've made.
Let me know if that's suitable

No, we need a proper PR to be able to fix. @MomIsBestFriend gave you a resource to fix this. But probably better to open a new PR, closing this one, since your changes are small, and looks like it'll be easier to start again, than to fix this.

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

Successfully merging this pull request may close these issues.

DOC: Standardize references to pandas in the documentation