[gephi-dev] A few questions about the Filters API
Luiz Ribeiro
luizribeiro at gmail.com
Thu Aug 11 03:34:22 CEST 2011
I'm trying to create some unit tests that reproduce the first bug (the
AttributeRangeFilter one) and I'm getting stuck with a
NullPointerException.
I'm doing the same thing that the "Toolkit - Headless Gephi" wiki page
suggests. Apparently, after initializing the project the Lookup for
GraphController returns null and, because of that, I can't get a
reference to the current workspace's GraphModel.
I couldn't get FilterProcessorTest from FiltersImpl to run either,
because of the same problem (can't get a valid GraphController).
Any idea of what is happening? Is the wiki page outdated? My code is
attached, also.
--Luiz
On Tue, Aug 9, 2011 at 12:05 PM, Mathieu Bastian
<mathieu.bastian at gmail.com> wrote:
> Thanks for report, I was able to reproduce the second bug. This is a serious
> bug, I'll check it out.
> Mathieu
>
> On Mon, Aug 8, 2011 at 8:28 PM, Luiz Ribeiro <luizribeiro at gmail.com> wrote:
>>
>> On Thu, Aug 4, 2011 at 12:03 AM, Mathieu Bastian
>> <mathieu.bastian at gmail.com> wrote:
>> >> 1) When you apply a NodeAttributeRangeFilter with a given range that
>> >> doesn't match any node (or edge, in the case of an
>> >> EdgeAttributeRangeFilter), a GraphView which is equal to the original
>> >> main graph is returned. Is this a bug or is it expected behavior?
>> >
>> > That is a bug. It's not something that can be done from the UI as the
>> > range
>> > is restricted to existing values, so we probably don't deal with that
>> > case.
>> > Please file a bug on Launchpad.
>>
>> Done. https://bugs.launchpad.net/gephi/+bug/823036
>>
>> >> 2) I'm a bit unsure of how to create NodeEqualNumberFilters. Here's
>> >> what I've been trying so far, with no success:
>> >>
>> >> NodeEqualNumberFilter filter = new
>> >> AttributeEqualBuilder.NodeEqualNumberFilter(attributeColumn);
>> >> Query query = filterController.createQuery(filter);
>> >> filter.setMatch(new Integer(2));
>> >
>> > That sounds right. Is the column the same type as the match (i.e.
>> > Integer) ?
>>
>> Yes, it is. Actually, I believe this is a bug too. I tried doing
>> everything via Gephi's UI: added some nodes to the graph, created an
>> Integer attribute column and assigned values to the nodes. Whenever I
>> try filtering the graph with the Attribute Equal Filter on the Filters
>> UI, I get the same exception that I get with my code:
>>
>> java.lang.IllegalArgumentException: min, max and value must be the same
>> class
>> at org.gephi.filters.api.Range.tribToBounds(Range.java:356)
>> at
>> org.gephi.filters.plugin.attribute.AttributeEqualBuilder$EqualNumberFilter.refreshValues(AttributeEqualBuilder.java:390)
>> at
>> org.gephi.filters.plugin.attribute.AttributeEqualBuilder$EqualNumberFilter.init(AttributeEqualBuilder.java:337)
>> at
>> org.gephi.filters.FilterProcessor.processNodeFilter(FilterProcessor.java:110)
>> at
>> org.gephi.filters.FilterProcessor.process(FilterProcessor.java:84)
>> at org.gephi.filters.FilterThread.filter(FilterThread.java:128)
>> [catch] at org.gephi.filters.FilterThread.run(FilterThread.java:99)
>>
>> I've filed a bug report on Launchpad for this too (Bug #823038). I'll
>> try to track these bugs down during the next few days.
>>
>> --Luiz
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AttributeRangeFilterTest.java
Type: text/x-java
Size: 3496 bytes
Desc: not available
URL: <http://gephi.org/pipermail/gephi-dev/attachments/20110810/d1da3a5b/attachment.java>
More information about the gephi-dev
mailing list