Ticket #816 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

SystemError: new style getargs format but argument is not a tuple

Reported by: yang Owned by: janez
Milestone: Future Component: library
Severity: major Keywords:
Cc: Blocking:
Blocked By:


Trying to filter a continuous variable:

$ cat > /tmp/blah.txt
C#a     D#b     mC#x
0       0       0
1       1       1

$ ipython
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import orange

In [2]: t=orange.ExampleTable('/tmp/blah.txt')

In [3]: t.filter({'x':'?'}, negate=1)
SystemError                               Traceback (most recent call last)

/home/yang/pod/sales/<ipython console> in <module>()

SystemError: new style getargs format but argument is not a tuple

Change History

comment:1 Changed 3 years ago by yang

In the meantime, any workarounds? (Short of manually filtering/constructing a new .txt file)

comment:2 Changed 3 years ago by janez

  • Status changed from new to closed
  • Resolution set to wontfix

The error message is wrong; the method accepts too many different forms of arguments, so when something goes wrong it may be unable to report the correct error. Bad programming, I know.

This filter is not intended for filtering of undefined values. You can only use it in, for instance, t.filter({'x': (1, 2)}), which will get you examples with 1<x<2. To filter for undefineds, you probably need to go through something like

f = orange.Filter_isDefined(domain=t.domain) f.checkx?=True f(t)

Cumbersome, but since we are gradually migrating to numpy, we will rather declare these methods obsolete than fix them.

comment:3 Changed 3 years ago by yang

It's not the undefined comparison - I had also tried using non-'?', and that resulted in the same error.

comment:4 Changed 3 years ago by yang

Ah, I see - it must be a tuple of numbers. The other value I had tried was a single number.

Note: See TracTickets for help on using tickets.