DocNow / twarc-network

Generate network visualizations from Twitter data.
MIT License
19 stars 1 forks source link

Different user edge weights according to edge types #3

Closed JoanMassachs closed 2 years ago

JoanMassachs commented 2 years ago

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:

I think that it would have more sense to obtain the following attributes:

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?

edsu commented 2 years ago

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.