ENH: ExtensionArray.repeat
State: closed

cc @jreback 

Labels:
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Hello @TomAugspurger! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/base.py`](https://github.com/TomAugspurger/pandas/blob/567d4fa2b629670b9fc7e150cd9f21d29d91982c/pandas/core/arrays/base.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/base/methods.py`](https://github.com/TomAugspurger/pandas/blob/567d4fa2b629670b9fc7e150cd9f21d29d91982c/pandas/tests/extension/base/methods.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=h1) Report
> Merging [#24349](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c230f297c279bcac536f4689a30f1894d0278d06?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24349/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24349      +/-   ##
==========================================
- Coverage   92.29%   92.29%   -0.01%     
==========================================
  Files         162      162              
  Lines       51806    51813       +7     
==========================================
+ Hits        47815    47821       +6     
- Misses       3991     3992       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.7% <100%> (ø)` | :arrow_up: |
| #single | `43% <14.28%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/24349/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `97.53% <100%> (+0.11%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24349/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.48% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=footer). Last update [c230f29...757b49b](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=h1) Report
> Merging [#24349](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c230f297c279bcac536f4689a30f1894d0278d06?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24349/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24349      +/-   ##
==========================================
+ Coverage   92.29%   92.29%   +<.01%     
==========================================
  Files         162      162              
  Lines       51806    51815       +9     
==========================================
+ Hits        47815    47824       +9     
  Misses       3991     3991
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.7% <100%> (ø)` | :arrow_up: |
| #single | `42.99% <14.28%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/24349/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `97.53% <100%> (+0.11%)` | :arrow_up: |
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/24349/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `94.3% <0%> (+0.01%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=footer). Last update [c230f29...a16c253](https://codecov.io/gh/pandas-dev/pandas/pull/24349?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

do we have interactions with our other defintiions of this series.py and indexes/base.py? maybe create an issue to investigate this code duplication (same for searchsorted)
Added a fixture to parametrize the test across ExtensionArray.repeat and
Series.repeat.

I don't think there's any code duplication that could be removed. Series
needs to handle repeating the index, and just dispatches to `._values` for
repeating the array.

On Wed, Dec 19, 2018 at 8:26 AM Jeff Reback <notifications@github.com>
wrote:

> do we have interactions with our other defintiions of this series.py and
> indexes/base.py? maybe create an issue to investigate this code duplication
> (same for searchsorted)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/24349#issuecomment-448614107>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIk2RNEBe9veEuB-kySoCs0uQiJBSks5u6kyugaJpZM4ZaLkl>
> .
>

All green.
ExtensionArray is an auto summary, so these will be added automatically.

Though now that I think about it, it won't have the "private" methods like
_from_sequnce,
since numpydoc / autodoc excludes items starting with an `_`. But I guess
they'll be looking
at the source / GitHub anyway.

On Thu, Dec 20, 2018 at 8:38 AM Jeff Reback <notifications@github.com>
wrote:

> *@jreback* approved this pull request.
>
> these methods are in api.rst?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/24349#pullrequestreview-187024169>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIjlQR2W_pg1KackhRkPJLVs7c5-Cks5u66DhgaJpZM4ZaLkl>
> .
>