[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2013-01-07T14:35:43+01:00 https://forum-gephi.org/app.php/feed/topic/2374 2013-01-07T14:35:43+01:002013-01-07T14:35:43+01:00 https://forum-gephi.org/viewtopic.php?t=2374&p=7915#p7915 <![CDATA[Re: Problem with types in jython console]]> Try the following code:

CODE:

import org.openide.util.Lookup;import org.gephi.data.attributes.api.AttributeController;org.openide.util.Lookup.getDefault().lookup(org.gephi.data.attributes.api.AttributeController).getModel();
You can obtain many different controllers such as GraphController, AttributeController or DynamicController in Gephi through the Lookup mechanism.
Eduardo

Statistics:Posted by eduramiba — 07 Jan 2013 14:35


]]>
2013-01-06T15:32:19+01:002013-01-06T15:32:19+01:00 https://forum-gephi.org/viewtopic.php?t=2374&p=7907#p7907 <![CDATA[Re: Problem with types in jython console]]> cheers,
Francesco

Statistics:Posted by stablum — 06 Jan 2013 15:32


]]>
2013-01-04T23:13:19+01:002013-01-04T23:13:19+01:00 https://forum-gephi.org/viewtopic.php?t=2374&p=7900#p7900 <![CDATA[Re: Problem with types in jython console]]> The first argument actually looks fine, but the second argument should be of type org.gephi.data.attributes.api.AttributeModel instead of org.gephi.data.attributes.AttributeRowImpl.

Eduardo

Statistics:Posted by eduramiba — 04 Jan 2013 23:13


]]>
2013-01-04T15:50:52+01:002013-01-04T15:50:52+01:00 https://forum-gephi.org/viewtopic.php?t=2374&p=7896#p7896 <![CDATA[Problem with types in jython console]]>
I am trying to run a graph metric algorithm in the jython console. Unfortunately I cannot call the method 'execute' in a GraphDistance object.

This is the class of statistics object I need to use:

CODE:

>>> type(gd)<type 'org.gephi.statistics.plugin.GraphDistance'>
The type of the graph class is this:

CODE:

>>> type(gu)<type 'org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl'>
That is actually a subclass of HierarchicalGraph:

CODE:

>>> gu.class.__bases__[0].__bases__[0]<type 'org.gephi.graph.api.HierarchicalGraph'>
I also have the 'attributes' object as requested:

CODE:

>>> type(ga)<type 'org.gephi.data.attributes.AttributeRowImpl'>
But the execute states that the required type is not correct:

CODE:

>>> gd.execute(gu,ga)Traceback (most recent call last):  File "<input>", line 1, in <module>TypeError: execute(): 1st arg can't be coerced to org.gephi.graph.api.HierarchicalGraph, org.gephi.graph.api.GraphModel
This does not make much sense for me since the class of the graph object I am using is derived from the class that is required.

Any ideas?

Statistics:Posted by stablum — 04 Jan 2013 15:50


]]>