Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
graph-tool
graph-tool
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #678

Closed
Open
Opened Aug 10, 2020 by Dan Sprague@dsprague

NestedBlockState with base_state=OverlapBlockState array broadcasting error

This is reproducible on Ubuntu even with provided test data. Here is the code:

g = gt.collection.data["celegansneural"] 
state= NestedBlockState(g,base_type=OverlapBlockState)

Yields the traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-85-aaf1edba7efe> in <module>
----> 1 NestedBlockState(g,base_type=OverlapBlockState)

~/anaconda3/envs/gt/lib/python3.8/site-packages/graph_tool/inference/nested_blockmodel.py in __init__(self, g, bs, base_type, state_args, hstate_args, hentropy_args, sampling, **kwargs)
    102                                   recs_dl=False,
    103                                   beta_dl=1.)
--> 104         self.levels = [base_type(g, b=bs[0], **self.state_args)]
    105         for i, b in enumerate(bs[1:]):
    106             state = self.levels[-1]

~/anaconda3/envs/gt/lib/python3.8/site-packages/graph_tool/inference/overlap_blockmodel.py in __init__(self, g, b, B, recs, rec_types, rec_params, clabel, pclabel, deg_corr, dense_bg, **kwargs)
    109             # substitute provided graph by its half-edge graph
    110             g, b, node_index, half_edges, eindex, rec = \
--> 111                                                 half_edge_graph(g, b, B, rec)
    112 
    113             if len(recs) > 0:

~/anaconda3/envs/gt/lib/python3.8/site-packages/graph_tool/inference/overlap_blockmodel.py in half_edge_graph(g, b, B, rec)
    798 
    799     if b_array is not None:
--> 800         be.a = b_array
    801 
    802     if rec is None:

~/anaconda3/envs/gt/lib/python3.8/site-packages/graph_tool/__init__.py in __set_array(self, v)
    486             raise TypeError("cannot set property map values from array for" +
    487                             " property map of type: " + self.value_type())
--> 488         a[:] = v
    489 
    490     a = property(get_array, __set_array,

ValueError: could not broadcast input array from shape (594) into shape (4718)
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: count0/graph-tool#678