WilliamHPNielsen / limnos

Other
0 stars 0 forks source link

Make all coordinates be standard ints #10

Closed WilliamHPNielsen closed 3 years ago

WilliamHPNielsen commented 3 years ago

It's good to have types that we can believe in. Currently, some generated points have coordinates that are not ints but numpy.int64s. This somewhat subtle difference can matter e.g. when one tries to serialize to JSON.

This PR explicitly casts numpy ints to standard ints and adds a test to ensure the type purity.

@jeppetrost @petterbejo

petterbejo commented 3 years ago

LGTM. Thought about removing the comment on lines 196-7 in generation, but since the reason for the int cast might not be totally obvious to everybody, I think it's better to keep the comment...