Skip to content

Fine-grained errstate handling #13145

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

Closed
wants to merge 14 commits into from
Closed

Conversation

rkern
Copy link
Contributor

@rkern rkern commented May 11, 2016

The precise strategy to be taken here is open for discussion. I tried to be reasonably fine-grained rather than slap a generic decorator over everything because it's easier to go that direction than the reverse. The errstate() blocks in the tests were added after fixing all of the library code. Unfortunately, these are less fine-grained than I would like because some of the tests have many lines of the form assert_array_equal(pandas_expression_to_test, expected_raw_numpy_expression) where expected_raw_numpy_expression is what is triggering the warning. It was tedious to try to rewrite all of that to wrap just expected_raw_numpy_expression.

I think I got everything exercised by the test suite except for parts of the test suite that are skipped on my machine due to dependencies. We'll see how things go in the CI.

I haven't added any new tests yet. Could do if requested.


.. _whatsnew_0190.new_features:

New features
Copy link
Contributor

Choose a reason for hiding this comment

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

just leave all this off for now (this whatsnew file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As in don't add the new file at all?

Copy link
Contributor

Choose a reason for hiding this comment

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

right, will add it later

@jreback
Copy link
Contributor

jreback commented May 11, 2016

@rkern ohh that was easy 😄

can we have a test which asserts the actual error state (is the default). Put in pandas/tests/test_util.py.

@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label May 11, 2016
@jreback jreback added this to the 0.19.0 milestone May 11, 2016
@codecov-io
Copy link

codecov-io commented May 11, 2016

Current coverage is 85.27% (diff: 100%)

Merging #13145 into master will increase coverage by 0.01%

@@             master     #13145   diff @@
==========================================
  Files           139        139          
  Lines         50380      50439    +59   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42953      43012    +59   
  Misses         7427       7427          
  Partials          0          0          

Powered by Codecov. Last update 453bc26...ef9c001

@rkern
Copy link
Contributor Author

rkern commented May 11, 2016

Please excuse the CI churn. The jobs for the older commits could be cancelled.

@jreback
Copy link
Contributor

jreback commented May 11, 2016

no prob. thats an annoyance about Travis.

@jorisvandenbossche jorisvandenbossche modified the milestones: 0.20.0, 0.19.0 Jul 8, 2016
@jreback
Copy link
Contributor

jreback commented Jul 15, 2016

@rkern I think we can now do this for 0.19.0

can you rebase / update?

@jreback
Copy link
Contributor

jreback commented Jul 24, 2016

@rkern can you rebase

@jreback jreback removed this from the 0.19.0 milestone Jul 24, 2016
@mcg1969
Copy link

mcg1969 commented Aug 10, 2016

@rkern, you now have another watcher on this... :-) Do you have an ETA when you could rebase?

@rkern rkern closed this Aug 11, 2016
@rkern rkern deleted the fix/errstate branch August 11, 2016 17:19
@rkern rkern restored the fix/errstate branch August 11, 2016 17:19
@rkern rkern reopened this Aug 11, 2016
@rkern
Copy link
Contributor Author

rkern commented Aug 11, 2016

@jreback Rebased.

@@ -95,7 +95,7 @@ def _align_core(terms):
term_axis_size = len(ti.axes[axis])
reindexer_size = len(reindexer)

ordm = np.log10(abs(reindexer_size - term_axis_size))
ordm = np.log10(max(1, abs(reindexer_size - term_axis_size)))
Copy link
Contributor

Choose a reason for hiding this comment

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

this is the fix for #13135 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@jreback
Copy link
Contributor

jreback commented Aug 11, 2016

this looks pretty good. just some minor comments. can you add in the whatsnew a sub-section, then add a warning (so its a big red box!) near the top.

@jreback jreback added this to the 0.19.0 milestone Aug 12, 2016
@jreback
Copy link
Contributor

jreback commented Aug 17, 2016

can you add docs and rebase. ping when green. this touches lots of code so I will merge then.

@rkern
Copy link
Contributor Author

rkern commented Aug 19, 2016

@jreback rebased and docced.

@jreback
Copy link
Contributor

jreback commented Aug 20, 2016

looks fine. though failing on all sparse comparisons....pls ping when green

@rkern
Copy link
Contributor Author

rkern commented Aug 20, 2016

@jreback Fixed thinko. All green.

@jreback jreback closed this in ce61b3f Aug 21, 2016
@jreback jreback mentioned this pull request Aug 21, 2016
6 tasks
@jorisvandenbossche
Copy link
Member

@rkern Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
5 participants