Repository navigation
Fixes issue #8 - #185
Fixes issue #8#185
Conversation
Codecov Report
@@ Coverage Diff @@
## master #185 +/- ##
==========================================
+ Coverage 85.95% 85.97% +0.01%
==========================================
Files 16 16
Lines 8732 8744 +12
Branches 1678 1680 +2
==========================================
+ Hits 7506 7518 +12
Misses 733 733
Partials 493 493
Continue to review full report at Codecov.
|
jeromekelleher
left a comment
There was a problem hiding this comment.
Seems like this something like this is the only option. We'd need some specific tests on the as_int32 function though.
dcdd591 to
1fac82a
Compare
|
Is the right place to put my Re: tests. These are done somewhat in the |
1fac82a to
6b83479
Compare
Sure, this is as good a place as any and name is good. |
6b83479 to
87adaf4
Compare
|
I could also use |
|
Flags is uint32, so we'd need a slightly different version there. I think the to_int32 should be applied anywhere we referring to object IDs. These will be in the Tables API (node IDs, site IDs, etc), and where we compute stats (GNN, eg, takes lists of samples). We don't have to do it all at once, but it would be good to follow up with an issue saying this needs to be done if you don't want to do it here. |
Right. I'll open an issue once this is merged. |
7334a71 to
062348c
Compare
062348c to
8857835
Compare
|
Merging, thanks @hyanwong. |
Solving #8 seems a bit more convoluted than I had expected, but we need to allow passing
[], which by default is of dtypenp.float64, and it seems as if numpy doesn't have any built-in bounds checking. I've created a functionto_np_int32as I imagine we might want to use this in other python functions, as per theset_columnsexample by @petrelharp. But perhaps there's a neater solution.As a bonus, this now catches errors like
ts.simplify([0.1,1.3])which used to convert silently to ints, and it also returns a TypeError forts.simplify({})rather than ValueError, which seems more correct to me. I've also added a few more test cases.