{"action":"created","comment":{"url":"https://api.github.com/repos/biolab/orange3/pulls/comments/89677540","pull_request_review_id":10220273,"id":89677540,"diff_hunk":"@@ -223,6 +232,20 @@ def send_report(self):\n     def setup_layout(self):\n         self.add_learner_name_widget()\n         self.add_main_layout()\n+        # Options specific to target variable type, if supported\n+        if self.__handles_any_input_type():\n+            # Only add a classification section if the method is overridden\n+            if type(self).add_classification_layout is not \\\n+                    OWBaseLearner.add_classification_layout:","path":"Orange/widgets/utils/owlearnerwidget.py","position":102,"original_position":102,"commit_id":"4af0ffae4fee91e3913e91db162585c11ef4d835","original_commit_id":"4af0ffae4fee91e3913e91db162585c11ef4d835","user":{"login":"janezd","id":2387315,"avatar_url":"https://avatars.githubusercontent.com/u/2387315?v=3","gravatar_id":"","url":"https://api.github.com/users/janezd","html_url":"https://github.com/janezd","followers_url":"https://api.github.com/users/janezd/followers","following_url":"https://api.github.com/users/janezd/following{/other_user}","gists_url":"https://api.github.com/users/janezd/gists{/gist_id}","starred_url":"https://api.github.com/users/janezd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janezd/subscriptions","organizations_url":"https://api.github.com/users/janezd/orgs","repos_url":"https://api.github.com/users/janezd/repos","events_url":"https://api.github.com/users/janezd/events{/privacy}","received_events_url":"https://api.github.com/users/janezd/received_events","type":"User","site_admin":false},"body":"@astaric, we're seeing more and more of this checking whether a class has overrides an inherited method. (Not that it's nice, but it's useful.) Is it time to implement something like\r\n```\r\ndef overrides(method, base):\r\n    return getattr(type(method.__self__), method.__name__) != getattr(base, method.__name__)\r\n```\r\nto be used like (here above) `if overrides(self.add_classification_layout, OWBaseLearner)`?","created_at":"2016-11-26T20:28:18Z","updated_at":"2016-11-26T20:28:18Z","html_url":"https://github.com/biolab/orange3/pull/1657#discussion_r89677540","pull_request_url":"https://api.github.com/repos/biolab/orange3/pulls/1657","_links":{"self":{"href":"https://api.github.com/repos/biolab/orange3/pulls/comments/89677540"},"html":{"href":"https://github.com/biolab/orange3/pull/1657#discussion_r89677540"},"pull_request":{"href":"https://api.github.com/repos/biolab/orange3/pulls/1657"}}},"pull_request":{"url":"https://api.github.com/repos/biolab/orange3/pulls/1657","id":89029115,"html_url":"https://github.com/biolab/orange3/pull/1657","diff_url":"https://github.com/biolab/orange3/pull/1657.diff","patch_url":"https://github.com/biolab/orange3/pull/1657.patch","issue_url":"https://api.github.com/repos/biolab/orange3/issues/1657","number":1657,"state":"open","locked":false,"title":"[WIP] Merge learner widgets","user":{"login":"pavlin-policar","id":5758119,"avatar_url":"https://avatars.githubusercontent.com/u/5758119?v=3","gravatar_id":"","url":"https://api.github.com/users/pavlin-policar","html_url":"https://github.com/pavlin-policar","followers_url":"https://api.github.com/users/pavlin-policar/followers","following_url":"https://api.github.com/users/pavlin-policar/following{/other_user}","gists_url":"https://api.github.com/users/pavlin-policar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlin-policar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlin-policar/subscriptions","organizations_url":"https://api.github.com/users/pavlin-policar/orgs","repos_url":"https://api.github.com/users/pavlin-policar/repos","events_url":"https://api.github.com/users/pavlin-policar/events{/privacy}","received_events_url":"https://api.github.com/users/pavlin-policar/received_events","type":"User","site_admin":false},"body":"A much simpler approach to handling data with continuous or discrete target variables inside learner widgets.\n\nThe `BaseLearner` now defines a `problem_type` context setting that tells us whether the data represents a classification or regression problem. This setting can be manually set with radio buttons if there is no data (this is required to work properly with the Test&Score widget). If there is data on the input, we disable the radio buttons and assign the appropriate type. The radio buttons are completely opt-in and can be enabled with a flag on the widget, so widgets that only handle one kind of target variable don't have to deal with any extra logic.\n\nEach individual learner can then override the `on_type_change` method, where they can do whatever updates they need to the UI or anything else.\n\nI've made the modifications necessary for this approach to work to the `TreeLearner` widget. Please let me know if this is an okay approach and if I should continue this route and port the other widgets to something like this.\n","created_at":"2016-10-12T14:42:38Z","updated_at":"2016-11-26T20:28:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d2398b0dc476a93a36e6b6a0df2892f864a14fb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/biolab/orange3/pulls/1657/commits","review_comments_url":"https://api.github.com/repos/biolab/orange3/pulls/1657/comments","review_comment_url":"https://api.github.com/repos/biolab/orange3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biolab/orange3/issues/1657/comments","statuses_url":"https://api.github.com/repos/biolab/orange3/statuses/4af0ffae4fee91e3913e91db162585c11ef4d835","head":{"label":"pavlin-policar:merge-learners","ref":"merge-learners","sha":"4af0ffae4fee91e3913e91db162585c11ef4d835","user":{"login":"pavlin-policar","id":5758119,"avatar_url":"https://avatars.githubusercontent.com/u/5758119?v=3","gravatar_id":"","url":"https://api.github.com/users/pavlin-policar","html_url":"https://github.com/pavlin-policar","followers_url":"https://api.github.com/users/pavlin-policar/followers","following_url":"https://api.github.com/users/pavlin-policar/following{/other_user}","gists_url":"https://api.github.com/users/pavlin-policar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlin-policar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlin-policar/subscriptions","organizations_url":"https://api.github.com/users/pavlin-policar/orgs","repos_url":"https://api.github.com/users/pavlin-policar/repos","events_url":"https://api.github.com/users/pavlin-policar/events{/privacy}","received_events_url":"https://api.github.com/users/pavlin-policar/received_events","type":"User","site_admin":false},"repo":{"id":55218103,"name":"orange3","full_name":"pavlin-policar/orange3","owner":{"login":"pavlin-policar","id":5758119,"avatar_url":"https://avatars.githubusercontent.com/u/5758119?v=3","gravatar_id":"","url":"https://api.github.com/users/pavlin-policar","html_url":"https://github.com/pavlin-policar","followers_url":"https://api.github.com/users/pavlin-policar/followers","following_url":"https://api.github.com/users/pavlin-policar/following{/other_user}","gists_url":"https://api.github.com/users/pavlin-policar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavlin-policar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavlin-policar/subscriptions","organizations_url":"https://api.github.com/users/pavlin-policar/orgs","repos_url":"https://api.github.com/users/pavlin-policar/repos","events_url":"https://api.github.com/users/pavlin-policar/events{/privacy}","received_events_url":"https://api.github.com/users/pavlin-policar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pavlin-policar/orange3","description":"Orange 3 data mining suite: http://orange.biolab.si ","fork":true,"url":"https://api.github.com/repos/pavlin-policar/orange3","forks_url":"https://api.github.com/repos/pavlin-policar/orange3/forks","keys_url":"https://api.github.com/repos/pavlin-policar/orange3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pavlin-policar/orange3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pavlin-policar/orange3/teams","hooks_url":"https://api.github.com/repos/pavlin-policar/orange3/hooks","issue_events_url":"https://api.github.com/repos/pavlin-policar/orange3/issues/events{/number}","events_url":"https://api.github.com/repos/pavlin-policar/orange3/events","assignees_url":"https://api.github.com/repos/pavlin-policar/orange3/assignees{/user}","branches_url":"https://api.github.com/repos/pavlin-policar/orange3/branches{/branch}","tags_url":"https://api.github.com/repos/pavlin-policar/orange3/tags","blobs_url":"https://api.github.com/repos/pavlin-policar/orange3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pavlin-policar/orange3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pavlin-policar/orange3/git/refs{/sha}","trees_url":"https://api.github.com/repos/pavlin-policar/orange3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pavlin-policar/orange3/statuses/{sha}","languages_url":"https://api.github.com/repos/pavlin-policar/orange3/languages","stargazers_url":"https://api.github.com/repos/pavlin-policar/orange3/stargazers","contributors_url":"https://api.github.com/repos/pavlin-policar/orange3/contributors","subscribers_url":"https://api.github.com/repos/pavlin-policar/orange3/subscribers","subscription_url":"https://api.github.com/repos/pavlin-policar/orange3/subscription","commits_url":"https://api.github.com/repos/pavlin-policar/orange3/commits{/sha}","git_commits_url":"https://api.github.com/repos/pavlin-policar/orange3/git/commits{/sha}","comments_url":"https://api.github.com/repos/pavlin-policar/orange3/comments{/number}","issue_comment_url":"https://api.github.com/repos/pavlin-policar/orange3/issues/comments{/number}","contents_url":"https://api.github.com/repos/pavlin-policar/orange3/contents/{+path}","compare_url":"https://api.github.com/repos/pavlin-policar/orange3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pavlin-policar/orange3/merges","archive_url":"https://api.github.com/repos/pavlin-policar/orange3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pavlin-policar/orange3/downloads","issues_url":"https://api.github.com/repos/pavlin-policar/orange3/issues{/number}","pulls_url":"https://api.github.com/repos/pavlin-policar/orange3/pulls{/number}","milestones_url":"https://api.github.com/repos/pavlin-policar/orange3/milestones{/number}","notifications_url":"https://api.github.com/repos/pavlin-policar/orange3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pavlin-policar/orange3/labels{/name}","releases_url":"https://api.github.com/repos/pavlin-policar/orange3/releases{/id}","deployments_url":"https://api.github.com/repos/pavlin-policar/orange3/deployments","created_at":"2016-04-01T08:58:41Z","updated_at":"2016-04-01T08:58:44Z","pushed_at":"2016-11-25T18:45:03Z","git_url":"git://github.com/pavlin-policar/orange3.git","ssh_url":"git@github.com:pavlin-policar/orange3.git","clone_url":"https://github.com/pavlin-policar/orange3.git","svn_url":"https://github.com/pavlin-policar/orange3","homepage":"","size":55605,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"biolab:master","ref":"master","sha":"f5dc821598fac545ec006f43b7317af81bfbe90a","user":{"login":"biolab","id":555189,"avatar_url":"https://avatars.githubusercontent.com/u/555189?v=3","gravatar_id":"","url":"https://api.github.com/users/biolab","html_url":"https://github.com/biolab","followers_url":"https://api.github.com/users/biolab/followers","following_url":"https://api.github.com/users/biolab/following{/other_user}","gists_url":"https://api.github.com/users/biolab/gists{/gist_id}","starred_url":"https://api.github.com/users/biolab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biolab/subscriptions","organizations_url":"https://api.github.com/users/biolab/orgs","repos_url":"https://api.github.com/users/biolab/repos","events_url":"https://api.github.com/users/biolab/events{/privacy}","received_events_url":"https://api.github.com/users/biolab/received_events","type":"Organization","site_admin":false},"repo":{"id":8357227,"name":"orange3","full_name":"biolab/orange3","owner":{"login":"biolab","id":555189,"avatar_url":"https://avatars.githubusercontent.com/u/555189?v=3","gravatar_id":"","url":"https://api.github.com/users/biolab","html_url":"https://github.com/biolab","followers_url":"https://api.github.com/users/biolab/followers","following_url":"https://api.github.com/users/biolab/following{/other_user}","gists_url":"https://api.github.com/users/biolab/gists{/gist_id}","starred_url":"https://api.github.com/users/biolab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biolab/subscriptions","organizations_url":"https://api.github.com/users/biolab/orgs","repos_url":"https://api.github.com/users/biolab/repos","events_url":"https://api.github.com/users/biolab/events{/privacy}","received_events_url":"https://api.github.com/users/biolab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biolab/orange3","description":"Orange 3 data mining suite: http://orange.biolab.si ","fork":false,"url":"https://api.github.com/repos/biolab/orange3","forks_url":"https://api.github.com/repos/biolab/orange3/forks","keys_url":"https://api.github.com/repos/biolab/orange3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biolab/orange3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biolab/orange3/teams","hooks_url":"https://api.github.com/repos/biolab/orange3/hooks","issue_events_url":"https://api.github.com/repos/biolab/orange3/issues/events{/number}","events_url":"https://api.github.com/repos/biolab/orange3/events","assignees_url":"https://api.github.com/repos/biolab/orange3/assignees{/user}","branches_url":"https://api.github.com/repos/biolab/orange3/branches{/branch}","tags_url":"https://api.github.com/repos/biolab/orange3/tags","blobs_url":"https://api.github.com/repos/biolab/orange3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biolab/orange3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biolab/orange3/git/refs{/sha}","trees_url":"https://api.github.com/repos/biolab/orange3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biolab/orange3/statuses/{sha}","languages_url":"https://api.github.com/repos/biolab/orange3/languages","stargazers_url":"https://api.github.com/repos/biolab/orange3/stargazers","contributors_url":"https://api.github.com/repos/biolab/orange3/contributors","subscribers_url":"https://api.github.com/repos/biolab/orange3/subscribers","subscription_url":"https://api.github.com/repos/biolab/orange3/subscription","commits_url":"https://api.github.com/repos/biolab/orange3/commits{/sha}","git_commits_url":"https://api.github.com/repos/biolab/orange3/git/commits{/sha}","comments_url":"https://api.github.com/repos/biolab/orange3/comments{/number}","issue_comment_url":"https://api.github.com/repos/biolab/orange3/issues/comments{/number}","contents_url":"https://api.github.com/repos/biolab/orange3/contents/{+path}","compare_url":"https://api.github.com/repos/biolab/orange3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biolab/orange3/merges","archive_url":"https://api.github.com/repos/biolab/orange3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biolab/orange3/downloads","issues_url":"https://api.github.com/repos/biolab/orange3/issues{/number}","pulls_url":"https://api.github.com/repos/biolab/orange3/pulls{/number}","milestones_url":"https://api.github.com/repos/biolab/orange3/milestones{/number}","notifications_url":"https://api.github.com/repos/biolab/orange3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biolab/orange3/labels{/name}","releases_url":"https://api.github.com/repos/biolab/orange3/releases{/id}","deployments_url":"https://api.github.com/repos/biolab/orange3/deployments","created_at":"2013-02-22T12:52:56Z","updated_at":"2016-11-26T05:34:57Z","pushed_at":"2016-11-26T18:22:35Z","git_url":"git://github.com/biolab/orange3.git","ssh_url":"git@github.com:biolab/orange3.git","clone_url":"https://github.com/biolab/orange3.git","svn_url":"https://github.com/biolab/orange3","homepage":"","size":97398,"stargazers_count":557,"watchers_count":557,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":77,"forks":181,"open_issues":77,"watchers":557,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biolab/orange3/pulls/1657"},"html":{"href":"https://github.com/biolab/orange3/pull/1657"},"issue":{"href":"https://api.github.com/repos/biolab/orange3/issues/1657"},"comments":{"href":"https://api.github.com/repos/biolab/orange3/issues/1657/comments"},"review_comments":{"href":"https://api.github.com/repos/biolab/orange3/pulls/1657/comments"},"review_comment":{"href":"https://api.github.com/repos/biolab/orange3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biolab/orange3/pulls/1657/commits"},"statuses":{"href":"https://api.github.com/repos/biolab/orange3/statuses/4af0ffae4fee91e3913e91db162585c11ef4d835"}}}}
{"actor":{"display_login":"janezd"}}