v.out_degree() != D.get_out_degrees([v]) in graph-tool 2.28
Dear Tiago et al,
Summary
today I stumbled upon a discrepancy while computing out-degrees in my graphs. I noticed that two different methods to obtain out-degrees returned different values. I checked with docker images 2.28 and 2.27 self-compiled, where the methods return the same values. I consider this a bug, because I couldn't find any hint in the documentation of changed implementation or behavour regarding that.
Steps to reproduce
Consider this edgelist (first 12 lines) with an additional edge property c0 (the original graph binary can be found here: https://data.gesis.org/lodcc/2017-08/dumps/rkb-explorer-newcastle/data.graph.gt.gz):
9624295b5c6ee2c5 fe627f53361ee34d ae98476863dc6ec5
9624295b5c6ee2c5 59a1d3bd726ebafc 02325f53aeba2f02
9624295b5c6ee2c5 1e8635aaffc1f824 cfbbfd6f9f3543c7
9624295b5c6ee2c5 c773144c7a02667e bcd2bb4917063e6d
9624295b5c6ee2c5 b9b10350d0a478d0 a4f28ce1939f0e26
9624295b5c6ee2c5 eef3243f218808dc a4f28ce1939f0e26
9624295b5c6ee2c5 b026c38d79f1dd1c 866d27e2aa6a8d9b
9624295b5c6ee2c5 ca97bb3dc905f096 866d27e2aa6a8d9b
35c482dd7481c2f6 99bc59feb51d7bb5 ae98476863dc6ec5
35c482dd7481c2f6 7f72a673cf38581d fa584ad472ee8e06
35c482dd7481c2f6 7f72a673cf38581d 58737bd7c247922d
f0a0dc3c7c7819c0 35c482dd7481c2f6 a382d83422e6bacc
...
I think there is no doubt about that 9624295b5c6ee2c5
(first vertex with index 0) has an out-degree of 8, i.e. (8 out-going edges, namely vertices with index 1-8).
>>> v = D.get_vertices()[0] # get first vertex
>>> D.vp.name[v] # '9624295b5c6ee2c5'
What is the current bug behavior?
>>> v.out_degree() # 8
>>> D.get_out_degrees([v]) # [0], should be [8]
But in turn:
>>> D.get_in_degrees([v]) # [8], should be [0]
Additional Info & Version Specifications
I am using the latest docker-image from tiagopeixoto/graph-tool
. Inside the image:
$ python -c "import graph_tool; print(graph_tool.__version__)"
2.28 (commit e5760dfc, Thu Jun 6 15:14:05 2019 +0100)
I checked above behaviour with 2.27 (commit ce258562, Thu Jun 28 14:29:44 2018 +0100) where
>>> v.out_degree() # 8
>>> D.get_out_degrees([v]) # [8]
is the expected value.
Am I missing something or is this a false behaviour?
Best regards, Matthäus