You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding to my previous comment, the current solution of automatically converting uids is not ideal. Consider this code:
n = pp.Network()
n.add_edge(0, 1)
print(n.nodes[0])
print(n.nodes['0'])
Due to the automatic conversion to string (which is probably very costly) it is not immediately clear, why the lookup of node 0 fails. This will lead to hard to understand bugs for the users.
Alos, the conversion is not applied consistently, i.e. one cannot add edges using indices of np.ndarrays.
With the new path implementation, the question is if we want to support
int
andfloat
values as uid. Currently onlystr
values are supported.In the previous version,
int
values were converted tostr
values however this is not consistent with the__getitem__
operator. i.e.furthermore,
int
andfloat
values are also used in theTemporalNetwork
to access certain timestamps.Therefore, I would suggest limiting uids to
str
values and useint
andfloat
for other purposes.The text was updated successfully, but these errors were encountered: