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: Fixed validate_title_capitalization warnings in most recent what… #59146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kajor3k
Copy link

@kajor3k kajor3k commented Jun 29, 2024

…snew doc files. Sorted exceptions list alphabetically, for better maintainability, proposed name change from CAPITALIZATION_EXCEPTIONS to CAPITALIZATION_EXCLUSIONS. (#32550)

…snew doc files. Sorted exceptions list alphabetically, for better maintainability, proposed name change from CAPITALIZATION_EXCEPTIONS to CAPITALIZATION_EXCLUSIONS. (pandas-dev#32550)
@@ -858,7 +858,7 @@ MultiIndex
^^^^^^^^^^
- Bug in :meth:`MultiIndex.get_indexer` not raising ``ValueError`` when ``method`` provided and index is non-monotonic (:issue:`53452`)

I/O
IO
Copy link
Author

Choose a reason for hiding this comment

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

Decided to drop slash here, as "IO" has been already added to exception list

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 this should be left as is.

"HTML",
"SAS",
"SQL",
CAPITALIZATION_EXCLUSIONS = {
Copy link
Author

Choose a reason for hiding this comment

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

Proposed to change the name of this list from _EXCEPTIONS to _EXCLUSIONS, because exceptions seems to be more related to error handling in the code itself and this name may be confusing.
However I'm happy to discuss or drop this change if you think it's out of scope of that story or is unnecessary

@Aloqeely
Copy link
Member

Thanks for the PR! I don't think it's that important to update old release notes' capitalization, updating other parts of the documentation is probably more important.

But, this is still appreciated!

}

CAP_EXCEPTIONS_DICT = {word.lower(): word for word in CAPITALIZATION_EXCEPTIONS}
CAP_EXCEPTIONS_DICT = {word.lower(): word for word in CAPITALIZATION_EXCLUSIONS}
Copy link
Member

Choose a reason for hiding this comment

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

If we're gonna rename CAPITALIZATION_EXCEPTIONS to CAPITALIZATION_EXCLUSIONS then this dict will have to be renamed to CAP_EXCLUSIONS_DICT as well.

But, before you do that, let's wait for a pandas maintainer's opinion on renaming this. I don't want to ask you to do something just for it to be reverted in the end.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, thanks!
Alright - let's wait for a decision and I'll act basing on that

Copy link
Member

Choose a reason for hiding this comment

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

Changing to exclusions makes sense to me.

@@ -17,7 +17,7 @@ Upcoming changes in pandas 3.0

pandas 3.0 will bring two bigger changes to the default behavior of pandas.

Copy-on-Write
Copy-on-write
Copy link
Member

Choose a reason for hiding this comment

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

Most of the time I've seen 'Copy on Write' being written is with a capital W. Maybe we should add this to the exceptions list

@@ -858,7 +858,7 @@ MultiIndex
^^^^^^^^^^
- Bug in :meth:`MultiIndex.get_indexer` not raising ``ValueError`` when ``method`` provided and index is non-monotonic (:issue:`53452`)

I/O
IO
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 this should be left as is.

@kajor3k
Copy link
Author

kajor3k commented Jun 30, 2024

Thanks for the PR! I don't think it's that important to update old release notes' capitalization, updating other parts of the documentation is probably more important.

But, this is still appreciated!

Thank you!
You're right - there are more urgent stuff to be done. I started with few files and small improvements throughout the file for two reasons.
First, I wanted to create a PR which could be a template for other newcomers in case they would like to pickup some of the files. I saw that the approach in which all files are being fixed at once is not welcome due to the size of PR, But if nobody else will comment under original story(#32550) I will gradually pickup other files an clean them as well.
The second reason is that this story doesn't make sense if it won't be finished up by turning on this validation on code_checks. But before it can be done, the validation needs to be flawless I see that the validation is running, but it is not configured where I was looking for it.

@kajor3k
Copy link
Author

kajor3k commented Jun 30, 2024

There's one error I don't know how to tackle:
doc/source/whatsnew/v2.2.2.rst:15:Heading capitalization formatted incorrectly. Please correctly capitalize "Pandas 2.2.2 is now compatible with numpy 2.0" to "pandas 2.2.2 is now compatible with NumPy 2.0"

"pandas" in underscore is already in the list of exclusions, but here it is the beginning of the title so it is expected to be upperscore

@Aloqeely
Copy link
Member

but here it is the beginning of the title so it is expected to be upperscore

From the citing webpage: "When using the project name pandas, please use it in lower case, even at the beginning of a sentence." -- Not sure why this rule was made but it's quite interesting

@kajor3k
Copy link
Author

kajor3k commented Jun 30, 2024

but here it is the beginning of the title so it is expected to be upperscore

From the citing webpage: "When using the project name pandas, please use it in lower case, even at the beginning of a sentence." -- Not sure why this rule was made but it's quite interesting

Alright, thanks for your response! Then it is clear. pandas should be underscore even at the beginning of the sentence

@rhshadrach
Copy link
Member

Not sure why this rule was made but it's quite interesting

This is generally how names are - they are styled in upper/lower case independent of other grammatical rules, and always done in a consistent manner. For example, words may start with an uppercase letter but they don't appear in the middle unless it is a name, e.g. McClain. And you would never see "IPhone" at the beginning of a sentence, it's always "iPhone". You see this with other packages as well, e.g. scikit-learn.

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 this pull request may close these issues.

None yet

3 participants