Skip to content

Stop "RuntimeWarning: invalid value encountered in true_divide" - #297

Closed
hyanwong wants to merge 1 commit into
tskit-dev:masterfrom
hyanwong:stop-test-invalid-value-warning
Closed

hyanwong wants to merge 1 commit into
tskit-dev:masterfrom
hyanwong:stop-test-invalid-value-warning

Conversation

@hyanwong

Copy link
Copy Markdown
Member

I was getting a little annoyed by "invalid value encountered in true_divide" warnings during the unit tests in some of the TestDiversity derived classes. This stops the errors, but perhaps we want to work out why they are happing in the first place. I guess this is a @petrelharp thing?

@petrelharp

Copy link
Copy Markdown
Contributor

Hm, that shouldn't actually change anything because of this. I'm surprised you get these; I thought we'd taken care of them? I can't track this down right now, apologies.

@hyanwong

Copy link
Copy Markdown
Member Author

Weird. FWIW - example in a recent CircleCI run:

https://circleci.com/gh/tskit-dev/tskit/734 under "Run Python tests"

test_empty_ts (tests.test_tree_stats.TestBranchDiversity) ... /home/circleci/tskit/python/tests/test_tree_stats.py:1188: RuntimeWarning: invalid value encountered in true_divide
  return x * (n - x) / (n * (n - 1))
ok

@hyanwong

Copy link
Copy Markdown
Member Author

No hurry on this, obv. Just scratching an itch.

@petrelharp

Copy link
Copy Markdown
Contributor

I have fixed this over here.

@petrelharp petrelharp mentioned this pull request Aug 23, 2019
@jeromekelleher

Copy link
Copy Markdown
Member

Issue closed in #330.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants