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

Clean up ufuncs post numpy bump #26606

Merged
merged 1 commit into from
Jun 2, 2019
Merged

Conversation

h-vetinari
Copy link
Contributor

Found an old branch lying around I had forgotten about after the numpy bump, which had been requested by @TomAugspurger in this comment

@codecov
Copy link

codecov bot commented Jun 1, 2019

Codecov Report

Merging #26606 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            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%) ⬆️
#single 41.76% <ø> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/core/sparse/frame.py 95.63% <ø> (-0.02%) ⬇️
pandas/core/arrays/sparse.py 93.48% <ø> (+0.41%) ⬆️
pandas/core/sparse/series.py 94.9% <ø> (+1.66%) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 97% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dbb99e...a4db51b. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jun 1, 2019

Codecov Report

Merging #26606 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            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%) ⬆️
#single 41.76% <ø> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/core/sparse/frame.py 95.63% <ø> (-0.02%) ⬇️
pandas/core/arrays/sparse.py 93.48% <ø> (+0.41%) ⬆️
pandas/core/sparse/series.py 94.9% <ø> (+1.66%) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 97% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dbb99e...a4db51b. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Jun 1, 2019

nice that this passes

are there any other array_wrap* leftover? (in any class)

@gfyoung gfyoung added Clean Sparse Sparse Data Type labels Jun 1, 2019
@h-vetinari
Copy link
Contributor Author

@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 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)

@jreback jreback added this to the 0.25.0 milestone Jun 2, 2019
@jreback
Copy link
Contributor

jreback commented Jun 2, 2019

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).

@jreback jreback merged commit 0e3bf7f into pandas-dev:master Jun 2, 2019
@h-vetinari h-vetinari deleted the ufunc_cleanup branch June 3, 2019 05:17
vaibhavhrt pushed a commit to vaibhavhrt/pandas that referenced this pull request Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants