Layered overlapping model not working on GraphView

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Layered overlapping model not working on GraphView

fitzgeraldj
Hi there,

Layered overlapping models aren't working for GraphViews, due to the
following problematic lines in LayeredBlockState:

if overlap and self.ec is not None:
            self.base_ec = self.base_g.own_property(ec.copy())
            ec = agg_state.eindex.copy()
            pmap(ec, self.ec) <-- this line won't work as the GraphView
inherits eindex
            self.ec = ec.copy("int")

Is there an easy fix? Minimum working example below:

import numpy.random as rand
import graph_tool.all as gt

N = 20
L = 3
tg = gt.price_network(N) # generate random network size N
elayer = tg.new_ep('int')
E = len(tg.get_edges())
elayer.a = rand.randint(0,high=L,size=E) # randomly assign each edge to one
of L layers
tg.ep['elayer'] = elayer
utg = gt.GraphView(tg,rand.choice([True,False],size=N)) # take random
subsample of graph
stest = gt.minimize_nested_blockmodel_dl(utg,layers=True,overlap=True
                                                             
state_args=dict(ec=utg.ep.elayer,layers=True))

Thanks,
John




--
Sent from: https://nabble.skewed.de/
_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool
Reply | Threaded
Open this post in threaded view
|

Re: Layered overlapping model not working on GraphView

Tiago Peixoto
Administrator
Hi,

Thanks for the bug report and minimal working example.

Could you please open an issue in gitlab so this can be tracked and fixed?

The mailing list is not the best place for this.

Best,
Tiago

Am 25.08.20 um 18:43 schrieb fitzgeraldj:

> Hi there,
>
> Layered overlapping models aren't working for GraphViews, due to the
> following problematic lines in LayeredBlockState:
>
> if overlap and self.ec is not None:
>             self.base_ec = self.base_g.own_property(ec.copy())
>             ec = agg_state.eindex.copy()
>             pmap(ec, self.ec) <-- this line won't work as the GraphView
> inherits eindex
>             self.ec = ec.copy("int")
>
> Is there an easy fix? Minimum working example below:
>
> import numpy.random as rand
> import graph_tool.all as gt
>
> N = 20
> L = 3
> tg = gt.price_network(N) # generate random network size N
> elayer = tg.new_ep('int')
> E = len(tg.get_edges())
> elayer.a = rand.randint(0,high=L,size=E) # randomly assign each edge to one
> of L layers
> tg.ep['elayer'] = elayer
> utg = gt.GraphView(tg,rand.choice([True,False],size=N)) # take random
> subsample of graph
> stest = gt.minimize_nested_blockmodel_dl(utg,layers=True,overlap=True
>                                                              
> state_args=dict(ec=utg.ep.elayer,layers=True))
>
> Thanks,
> John
>
>
>
>
> --
> Sent from: https://nabble.skewed.de/
> _______________________________________________
> graph-tool mailing list
> [hidden email]
> https://lists.skewed.de/mailman/listinfo/graph-tool
>

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (849 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>
Reply | Threaded
Open this post in threaded view
|

Re: Layered overlapping model not working on GraphView

fitzgeraldj
Apologies, gitlab won't let me sign in with any account at the moment for
some reason otherwise I would.



--
Sent from: https://nabble.skewed.de/
_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool
Reply | Threaded
Open this post in threaded view
|

Re: Layered overlapping model not working on GraphView

Tiago Peixoto
Administrator
Am 26.08.20 um 10:49 schrieb fitzgeraldj:
> Apologies, gitlab won't let me sign in with any account at the moment for
> some reason otherwise I would.

The system seems to have thought that your multiple accounts were
spam... I have unblocked them.


--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (849 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>