Closed dglmoore closed 5 years ago
Merging #152 into master will increase coverage by
0.47%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #152 +/- ##
==========================================
+ Coverage 90.38% 90.85% +0.47%
==========================================
Files 16 16
Lines 1383 1389 +6
==========================================
+ Hits 1250 1262 +12
+ Misses 133 127 -6
Impacted Files | Coverage Δ | |
---|---|---|
neet/boolean/examples.py | 100% <100%> (ø) |
:arrow_up: |
neet/statespace.py | 100% <100%> (ø) |
:arrow_up: |
neet/boolean/logicnetwork.py | 96.73% <0%> (+3.26%) |
:arrow_up: |
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 0785122...6310706. Read the comment docs.
Numpy arrays use different integer types than Python proper. When they overflow, they don't covert to larger integer types. Instead they convert to floats. This makes sense give numpy is written in C, but it's a problem for us as we encode states of type numpy.ndarray. Specifically,
encoded += place * x
will change the type ofencoded
fromlong
tonp.float64
ifx
is a numpy integer/float type andplace * x
overlows. When we get to the return statement ofStateSpace._unsafe_encode
and convert the result to along
, the value gets rounded.We fixed this by changing
to
and getting rid of the redundant conversion at the end.