Orange Forum • View topic - Help.... WIdget Development Tutorial: Channels and Tokens

Help.... WIdget Development Tutorial: Channels and Tokens

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

Help.... WIdget Development Tutorial: Channels and Tokens

Postby bricklemacho » Mon Oct 15, 2012 0:49

Firstly, good work on orange. I excited about developing own widgets.

I been going through the tutorial and the first tow worked as advertised. Single input, single output. Whe I try to build OWLearningCurveA.py from Multi-Input Channels chapter/section the widget fails when used on the canvas.

If I testing the widget outside orange canvas it works, get a nice summary window allowing me to compare various scores etc.

I have tested the multi-input widget on the following version and where appropriate as local user install and a system wide install.
  • the universal bundle for unadvanced user.
  • easy_install
  • hg clone


I am running on a Mac, running python 2.6, used MacPorts for install of supporting packages. I have downloaded and install c45. The specific error pasted below.

Any help would be appreciated,

Regard,

Brickle.
--


Unhandled exception of type AttributeError occured at 7:46:57:
Traceback:
File: orngView.py, line 343 in mouseReleaseEvent
Code: self.doc.addLine(start, end)
File: orngDoc.py, line 121 in addLine
Code: connectStatus = dialog.addDefaultLinks()
File: orngDlgs.py, line 356 in addDefaultLinks
Code: candidates = self.signalManager.proposePossibleLinks(self.outWidget.instance, self.inWidget.instance)
File: orngSignalManager.py, line 379 in proposePossibleLinks
Code: possibleLinks.append((outS, inS, weight(outS, inS)))
File: orngSignalManager.py, line 366 in weight
Code: if outS.explicit or inS.explicit:
AttributeError: 'InputSignal' object has no attribute 'explicit'

Re: Help.... WIdget Development Tutorial: Channels and Token

Postby bricklemacho » Mon Oct 15, 2012 8:32

I found a solution. In OWLearningCurve.py change

self.inputs = [("Data", ExampleTable, self.dataset), ("Learner", orange.Learner, self.learner, 0)]

to

self.inputs = [("Data", ExampleTable, self.dataset), ("Learner", orange.Learner, self.learner, Multiple + Default)]

So basically I changed the ''0" to Multiple + Default. I copied from a working widget which has multiple inputs. Not sure what it is actually doing but I can research that later. I will now continue with the tutorial.

Re: Help.... WIdget Development Tutorial: Channels and Token

Postby Ales » Mon Oct 15, 2012 11:55

The documented channel flags were deprecated some time ago but the documentation was not updated to reflect that. Furthermore, I recently broke the backwards compatibility.

I have pushed an fix for both the compatibility and the documentation to the main repository.
Run 'hg pull -u' and open Orange/doc/extend-widgets/default.htm to see the updated documentation (the documentation on the web page does not get updated immediately).

Re: Help.... WIdget Development Tutorial: Channels and Token

Postby bricklemacho » Sat Nov 03, 2012 1:53

Somehow missed this reply.

The tutorial was enough to get me started. What I have been doing is searching existing widgets for similar functionality and trying to learn/copy from them.

I like the duality of being able to script everything and provide a visual programming option. Easy way to keep my supervisor and project sponsors happy.

Thanks to everyone involved in Orange.


Return to Questions & Support