Do you see the same behavior if you use lower_than = dthetas.a < -tau/2

Yes I do.

lower_than = eptm.dthetas.a < -np.pi
eptm.dthetas.a[lower_than] +=  2 * np.pi
> ValueError

This also rises an error:

graph.set_vertex_filter(vfilt)
colors.fa -= 5
graph.set_vertex_filter(None)

But not this:

graph.set_vertex_filter(vfilt)
colors.a -= 5 # Whole array
graph.set_vertex_filter(None)

What numpy version are you using?

np.version >> ‘1.9.0.dev-61c699e’

Le 18/04/2014 11:22, Tiago de Paula Peixoto a écrit :

On 04/18/2014 11:06 AM, Guillaume Gay wrote:
Hi,

After updating graph-tool ( to version |2.2.31 (commit 245d1e2c, Thu Mar 27 11:28:39 2014 +0100)|), and a bunch of over things as I passed to Mint 15 to Mint 16, I encounter the following value error, when I manipulates parts of a PropertyMap (through indexing or via the |.fa| attribute (bellow, |dthetas| is an edge propertymap on a graph):

|lower_than = [dthetas.a < -tau/2.]
dthetas.a[lower_than] += tau

ValueError: output array is read-only|

Note that the following doesn't rise the error:

| lower_than = [dthetas.a < -tau/2.]
 dthetas.a[lower_than] = dthetas.a[lower_than] + tau|

It also happen when I filter a graph and do for example |eprop.fa *= 2|

I don't observe this. What numpy version are you using?

Do you see the same behavior if you use

    lower_than = dthetas.a < -tau/2.

i.e. without the square brackets?

Best,
Tiago



_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool