{"action":"opened","number":35,"pull_request":{"url":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/35","id":32771468,"html_url":"https://github.com/gem/oq-svir-qgis/pull/35","diff_url":"https://github.com/gem/oq-svir-qgis/pull/35.diff","patch_url":"https://github.com/gem/oq-svir-qgis/pull/35.patch","issue_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues/35","number":35,"state":"open","locked":false,"title":"Decouple the concept of 'variable inversion' from the weight's sign","user":{"login":"ptormene","id":350930,"avatar_url":"https://avatars.githubusercontent.com/u/350930?v=3","gravatar_id":"","url":"https://api.github.com/users/ptormene","html_url":"https://github.com/ptormene","followers_url":"https://api.github.com/users/ptormene/followers","following_url":"https://api.github.com/users/ptormene/following{/other_user}","gists_url":"https://api.github.com/users/ptormene/gists{/gist_id}","starred_url":"https://api.github.com/users/ptormene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptormene/subscriptions","organizations_url":"https://api.github.com/users/ptormene/orgs","repos_url":"https://api.github.com/users/ptormene/repos","events_url":"https://api.github.com/users/ptormene/events{/privacy}","received_events_url":"https://api.github.com/users/ptormene/received_events","type":"User","site_admin":false},"body":"Before this PR, we were using a hack, saving the 'invert variable' checkbox value into the variable's weight, by multiplying the weight by -1 in case of inversion, instead of saving the information as a separate variable. Such simplified implementation worked in most cases, but there was an annoying corner case. When using an operator that ignored weights, but still willing to 'invert' a variable, we were retrieving the sign of the weight, ignoring its absolute value. But unfortunately the sign was lost in case weight=0, because the effect of clicking the 'invert' checkbox was to multiply 0 by -1, obtaining -0, which resulted as 0.\r\nThis PR removes the hack, decoupling completely the concepts of 'weight' and 'inversion'. Each node of the weighting tree has now an additional 'isInverted' boolean attribute. This implementation is a bit more complicated than before, but it's logically cleaner and less confusing.","created_at":"2015-04-07T14:53:13Z","updated_at":"2015-04-07T14:53:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/35/commits","review_comments_url":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/35/comments","review_comment_url":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues/35/comments","statuses_url":"https://api.github.com/repos/gem/oq-svir-qgis/statuses/a38b6e0d945bd3eb6aed47749b0e49fa3d2b5585","head":{"label":"gem:separate-invert-from-weight","ref":"separate-invert-from-weight","sha":"a38b6e0d945bd3eb6aed47749b0e49fa3d2b5585","user":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"repo":{"id":29854750,"name":"oq-svir-qgis","full_name":"gem/oq-svir-qgis","owner":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gem/oq-svir-qgis","description":"QGIS plugin for social vulnerability and integrated risk","fork":false,"url":"https://api.github.com/repos/gem/oq-svir-qgis","forks_url":"https://api.github.com/repos/gem/oq-svir-qgis/forks","keys_url":"https://api.github.com/repos/gem/oq-svir-qgis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gem/oq-svir-qgis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gem/oq-svir-qgis/teams","hooks_url":"https://api.github.com/repos/gem/oq-svir-qgis/hooks","issue_events_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues/events{/number}","events_url":"https://api.github.com/repos/gem/oq-svir-qgis/events","assignees_url":"https://api.github.com/repos/gem/oq-svir-qgis/assignees{/user}","branches_url":"https://api.github.com/repos/gem/oq-svir-qgis/branches{/branch}","tags_url":"https://api.github.com/repos/gem/oq-svir-qgis/tags","blobs_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/refs{/sha}","trees_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gem/oq-svir-qgis/statuses/{sha}","languages_url":"https://api.github.com/repos/gem/oq-svir-qgis/languages","stargazers_url":"https://api.github.com/repos/gem/oq-svir-qgis/stargazers","contributors_url":"https://api.github.com/repos/gem/oq-svir-qgis/contributors","subscribers_url":"https://api.github.com/repos/gem/oq-svir-qgis/subscribers","subscription_url":"https://api.github.com/repos/gem/oq-svir-qgis/subscription","commits_url":"https://api.github.com/repos/gem/oq-svir-qgis/commits{/sha}","git_commits_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/commits{/sha}","comments_url":"https://api.github.com/repos/gem/oq-svir-qgis/comments{/number}","issue_comment_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues/comments{/number}","contents_url":"https://api.github.com/repos/gem/oq-svir-qgis/contents/{+path}","compare_url":"https://api.github.com/repos/gem/oq-svir-qgis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gem/oq-svir-qgis/merges","archive_url":"https://api.github.com/repos/gem/oq-svir-qgis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gem/oq-svir-qgis/downloads","issues_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues{/number}","pulls_url":"https://api.github.com/repos/gem/oq-svir-qgis/pulls{/number}","milestones_url":"https://api.github.com/repos/gem/oq-svir-qgis/milestones{/number}","notifications_url":"https://api.github.com/repos/gem/oq-svir-qgis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gem/oq-svir-qgis/labels{/name}","releases_url":"https://api.github.com/repos/gem/oq-svir-qgis/releases{/id}","created_at":"2015-01-26T09:47:44Z","updated_at":"2015-04-07T09:33:12Z","pushed_at":"2015-04-07T14:35:58Z","git_url":"git://github.com/gem/oq-svir-qgis.git","ssh_url":"git@github.com:gem/oq-svir-qgis.git","clone_url":"https://github.com/gem/oq-svir-qgis.git","svn_url":"https://github.com/gem/oq-svir-qgis","homepage":null,"size":6588,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"gem:master","ref":"master","sha":"a518fbf8882d200ae2075e54817c70e88020e471","user":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"repo":{"id":29854750,"name":"oq-svir-qgis","full_name":"gem/oq-svir-qgis","owner":{"login":"gem","id":316546,"avatar_url":"https://avatars.githubusercontent.com/u/316546?v=3","gravatar_id":"","url":"https://api.github.com/users/gem","html_url":"https://github.com/gem","followers_url":"https://api.github.com/users/gem/followers","following_url":"https://api.github.com/users/gem/following{/other_user}","gists_url":"https://api.github.com/users/gem/gists{/gist_id}","starred_url":"https://api.github.com/users/gem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gem/subscriptions","organizations_url":"https://api.github.com/users/gem/orgs","repos_url":"https://api.github.com/users/gem/repos","events_url":"https://api.github.com/users/gem/events{/privacy}","received_events_url":"https://api.github.com/users/gem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gem/oq-svir-qgis","description":"QGIS plugin for social vulnerability and integrated risk","fork":false,"url":"https://api.github.com/repos/gem/oq-svir-qgis","forks_url":"https://api.github.com/repos/gem/oq-svir-qgis/forks","keys_url":"https://api.github.com/repos/gem/oq-svir-qgis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gem/oq-svir-qgis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gem/oq-svir-qgis/teams","hooks_url":"https://api.github.com/repos/gem/oq-svir-qgis/hooks","issue_events_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues/events{/number}","events_url":"https://api.github.com/repos/gem/oq-svir-qgis/events","assignees_url":"https://api.github.com/repos/gem/oq-svir-qgis/assignees{/user}","branches_url":"https://api.github.com/repos/gem/oq-svir-qgis/branches{/branch}","tags_url":"https://api.github.com/repos/gem/oq-svir-qgis/tags","blobs_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/refs{/sha}","trees_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gem/oq-svir-qgis/statuses/{sha}","languages_url":"https://api.github.com/repos/gem/oq-svir-qgis/languages","stargazers_url":"https://api.github.com/repos/gem/oq-svir-qgis/stargazers","contributors_url":"https://api.github.com/repos/gem/oq-svir-qgis/contributors","subscribers_url":"https://api.github.com/repos/gem/oq-svir-qgis/subscribers","subscription_url":"https://api.github.com/repos/gem/oq-svir-qgis/subscription","commits_url":"https://api.github.com/repos/gem/oq-svir-qgis/commits{/sha}","git_commits_url":"https://api.github.com/repos/gem/oq-svir-qgis/git/commits{/sha}","comments_url":"https://api.github.com/repos/gem/oq-svir-qgis/comments{/number}","issue_comment_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues/comments{/number}","contents_url":"https://api.github.com/repos/gem/oq-svir-qgis/contents/{+path}","compare_url":"https://api.github.com/repos/gem/oq-svir-qgis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gem/oq-svir-qgis/merges","archive_url":"https://api.github.com/repos/gem/oq-svir-qgis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gem/oq-svir-qgis/downloads","issues_url":"https://api.github.com/repos/gem/oq-svir-qgis/issues{/number}","pulls_url":"https://api.github.com/repos/gem/oq-svir-qgis/pulls{/number}","milestones_url":"https://api.github.com/repos/gem/oq-svir-qgis/milestones{/number}","notifications_url":"https://api.github.com/repos/gem/oq-svir-qgis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gem/oq-svir-qgis/labels{/name}","releases_url":"https://api.github.com/repos/gem/oq-svir-qgis/releases{/id}","created_at":"2015-01-26T09:47:44Z","updated_at":"2015-04-07T09:33:12Z","pushed_at":"2015-04-07T14:35:58Z","git_url":"git://github.com/gem/oq-svir-qgis.git","ssh_url":"git@github.com:gem/oq-svir-qgis.git","clone_url":"https://github.com/gem/oq-svir-qgis.git","svn_url":"https://github.com/gem/oq-svir-qgis","homepage":null,"size":6588,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/35"},"html":{"href":"https://github.com/gem/oq-svir-qgis/pull/35"},"issue":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/issues/35"},"comments":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/gem/oq-svir-qgis/statuses/a38b6e0d945bd3eb6aed47749b0e49fa3d2b5585"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":600,"deletions":583,"changed_files":3}}