8000 DOC: Add examples to ``np.char`` by luxedo · Pull Request #26642 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Add examples to np.char #26642

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 13 commits into from
Oct 14, 2024
Merged

DOC: Add examples to np.char #26642

merged 13 commits into from
Oct 14, 2024

Conversation

luxedo
Copy link
Contributor
@luxedo luxedo commented Jun 8, 2024

Adds examples to np.char module. Part of #21351.

Examples added:

  • array - defchararray module
  • isalpha - ufunc_docstrings module
  • isspace - ufunc_docstrings module
  • mod - strings module
  • rfind - strings module
  • splitlines - strings module but in char namespace
  • startswith - strings module - example similar to endswith

luxedo added 8 commits June 8, 2024 15:15
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
[skip actions][skip azp][skip cirrus]
@luxedo luxedo marked this pull request as ready for review June 8, 2024 20:15
@ngoldbaum
Copy link
Member

Our plan is to eventually get rid of np.char in favor of np.strings. Can you focus your efforts on improving examples in np.strings instead?

@luxedo
Copy link
Contributor Author
luxedo commented Jun 12, 2024

This PR fills all the missing examples for np.char and np.strings:

  • isalpha - ufunc_docstrings module
  • isspace - ufunc_docstrings module
  • mod - strings module
  • rfind - strings module
  • startswith - strings module - example similar to endswith

The ones below are added only to to np.char:

  • splitlines - strings module but in char namespace
  • array - defchararray module

The name np.char showed up because of the script that we are using to dig for missing examples in the documentation:
https://gist.github.com/luxedo/c7ad85b8848136671d126cd7baa07990

luxedo and others added 2 commits September 1, 2024 22:04
@luxedo
Copy link
Contributor Author
luxedo commented Sep 2, 2024

Rebased after other merges added examples. This PR now contains:

  • array - defchararray module
  • isspace - ufunc_docstrings module
  • splitlines - strings module but in char namespace

@charris charris changed the title DOC/21351/np.char - Add examples to np.char DOC: Add examples to np.char Sep 2, 2024
Copy link
Contributor
@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

I'll go ahead and resolve the merge conflict.

@@ -1373,6 +1373,14 @@ def _splitlines(a, keepends=None):
--------
str.splitlines

Examples
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless there's some magic that uses the docstring of the private function in the public function, not sure if this is needed here?

@mdhaber
Copy link
Contributor
mdhaber commented Oct 12, 2024

@ngoldbaum I'm not familiar with the plan for np.char, so I can't say whether these are needed. I'm also not familiar with these functions, but they don't hinder my understanding of the rest of the docstring. LMK if anything else is needed or if it's OK to merge.

@ngoldbaum
Copy link
Member

I don't think these hurt. Let's merge.

@ngoldbaum ngoldbaum merged commit 4ea4268 into numpy:main Oct 14, 2024
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0