Skip to content

Commit

Permalink
Docstrings examples for string methods (#7669)
Browse files Browse the repository at this point in the history
* Use more descriptive link texts

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix link target name

* Fix typos

* Add example for DataArray.str.capitalize

* Add example for DataArray.str.lower

* Add docstring example for DataArray.str.swapcase

* Add docstring example for DataArray.str.title

* Add docstring example for DataArray.str.upper

* Add docstring example for DataArray.str.casefold

* Add docstring example for DataArray.str.isalnum

* Add docstring example for DataArray.str.isalpha

* Add docstring example for DataArray.str.isdecimal

* Add docstring example for DataArray.str.isdigit

* Add docstring example for DataArray.str.islower

* Add docstring example for DataArray.str.isnumeric

* Add docstring example for DataArray.str.isspace

* Add docstring example of DataArray.str.istitle

* Add docstring example for DataArray.str.isupper

* Add a docstring example for DataArray.str.count

* Add docstring example of DataArray.str.startswith

* Add docstring example of DataArray.str.endswith

* Use varied examples

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Escape \n and \t

Solves the incosistent whitespace error

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes failing doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Replace "Example" with "Examples"

To follow the Numpy docstrings format.

* Delete unnecessary import

* Pass a regex to the count function

* Pass an array of strings to the count function

This example demonstrates how the pattern is broadcasted.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add docstrings examples for DataArray.str.pad

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix invalid escape sequence warning

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix regex

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add data array and filled value

* Correct spelling mistake

* Modify wording to make it easier to understand

* Fix indent errors

* Add whats-new, fix docs

---------

Co-authored-by: remigathoni <marg.kahiga@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
  • Loading branch information
4 people authored Apr 19, 2023
1 parent ae10df4 commit c75ac8b
Show file tree
Hide file tree
Showing 2 changed files with 354 additions and 4 deletions.
4 changes: 3 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ Bug fixes

Documentation
~~~~~~~~~~~~~

- Added examples to docstrings for :py:meth:`xarray.core.accessor_str.StringAccessor` methods.
(:pull:`7669`) .
By `Mary Gathoni <https://github.com/remigathoni>`_.

Internal Changes
~~~~~~~~~~~~~~~~
Expand Down
Loading

0 comments on commit c75ac8b

Please sign in to comment.