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
Hi all, I am experiencing some issues with graph_tool version 2.43 on two different systems. In both cases I have installed via conda-forge. On the linux system I have
import graph_tool.all as gt
gt.__version__
'2.43 (commit 5778eb10, )'
for python 3.8 (package version py38hdc7f20d_0). On os x I have
import graph_tool.all as gt
gt.__version__
'2.43 (commit , )'
for python 3.8 (package version py38haa49ee5_0).
Since I'm interested in edge prediction on LayeredBlockState I have tried a simple code which I also reported on graph-tool official issue tracker. The problem is that the same code is returning two different errors on both systems.
On OSX I have
g = gt.collection.ns["new_guinea_tribes"]
state = gt.minimize_nested_blockmodel_dl(g,
state_args=dict(base_type=gt.LayeredBlockState,
state_args=dict(ec=g.ep.weight, layers=True)))
missing = [(0, 6, 1), (0, 6, -1)]
state.get_edges_prob(missing)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-fadd85695711> in <module>
5
6 missing = [(0, 6, 1), (0, 6, -1)]
----> 7 state.get_edges_prob(missing)
~/anaconda3/envs/experimental/lib/python3.8/site-packages/graph_tool/inference/nested_blockmodel.py in get_edges_prob(self, missing, spurious, entropy_args)
441 lstate._state.clear_egroups()
442
--> 443 L += lstate.get_edges_prob(missing, spurious, entropy_args=eargs)
444 if isinstance(self.levels[0], LayeredBlockState):
445 missing = [(lstate.b[u], lstate.b[v], l_) for u, v, l_ in missing]
~/anaconda3/envs/experimental/lib/python3.8/site-packages/graph_tool/inference/layered_blockmodel.py in get_edges_prob(self, missing, spurious, entropy_args)
788
789 nes.append((u, v, (l, False)))
--> 790 nes.append((self._get_lvertex(u, l),
791 self._get_lvertex(v, l), (l, True)))
792
~/anaconda3/envs/experimental/lib/python3.8/site-packages/graph_tool/inference/layered_blockmodel.py in _get_lvertex(self, v, l)
748 def _get_lvertex(self, v, l):
749 i = numpy.searchsorted(self.vc[v].a, l)
--> 750 if i >= len(self.vc[v]) or l != self.vc[v][i]:
751 raise ValueError("vertex %d not present in layer %d" % (v, l))
752 u = self.vmap[v][i]
TypeError: Invalid index type
whereas on linux I have
g = gt.collection.ns["new_guinea_tribes"]
state = gt.minimize_nested_blockmodel_dl(g,
state_args=dict(base_type=gt.LayeredBlockState,
state_args=dict(ec=g.ep.weight, layers=True)))
missing = [(0, 6, 1), (0, 6, -1)]
state.get_edges_prob(missing)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/beegfs/scratch/tmp/ipykernel_16854/740866967.py in <module>
5
6 missing = [(0, 6, 1), (0, 6, -1)]
----> 7 state.get_edges_prob(missing)
~/miniforge3/envs/singlecell/lib/python3.8/site-packages/graph_tool/inference/nested_blockmodel.py in get_edges_prob(self, missing, spurious, entropy_args)
441 lstate._state.clear_egroups()
442
--> 443 L += lstate.get_edges_prob(missing, spurious, entropy_args=eargs)
444 if isinstance(self.levels[0], LayeredBlockState):
445 missing = [(lstate.b[u], lstate.b[v], l_) for u, v, l_ in missing]
~/miniforge3/envs/singlecell/lib/python3.8/site-packages/graph_tool/inference/layered_blockmodel.py in get_edges_prob(self, missing, spurious, entropy_args)
789 nes.append((u, v, (l, False)))
790 nes.append((self._get_lvertex(u, l),
--> 791 self._get_lvertex(v, l), (l, True)))
792
793 edge_list = nes
~/miniforge3/envs/singlecell/lib/python3.8/site-packages/graph_tool/inference/layered_blockmodel.py in _get_lvertex(self, v, l)
749 i = numpy.searchsorted(self.vc[v].a, l)
750 if i >= len(self.vc[v]) or l != self.vc[v][i]:
--> 751 raise ValueError("vertex %d not present in layer %d" % (v, l))
752 u = self.vmap[v][i]
753 return u
ValueError: vertex 6 not present in layer 1
According to Tiago's comments here it may be an issue with a proper compilation of the library.
Of course I may recompile myself graph-tool on os x, but having a fully functional package would save me a lot of time.
The text was updated successfully, but these errors were encountered:
Hi @dawe, I believe you have misunderstood my comment in the graph-tool issue tracker. I did not mention any issue with "proper compilation" of the library, instead I meant simply that fixes introduced in the git repository will appear only in the next release (2.44) or if you compile from the git version directly.
In any case, what you are experiencing seems to be a behavior difference with numpy when in linux or macos. Please open an issue at the graph-tool website so we can take a look at this properly.
I see, sorry.
Also, there's a part I did not understand (only one? LOL!): the commit you mentioned is preceding the one for version bump to 2.43, so I assume from version 2.43 on the function is working properly.
I believe this is the case as:
the original error I posted in the mailing list was raised by graph-tool 2.40 (which I updated only yesterday)
Version 2.43 raises an error of vertex missing in a layer but the method is definitely in place.
Hi all, I am experiencing some issues with graph_tool version 2.43 on two different systems. In both cases I have installed via conda-forge. On the linux system I have
for python 3.8 (package version py38hdc7f20d_0). On os x I have
for python 3.8 (package version py38haa49ee5_0).
Since I'm interested in edge prediction on LayeredBlockState I have tried a simple code which I also reported on graph-tool official issue tracker. The problem is that the same code is returning two different errors on both systems.
On OSX I have
whereas on linux I have
According to Tiago's comments here it may be an issue with a proper compilation of the library.
Of course I may recompile myself graph-tool on os x, but having a fully functional package would save me a lot of time.
The text was updated successfully, but these errors were encountered: