{"action":"created","comment":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/comments/51267881","id":51267881,"diff_hunk":"@@ -248,6 +248,17 @@ class Atom\n         setAttentionValue(new_av);\n     }\n \n+    /** Change the Very-Long-Term Importance */\n+    void setVLTI(AttentionValue::vlti_t vltiValue)\n+    {","path":"opencog/atoms/base/Atom.h","position":15,"original_position":15,"commit_id":"275310276667bfea1bae026ca140f584516a05c4","original_commit_id":"00029e67e219cc863bf3331b63cdb1970524c1e9","user":{"login":"inflector","id":1048706,"avatar_url":"https://avatars.githubusercontent.com/u/1048706?v=3","gravatar_id":"","url":"https://api.github.com/users/inflector","html_url":"https://github.com/inflector","followers_url":"https://api.github.com/users/inflector/followers","following_url":"https://api.github.com/users/inflector/following{/other_user}","gists_url":"https://api.github.com/users/inflector/gists{/gist_id}","starred_url":"https://api.github.com/users/inflector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inflector/subscriptions","organizations_url":"https://api.github.com/users/inflector/orgs","repos_url":"https://api.github.com/users/inflector/repos","events_url":"https://api.github.com/users/inflector/events{/privacy}","received_events_url":"https://api.github.com/users/inflector/received_events","type":"User","site_admin":false},"body":"My read of the documentation said that `vlti` is a flag that means don't delete for any positive values. So it acts like a 'permanent atom' flag. However, I didn't check the EVAN code to verify that is what it does.\r\n\r\nThere is an increment and decrement that I implemented as well, and I'd expect that to be the normal interface to `vlti` for setting the flag.\r\n\r\nThe actual behavior of the existing Python interfaces was inconsistent and hard to describe. So in the spirit of simplifying and making it easier for new people to understand I changed some inconsistencies.\r\n\r\nA particularly confusing example I encountered when testing is setting with a dictionary like:\r\n```\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': 5}\r\n>>>atom.av\r\n{'sti': 10, 'lti': 5, 'vlti': True}\r\n```\r\nInternally, the code for setting from a dictionary called increment if the value for `vlti` was `> 0` it would do an increment and decrement for `< 0`. Then the code for retrieval was treating the value as if it was a boolean and ignoring all other values. So there was no way to find out what the actual value was. And you'd get wonderful behavior like:\r\n```\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': True}\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': True}\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': False}\r\n>>>atom.av\r\n{'sti': 10, 'lti': 5, 'vlti': True}\r\n```\r\nwhich is really confusing and looks like a bug.\r\n\r\nIt seems like you'd want to be able to restore prior states which is why I changed the new implementation to make it easier to understand what is going on and make it possible to restore states.  So now you can do:\r\n```\r\n>>> atom.av\r\n{'sti': 10, 'lti': 5, 'vlti': 2}\r\n>>>original_av = atom.av\r\n>>>\r\n>>>... do some work ...\r\n>>>\r\n>>>atom.av = original_av\r\n>>>atom.av\r\n{'sti': 10, 'lti': 5, 'vlti': 2}\r\n```\r\nand\r\n```\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': 1}\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': 1}\r\n>>>atom.av = {'st': 10, 'lti' 5, 'vlti': 0}\r\n>>>atom.av\r\n{'sti': 10, 'lti': 5, 'vlti': 0}\r\n```\r\nAlso, when debugging the code if you want to know why an atom is not being deleted, then it would help to know that the `vlti` value is actually `3` rather than just `True`.\r\n\r\nSo if we want to only support increment and decrement then we ought to disallow the setting of `av` with dictionaries, I think, as this usage implies a set of the value not an increment or decrement, and the previous behavior is non-intuitive.\r\n","created_at":"2016-01-29T14:47:11Z","updated_at":"2016-01-29T14:47:11Z","html_url":"https://github.com/opencog/atomspace/pull/608#discussion_r51267881","pull_request_url":"https://api.github.com/repos/opencog/atomspace/pulls/608","_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments/51267881"},"html":{"href":"https://github.com/opencog/atomspace/pull/608#discussion_r51267881"},"pull_request":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/608"}}},"pull_request":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/608","id":57600687,"html_url":"https://github.com/opencog/atomspace/pull/608","diff_url":"https://github.com/opencog/atomspace/pull/608.diff","patch_url":"https://github.com/opencog/atomspace/pull/608.patch","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/608","number":608,"state":"open","locked":false,"title":"Remove deprecated atomspace functions","user":{"login":"inflector","id":1048706,"avatar_url":"https://avatars.githubusercontent.com/u/1048706?v=3","gravatar_id":"","url":"https://api.github.com/users/inflector","html_url":"https://github.com/inflector","followers_url":"https://api.github.com/users/inflector/followers","following_url":"https://api.github.com/users/inflector/following{/other_user}","gists_url":"https://api.github.com/users/inflector/gists{/gist_id}","starred_url":"https://api.github.com/users/inflector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inflector/subscriptions","organizations_url":"https://api.github.com/users/inflector/orgs","repos_url":"https://api.github.com/users/inflector/repos","events_url":"https://api.github.com/users/inflector/events{/privacy}","received_events_url":"https://api.github.com/users/inflector/received_events","type":"User","site_admin":false},"body":"Removed quite a few deprecated AtomSpace functions and moved them to Atom.\r\nUpdated the tests to match.\r\n\r\nWill be removing atomspace.get_atoms_by_target_atom after this pull request is merged and I can update opencog/opencog to use the new atom.incoming_by_type in the few places where it is currently using.","created_at":"2016-01-29T03:04:58Z","updated_at":"2016-01-29T14:47:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"243d20d10776d4d14cf65c722b05aa55bd0c016b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opencog/atomspace/pulls/608/commits","review_comments_url":"https://api.github.com/repos/opencog/atomspace/pulls/608/comments","review_comment_url":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/608/comments","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/275310276667bfea1bae026ca140f584516a05c4","head":{"label":"inflector:remove-deprecated-atomspace-functions","ref":"remove-deprecated-atomspace-functions","sha":"275310276667bfea1bae026ca140f584516a05c4","user":{"login":"inflector","id":1048706,"avatar_url":"https://avatars.githubusercontent.com/u/1048706?v=3","gravatar_id":"","url":"https://api.github.com/users/inflector","html_url":"https://github.com/inflector","followers_url":"https://api.github.com/users/inflector/followers","following_url":"https://api.github.com/users/inflector/following{/other_user}","gists_url":"https://api.github.com/users/inflector/gists{/gist_id}","starred_url":"https://api.github.com/users/inflector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inflector/subscriptions","organizations_url":"https://api.github.com/users/inflector/orgs","repos_url":"https://api.github.com/users/inflector/repos","events_url":"https://api.github.com/users/inflector/events{/privacy}","received_events_url":"https://api.github.com/users/inflector/received_events","type":"User","site_admin":false},"repo":{"id":49911486,"name":"atomspace","full_name":"inflector/atomspace","owner":{"login":"inflector","id":1048706,"avatar_url":"https://avatars.githubusercontent.com/u/1048706?v=3","gravatar_id":"","url":"https://api.github.com/users/inflector","html_url":"https://github.com/inflector","followers_url":"https://api.github.com/users/inflector/followers","following_url":"https://api.github.com/users/inflector/following{/other_user}","gists_url":"https://api.github.com/users/inflector/gists{/gist_id}","starred_url":"https://api.github.com/users/inflector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inflector/subscriptions","organizations_url":"https://api.github.com/users/inflector/orgs","repos_url":"https://api.github.com/users/inflector/repos","events_url":"https://api.github.com/users/inflector/events{/privacy}","received_events_url":"https://api.github.com/users/inflector/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inflector/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":true,"url":"https://api.github.com/repos/inflector/atomspace","forks_url":"https://api.github.com/repos/inflector/atomspace/forks","keys_url":"https://api.github.com/repos/inflector/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inflector/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inflector/atomspace/teams","hooks_url":"https://api.github.com/repos/inflector/atomspace/hooks","issue_events_url":"https://api.github.com/repos/inflector/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/inflector/atomspace/events","assignees_url":"https://api.github.com/repos/inflector/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/inflector/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/inflector/atomspace/tags","blobs_url":"https://api.github.com/repos/inflector/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inflector/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inflector/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/inflector/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inflector/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/inflector/atomspace/languages","stargazers_url":"https://api.github.com/repos/inflector/atomspace/stargazers","contributors_url":"https://api.github.com/repos/inflector/atomspace/contributors","subscribers_url":"https://api.github.com/repos/inflector/atomspace/subscribers","subscription_url":"https://api.github.com/repos/inflector/atomspace/subscription","commits_url":"https://api.github.com/repos/inflector/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/inflector/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/inflector/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/inflector/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/inflector/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/inflector/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inflector/atomspace/merges","archive_url":"https://api.github.com/repos/inflector/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inflector/atomspace/downloads","issues_url":"https://api.github.com/repos/inflector/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/inflector/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/inflector/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/inflector/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inflector/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/inflector/atomspace/releases{/id}","deployments_url":"https://api.github.com/repos/inflector/atomspace/deployments","created_at":"2016-01-18T23:08:55Z","updated_at":"2016-01-18T23:09:00Z","pushed_at":"2016-01-29T14:22:29Z","git_url":"git://github.com/inflector/atomspace.git","ssh_url":"git@github.com:inflector/atomspace.git","clone_url":"https://github.com/inflector/atomspace.git","svn_url":"https://github.com/inflector/atomspace","homepage":"","size":142325,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"opencog:master","ref":"master","sha":"77fa0a98ec04dcf03526955ae8e633332ce8a9d2","user":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"repo":{"id":34678084,"name":"atomspace","full_name":"opencog/atomspace","owner":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencog/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":false,"url":"https://api.github.com/repos/opencog/atomspace","forks_url":"https://api.github.com/repos/opencog/atomspace/forks","keys_url":"https://api.github.com/repos/opencog/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencog/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencog/atomspace/teams","hooks_url":"https://api.github.com/repos/opencog/atomspace/hooks","issue_events_url":"https://api.github.com/repos/opencog/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/opencog/atomspace/events","assignees_url":"https://api.github.com/repos/opencog/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/opencog/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/opencog/atomspace/tags","blobs_url":"https://api.github.com/repos/opencog/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencog/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencog/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencog/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/opencog/atomspace/languages","stargazers_url":"https://api.github.com/repos/opencog/atomspace/stargazers","contributors_url":"https://api.github.com/repos/opencog/atomspace/contributors","subscribers_url":"https://api.github.com/repos/opencog/atomspace/subscribers","subscription_url":"https://api.github.com/repos/opencog/atomspace/subscription","commits_url":"https://api.github.com/repos/opencog/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencog/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencog/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencog/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencog/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/opencog/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencog/atomspace/merges","archive_url":"https://api.github.com/repos/opencog/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencog/atomspace/downloads","issues_url":"https://api.github.com/repos/opencog/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/opencog/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/opencog/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/opencog/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencog/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/opencog/atomspace/releases{/id}","deployments_url":"https://api.github.com/repos/opencog/atomspace/deployments","created_at":"2015-04-27T16:32:57Z","updated_at":"2016-01-11T03:17:22Z","pushed_at":"2016-01-29T14:22:29Z","git_url":"git://github.com/opencog/atomspace.git","ssh_url":"git@github.com:opencog/atomspace.git","clone_url":"https://github.com/opencog/atomspace.git","svn_url":"https://github.com/opencog/atomspace","homepage":"","size":149517,"stargazers_count":38,"watchers_count":38,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":30,"forks":47,"open_issues":30,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/608"},"html":{"href":"https://github.com/opencog/atomspace/pull/608"},"issue":{"href":"https://api.github.com/repos/opencog/atomspace/issues/608"},"comments":{"href":"https://api.github.com/repos/opencog/atomspace/issues/608/comments"},"review_comments":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/608/comments"},"review_comment":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/608/commits"},"statuses":{"href":"https://api.github.com/repos/opencog/atomspace/statuses/275310276667bfea1bae026ca140f584516a05c4"}}}}