CAVEconnectome / CAVEclient

This is the python client for accessing REST APIs within the Connectome Annotation Versioning Engine.
https://caveconnectome.github.io/CAVEclient/
MIT License
19 stars 12 forks source link

Annotation uploading is not robust to some types #149

Open ceesem opened 4 months ago

ceesem commented 4 months ago

JSON encoding errors can occur with certain combinations of types. In particular, a list of numpy.int32s throws an error when used as a pt_position.

bdpedigo commented 4 months ago

np.integer might make some type checking more robust

print(isinstance(np.array([3], dtype=np.int64)[0], np.integer))
print(isinstance(np.array([3], dtype=np.int32)[0], np.integer))
True
True