Closed hanslovsky closed 7 years ago
I guess we should just make the default label type uint64.
Allowing for more data types will increase the class-complexity
since on the python side this would result in a new class.
I could live with np.uint64
as default. I think, accepting the two biggest unsigned integer types (np.uint32
and np.uint64
) would still be ok complexity-wise. All other cases could then default to np.int64
.
Ok, I guess allowing for uin32 and uint64 is fine. Would you also like int32 and int64 to work? ( One could argue in the python world signed integers are more common)
In principle I am ok with using all integer types (in #109 it's just unsigned right now) which would be just 16 lines of code. If you'd like to exclude 8bit and 16bit integers, that's fine with me. Just let me know what you prefer and I'll adapt the pr accordingly.
Ok, fuck it, just use all god damn integers...
but we maybe should watch the binary size / *.so size. I guess if it is only increasing by lets say max. 0.1to 1 MB I guess one should not give a fuck
I'll build and compare.
I built the library eight times, adding an additional integer overload each time:
du -hs python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
3.7M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
3.8M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
3.9M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
4.0M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
4.1M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
4.3M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
4.4M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
4.5M python/nifty/graph/rag/_rag.cpython-36m-x86_64-linux-gnu.so
It is save to say that adding an additional overload adds about 0.1MB
to the library, so a total of about 0.8MB
when considering all of {uint,int}_{8,16,32,64}
.
I guess this is ok, ty for the experiments
nifty.graph.rag.gridRag
requires the labels to benp.uint32
. https://github.com/DerThorsten/nifty/blob/master/src/python/module/nifty/graph/rag/__init__.py#L20 Allowing fornp.uint64
(and potentially more data types) would be desirable