sg-dev / pathpy

pathpy is an OpenSource python package for the analysis of time series data on networks using higher-order and multi-order graphical models.
GNU Affero General Public License v3.0
2 stars 0 forks source link

Bug in calculation of node weights #44

Closed SimonNick closed 6 years ago

SimonNick commented 6 years ago

Note: to change 'successors' to 'predecessors' in line 231 is not required since those are the same for undirected networks, but it makes more sense logically.

verginer commented 6 years ago

Also the sum is overwritten not added in line 233 and 234, which might also be a bug

SimonNick commented 6 years ago

@verginer Good point, but I think in this case it is correct since in an undirected network there is no difference between in- and out-edges and therefore also no difference between in-weight and out-weight.

verginer commented 6 years ago

Yes you are complete right, I have added some tests 19a2eb5f04254238e937fc894646f67ee6d2cfcc and your changes all work perfectly

IngoScholtes commented 6 years ago

Thanks!

The assignment in line 233 and 234 should be fine. The idea is to recalculate the weighted degree from the edge weights of incoming and outgoing edges whenever the network is changed. This simplifies the logic to keep weighted degrees consistent.