To make use of datatypes more coherent and minimize datatype complications with cython, semantic type aliases for various purposes were defined in pyunicorn.core._ext.types as of 3dab5bf. Currently, in most cases variables are only cast to the respective type alias at the python/cython interface (using pyunicorn.core._ext.types.to_cy()) to keep implementation effort within limited resource bounds at the time.
This specifically concerns the type alias ADJ=np.int8 which is meant for adjacency matrices. The adjacency matrix self.adjacency is a property of the Network class, and is thus inherited by all its child classes.
The dtype of Network.adjacency is set to int16 or int32 in Network._set_adjacency() to avoid overflow in numpy.sparse matrices.
TODO:
Introduce ADJ at this point.
check for a better way to avoid overflow in sparse matrices.
check all inheriting classes for possible conflicts, especially at python/cython interface
To make use of datatypes more coherent and minimize datatype complications with cython, semantic type aliases for various purposes were defined in
pyunicorn.core._ext.types
as of3dab5bf
. Currently, in most cases variables are only cast to the respective type alias at the python/cython interface (usingpyunicorn.core._ext.types.to_cy()
) to keep implementation effort within limited resource bounds at the time.This specifically concerns the type alias
ADJ=np.int8
which is meant for adjacency matrices. The adjacency matrixself.adjacency
is a property of theNetwork
class, and is thus inherited by all its child classes.The dtype of
Network.adjacency
is set toint16
orint32
inNetwork._set_adjacency()
to avoid overflow innumpy.sparse
matrices.TODO:
ADJ
at this point.to_cy
conversionstest_timeseries.testVisibility()
(and possibly others) accordinglySee Issue #163 for a previous dicussion on this.