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
Using del statement works well when issued from the console, but does not have any effect, when used inside of a method.
Possible Solution
Steps to Reproduce
def removeNodes()
for node in g.nodes:
del node
removeNodes()
The above statement should result in all nodes removed from the graph. Instead, it has no effect.
As far as I know, the plugin does not give any other solution for removing nodes.
I tried
g.nodes.remove(...)
but couldn't figure out if this would work with any key.
Context
I can't use python scripts solving complex solutions. One has to always copy/paste scripts into console.
Your Environment
Gephi Version used: Gephi 0.9.7 202208031831
Plugin Version used: 0.9.2
Operating System: Windows 8.1
The text was updated successfully, but these errors were encountered:
You can actually both delete noes and run a Python script from the python script plugin. I have created a gist that should work for you.
The gist filters nodes that have a specific modularity class, adds them to a subgraph and deletes them. You can run it from the scripting plugin by giving >>> execfile("/path_to_script/script.py") .
The above does not actually work if the del v part, for node v, is inside a function. Perhaps delete inside a function, operates on node copies, but this is just a speculation so far
Which Plugin?
python-scripting-plugin
Expected Behavior
del statement work from methods as well
Current Behavior
Using del statement works well when issued from the console, but does not have any effect, when used inside of a method.
Possible Solution
Steps to Reproduce
def removeNodes()
for node in g.nodes:
del node
removeNodes()
The above statement should result in all nodes removed from the graph. Instead, it has no effect.
As far as I know, the plugin does not give any other solution for removing nodes.
I tried
g.nodes.remove(...)
but couldn't figure out if this would work with any key.
Context
I can't use python scripts solving complex solutions. One has to always copy/paste scripts into console.
Your Environment
The text was updated successfully, but these errors were encountered: