Currently, when node_type is users and a user A has interacted with user B in different forms (like retweet and reply), we obtain an edge with the following attributes:
type: the type of the first interaction between A and B, and
weight: the total number of interactions, regardless of its type.
I think that it would have more sense to obtain the following attributes:
weight: the total number of interactions, regardless of its type,
retweet: the number of retweets,
reply: the number of replies, and
quote: the number of quotes.
weight would be just the sum of the other three attributes, but maybe it is good to keep it for compatibility with old versions and because Networkx use it as the default weight.
By the way, I imagine that all edges were added by the same function add regardless of the node type in order to reuse the same code. But after this commit, where no code is shared between different node types, it seems that using three different add functions (one for each node type) with different parameters would be cleaner. But maybe this change should be done in another pull request?
This is a big improvement, thanks @JoanMassachs! I will merge this PR, but I like the sound of your idea to refactor into those three functions. So please send it if you have the time & energy.
Currently, when
node_type
isusers
and a user A has interacted with user B in different forms (like retweet and reply), we obtain an edge with the following attributes:type
: the type of the first interaction between A and B, andweight
: the total number of interactions, regardless of its type.I think that it would have more sense to obtain the following attributes:
weight
: the total number of interactions, regardless of its type,retweet
: the number of retweets,reply
: the number of replies, andquote
: the number of quotes.weight
would be just the sum of the other three attributes, but maybe it is good to keep it for compatibility with old versions and because Networkx use it as the default weight.By the way, I imagine that all edges were added by the same function
add
regardless of the node type in order to reuse the same code. But after this commit, where no code is shared between different node types, it seems that using three different add functions (one for each node type) with different parameters would be cleaner. But maybe this change should be done in another pull request?