Clean up ufuncs post numpy bump
State: closed

Found an old branch lying around I had forgotten about after the numpy bump, which had been requested by @TomAugspurger in [this comment](https://github.com/pandas-dev/pandas/pull/25554#pullrequestreview-212474594)


Labels:
name: Sparse
description: Sparse Data Type
name: Clean

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

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

```diff
@@            Coverage Diff             @@
##           master   #26606      +/-   ##
==========================================
+ Coverage   91.85%   91.86%   +<.01%     
==========================================
  Files         174      174              
  Lines       50707    50693      -14     
==========================================
- Hits        46578    46568      -10     
+ Misses       4129     4125       -4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.4% <ø> (+0.01%)` | :arrow_up: |
| #single | `41.76% <ø> (-0.09%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26606?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/sparse/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL2ZyYW1lLnB5) | `95.63% <ø> (-0.02%)` | :arrow_down: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `93.48% <ø> (+0.41%)` | :arrow_up: |
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `94.9% <ø> (+1.66%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26606?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/26606?src=pr&el=footer). Last update [0dbb99e...a4db51b](https://codecov.io/gh/pandas-dev/pandas/pull/26606?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/26606?src=pr&el=h1) Report
> Merging [#26606](https://codecov.io/gh/pandas-dev/pandas/pull/26606?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/0dbb99efc259c5182ac88f116ebb76ae6e2db6ee?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #26606      +/-   ##
==========================================
+ Coverage   91.85%   91.86%   +<.01%     
==========================================
  Files         174      174              
  Lines       50707    50693      -14     
==========================================
- Hits        46578    46568      -10     
+ Misses       4129     4125       -4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.4% <ø> (+0.01%)` | :arrow_up: |
| #single | `41.76% <ø> (-0.09%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26606?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/sparse/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL2ZyYW1lLnB5) | `95.63% <ø> (-0.02%)` | :arrow_down: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `93.48% <ø> (+0.41%)` | :arrow_up: |
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `94.9% <ø> (+1.66%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26606/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26606?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/26606?src=pr&el=footer). Last update [0dbb99e...a4db51b](https://codecov.io/gh/pandas-dev/pandas/pull/26606?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

nice that this passes

are there any other array_wrap* leftover? (in any class)
@jreback 

There are a bunch left:
```
>findstr /L /S /N "__array_wrap__" pandas/*.py
pandas/core\generic.py:1481:        return self.__array_wrap__(arr)
pandas/core\generic.py:1493:        return self.__array_wrap__(arr)
pandas/core\generic.py:1498:            return self.__array_wrap__(arr)
pandas/core\generic.py:1951:    def __array_wrap__(self, result, context=None):
pandas/core\indexes\base.py:665:    def __array_wrap__(self, result, context=None):
pandas/core\indexes\interval.py:384:    def __array_wrap__(self, result, context=None):
pandas/core\indexes\period.py:461:    def __array_wrap__(self, result, context=None):
pandas/core\series.py:748:    def __array_wrap__(self, result, context=None):

>findstr /L /S /N "__array_prepare__" pandas/*.py
pandas/core\series.py:755:    def __array_prepare__(self, result, context=None):

>findstr /L /S /N "__array_priority__" pandas/*.py
pandas/core\arrays\base.py:973:       You may want to set ``__array_priority__`` if you want your
pandas/core\arrays\base.py:1028:       You may want to set ``__array_priority__`` if you want your
pandas/core\arrays\categorical.py:307:    __array_priority__ = 1000
pandas/core\arrays\datetimes.py:264:    __array_priority__ = 1000
pandas/core\arrays\integer.py:342:    __array_priority__ = 1000  # higher than ndarray so ops dispatch to us
pandas/core\arrays\numpy_.py:107:    __array_priority__ = 1000
pandas/core\arrays\period.py:132:    __array_priority__ = 1000
pandas/core\arrays\timedeltas.py:132:    __array_priority__ = 1000
pandas/core\base.py:646:    __array_priority__ = 1000
pandas/core\generic.py:1946:    __array_priority__ = 1000
pandas/tests\extension\decimal\array.py:52:    __array_priority__ = 1000
pandas/tests\extension\json\array.py:53:    __array_priority__ = 1000
```

I only touched the sparse-stuff (according to the [comment](https://github.com/pandas-dev/pandas/pull/25554#pullrequestreview-212474594) I followed for this PR), and hadn't checked which other classes already implement `__array_ufunc__`. Now I did and not all of the above classes do:
```
>findstr /L /S /N "__array_ufunc__" pandas/*.py
pandas/core\arrays\numpy_.py:160:    def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
pandas/core\arrays\numpy_.py:170:            # allow subclasses that don't override __array_ufunc__ to
pandas/core\arrays\sparse.py:1643:    def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
pandas/core\sparse\series.py:115:    def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
pandas/core\sparse\series.py:121:        result = self.values.__array_ufunc__(ufunc, method, *inputs, **kwargs)
```
these are fine as we have ``__array_ufunc__`` in sparse; but we do not have in series/frame (and its non-trivial to add I briefly tried).