Closed jGaboardi closed 4 years ago
If a distance matrix is desired, keep method for exporting it. Something like:
def export_distance_matrix(self):
nvtx = len(self.alldistances)
matrix = numpy.empty((nvtx, nvtx))
for idx, data in self.alldistances.items():
matrix[idx,:] = data[0]
return matrix
Decided to ditch the alldistances
attribute and keep the distancematrix
attribute (renamed distance_matrix
) + store the trees/paths in a new attribute: network_trees
. This will save a considerable amount of RAM because we will no longer be storing a full nXm distance matrix (distancematrix
) and each row of the distance matrix as the first tuple item of the alldistances
dictionary values.
Refactor the storage of the
spaghetti.Network.alldistances
andspaghetti.Network.distancematrix
attributes. These currently are redundant and can be combined into one attribute.see: here and here