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
As noted in #436, the AGraph.copy method creates new graphs that preserve attributes from the original graphs that can not otherwise be overwritten: the name attribute, for example.
>>>A=pgv.AGraph(name="test")
>>>B=A.copy()
>>>B.name==A.name>>>B.name="testB"Traceback (mostrecentcalllast)
...
AttributeError: can't set attribute 'name'
The copy method should support renaming the graph instance. Similarly, there may be other read-only attributes of the AGraph instance that should be allowed to be modified when copying.
It's actually slightly different (worse?) than that. B=A.copy() means that B has the empty string as the name. It is also strict even if A is not strict. Basically, B is created with the default attributes (except for directed which is copied over) and then all the nodes and edges and graph_attr values are copied over. I guess we should allow the static and name attributes to be copied over by default and maybe morphed during that process.
As noted in #436, the
AGraph.copy
method creates new graphs that preserve attributes from the original graphs that can not otherwise be overwritten: thename
attribute, for example.The copy method should support renaming the graph instance. Similarly, there may be other read-only attributes of the AGraph instance that should be allowed to be modified when copying.
See #436 for further discussion.
The text was updated successfully, but these errors were encountered: