jacquesfize / GMatch4py

A graph matching library for Python
MIT License
192 stars 41 forks source link

`set_attr_graph_used` is not setting `node_attr_key` #36

Open ljmartin opened 1 year ago

ljmartin commented 1 year ago

Thanks for a great library.

I'd like to calculate GED using node properties aka attributes. Like another issue, this doesn't seem to work in practice: https://github.com/Jacobe2169/GMatch4py/issues/26

A starting point might be that the set_attr_graph_used doesn't appear to do anything. I'm afraid I don't know how to fix this, since the function does apparently change the attribute: https://github.com/Jacobe2169/GMatch4py/blob/4fc0a822514c65c0d8b12d090b5b89c0af50ef2a/gmatch4py/base.pyx#L68

ged=gm.GraphEditDistance(1,1,1,1) # all edit costs are equal to 1
ged.set_attr_graph_used("atomicNum",'hi')
ged.node_attr_key

output:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/var/folders/jh/02165y2n7kq2y5ychxtzcjm40000gn/T/ipykernel_37896/2867113632.py in <module>
      1 ged=gm.GraphEditDistance(1,1,1,1) # all edit costs are equal to 1
      2 ged.set_attr_graph_used("atomicNum",'hi')
----> 3 ged.node_attr_key

AttributeError: 'gmatch4py.ged.graph_edit_dist.GraphEditDistance' object has no attribute 'node_attr_key'