Orange Forum • View topic - Catching KernelWarning

Catching KernelWarning

A place to ask questions about methods in Orange and how they are used and other general support.

Catching KernelWarning

Postby sreastman » Thu Apr 04, 2013 14:14

I am trying to catch a warning that results from data = Orange.data.table(filename) where the corresponding file is not a properly formatted tab file (for example, the second row containing continuous and discrete designations is omitted.)

The standard output displays:

KernelWarning: 'TabDelimExampleGenerator' ... is being loaded as a .tab, but looks more like a .txt file

I've tried several ways of catching the KernelWarning, but they all result in the message:

NameError: globalname 'KernelWarning' is not defined

Do I need an include statement specific to Orange? If not, any suggestions?

Thanks--Steve

Re: Catching KernelWarning

Postby sreastman » Thu Apr 04, 2013 20:25

I've found at least a partial answer to my question. This statement takes care of the problem:

from orange import KernelWarning

I still feel a little uneasy because it would be better to do this with Orange rather than orange.

Any more ideas on this?

Thanks --Steve

Re: Catching KernelWarning

Postby Ales » Thu Apr 04, 2013 21:20

sreastman wrote:I still feel a little uneasy because it would be better to do this with Orange rather than orange.

You can use
Code: Select all
from Orange.core import KernelWarning

Re: Catching KernelWarning

Postby sreastman » Fri Apr 05, 2013 18:01

Thanks Ales

That looks better and works just as well.

Steve


Return to Questions & Support



cron