{"action":"closed","number":205,"pull_request":{"url":"https://api.github.com/repos/enthought/traits/pulls/205","id":22304588,"html_url":"https://github.com/enthought/traits/pull/205","diff_url":"https://github.com/enthought/traits/pull/205.diff","patch_url":"https://github.com/enthought/traits/pull/205.patch","issue_url":"https://api.github.com/repos/enthought/traits/issues/205","number":205,"state":"closed","locked":false,"title":"Feature/validated tuple","user":{"login":"itziakos","id":403930,"avatar_url":"https://avatars.githubusercontent.com/u/403930?v=3","gravatar_id":"","url":"https://api.github.com/users/itziakos","html_url":"https://github.com/itziakos","followers_url":"https://api.github.com/users/itziakos/followers","following_url":"https://api.github.com/users/itziakos/following{/other_user}","gists_url":"https://api.github.com/users/itziakos/gists{/gist_id}","starred_url":"https://api.github.com/users/itziakos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itziakos/subscriptions","organizations_url":"https://api.github.com/users/itziakos/orgs","repos_url":"https://api.github.com/users/itziakos/repos","events_url":"https://api.github.com/users/itziakos/events{/privacy}","received_events_url":"https://api.github.com/users/itziakos/received_events","type":"User","site_admin":false},"body":"This PR adds a new Tuple trait that supports custom validation for the field values in addition to the individual field validation.\r\n\r\n```python\r\n\r\n>>> from traits.api import Int, HasStrictTraits, ValidatedTuple\r\n>>> \r\n>>> class MyClass(HasStrictTraits):\r\n...     value_range = ValidatedTuple(Int(0), Int(1), validation=lambda x: x[0] < x[1])\r\n... \r\n>>>\r\n>>> a = MyClass()\r\n>>> a.value_range\r\n(0, 1)\r\n>>> a.value_range = (2, 1)\r\nTraceback (most recent call last):\r\n  File \"<interactive input>\", line 1, in <module>\r\n  File \"c:\\users\\itziakos\\projects\\meta-geophysics\\geocanopy\\geophysics\\util\\validated_tuple.py\", line 43, in validate\r\n    self.error(object, name, value)\r\n  File \"C:\\Users\\itziakos\\Projects\\traits\\traits\\trait_handlers.py\", line 172, in error\r\n    value )\r\nTraitError: The 'value_range' trait of a MyClass instance must be a tuple of the form: (an integer (int or long), an integer (int or long)) that passes custom validation, but a value of (2, 1) <type 'tuple'> was specified.\r\n>>> a.value_range = (1, 2)\r\n>>> a.value_range\r\n(1, 2)\r\n>>> \r\n```\r\n\r\n","created_at":"2014-10-06T18:41:59Z","updated_at":"2015-01-06T18:20:32Z","closed_at":"2015-01-06T18:20:32Z","merged_at":"2015-01-06T18:20:32Z","merge_commit_sha":"99a447069a8fc7568b63283a9cf3bb6637981919","assignee":{"login":"itziakos","id":403930,"avatar_url":"https://avatars.githubusercontent.com/u/403930?v=3","gravatar_id":"","url":"https://api.github.com/users/itziakos","html_url":"https://github.com/itziakos","followers_url":"https://api.github.com/users/itziakos/followers","following_url":"https://api.github.com/users/itziakos/following{/other_user}","gists_url":"https://api.github.com/users/itziakos/gists{/gist_id}","starred_url":"https://api.github.com/users/itziakos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itziakos/subscriptions","organizations_url":"https://api.github.com/users/itziakos/orgs","repos_url":"https://api.github.com/users/itziakos/repos","events_url":"https://api.github.com/users/itziakos/events{/privacy}","received_events_url":"https://api.github.com/users/itziakos/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/enthought/traits/pulls/205/commits","review_comments_url":"https://api.github.com/repos/enthought/traits/pulls/205/comments","review_comment_url":"https://api.github.com/repos/enthought/traits/pulls/comments/{number}","comments_url":"https://api.github.com/repos/enthought/traits/issues/205/comments","statuses_url":"https://api.github.com/repos/enthought/traits/statuses/ecef9ec240ed6a202706bc01d98b615ed0f55ade","head":{"label":"enthought:feature/validated-tuple","ref":"feature/validated-tuple","sha":"ecef9ec240ed6a202706bc01d98b615ed0f55ade","user":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"repo":{"id":1301745,"name":"traits","full_name":"enthought/traits","owner":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enthought/traits","description":"Optional type-checking, data dependencies, and event notifications for Python","fork":false,"url":"https://api.github.com/repos/enthought/traits","forks_url":"https://api.github.com/repos/enthought/traits/forks","keys_url":"https://api.github.com/repos/enthought/traits/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enthought/traits/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enthought/traits/teams","hooks_url":"https://api.github.com/repos/enthought/traits/hooks","issue_events_url":"https://api.github.com/repos/enthought/traits/issues/events{/number}","events_url":"https://api.github.com/repos/enthought/traits/events","assignees_url":"https://api.github.com/repos/enthought/traits/assignees{/user}","branches_url":"https://api.github.com/repos/enthought/traits/branches{/branch}","tags_url":"https://api.github.com/repos/enthought/traits/tags","blobs_url":"https://api.github.com/repos/enthought/traits/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enthought/traits/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enthought/traits/git/refs{/sha}","trees_url":"https://api.github.com/repos/enthought/traits/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enthought/traits/statuses/{sha}","languages_url":"https://api.github.com/repos/enthought/traits/languages","stargazers_url":"https://api.github.com/repos/enthought/traits/stargazers","contributors_url":"https://api.github.com/repos/enthought/traits/contributors","subscribers_url":"https://api.github.com/repos/enthought/traits/subscribers","subscription_url":"https://api.github.com/repos/enthought/traits/subscription","commits_url":"https://api.github.com/repos/enthought/traits/commits{/sha}","git_commits_url":"https://api.github.com/repos/enthought/traits/git/commits{/sha}","comments_url":"https://api.github.com/repos/enthought/traits/comments{/number}","issue_comment_url":"https://api.github.com/repos/enthought/traits/issues/comments/{number}","contents_url":"https://api.github.com/repos/enthought/traits/contents/{+path}","compare_url":"https://api.github.com/repos/enthought/traits/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enthought/traits/merges","archive_url":"https://api.github.com/repos/enthought/traits/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enthought/traits/downloads","issues_url":"https://api.github.com/repos/enthought/traits/issues{/number}","pulls_url":"https://api.github.com/repos/enthought/traits/pulls{/number}","milestones_url":"https://api.github.com/repos/enthought/traits/milestones{/number}","notifications_url":"https://api.github.com/repos/enthought/traits/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enthought/traits/labels{/name}","releases_url":"https://api.github.com/repos/enthought/traits/releases{/id}","created_at":"2011-01-28T04:46:40Z","updated_at":"2015-01-06T12:53:24Z","pushed_at":"2015-01-06T18:20:32Z","git_url":"git://github.com/enthought/traits.git","ssh_url":"git@github.com:enthought/traits.git","clone_url":"https://github.com/enthought/traits.git","svn_url":"https://github.com/enthought/traits","homepage":"","size":44854,"stargazers_count":109,"watchers_count":109,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":40,"mirror_url":null,"open_issues_count":59,"forks":40,"open_issues":59,"watchers":109,"default_branch":"master"}},"base":{"label":"enthought:master","ref":"master","sha":"87e0bab61819010df670edb80660200ae84706b3","user":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"repo":{"id":1301745,"name":"traits","full_name":"enthought/traits","owner":{"login":"enthought","id":539651,"avatar_url":"https://avatars.githubusercontent.com/u/539651?v=3","gravatar_id":"","url":"https://api.github.com/users/enthought","html_url":"https://github.com/enthought","followers_url":"https://api.github.com/users/enthought/followers","following_url":"https://api.github.com/users/enthought/following{/other_user}","gists_url":"https://api.github.com/users/enthought/gists{/gist_id}","starred_url":"https://api.github.com/users/enthought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enthought/subscriptions","organizations_url":"https://api.github.com/users/enthought/orgs","repos_url":"https://api.github.com/users/enthought/repos","events_url":"https://api.github.com/users/enthought/events{/privacy}","received_events_url":"https://api.github.com/users/enthought/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enthought/traits","description":"Optional type-checking, data dependencies, and event notifications for Python","fork":false,"url":"https://api.github.com/repos/enthought/traits","forks_url":"https://api.github.com/repos/enthought/traits/forks","keys_url":"https://api.github.com/repos/enthought/traits/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enthought/traits/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enthought/traits/teams","hooks_url":"https://api.github.com/repos/enthought/traits/hooks","issue_events_url":"https://api.github.com/repos/enthought/traits/issues/events{/number}","events_url":"https://api.github.com/repos/enthought/traits/events","assignees_url":"https://api.github.com/repos/enthought/traits/assignees{/user}","branches_url":"https://api.github.com/repos/enthought/traits/branches{/branch}","tags_url":"https://api.github.com/repos/enthought/traits/tags","blobs_url":"https://api.github.com/repos/enthought/traits/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enthought/traits/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enthought/traits/git/refs{/sha}","trees_url":"https://api.github.com/repos/enthought/traits/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enthought/traits/statuses/{sha}","languages_url":"https://api.github.com/repos/enthought/traits/languages","stargazers_url":"https://api.github.com/repos/enthought/traits/stargazers","contributors_url":"https://api.github.com/repos/enthought/traits/contributors","subscribers_url":"https://api.github.com/repos/enthought/traits/subscribers","subscription_url":"https://api.github.com/repos/enthought/traits/subscription","commits_url":"https://api.github.com/repos/enthought/traits/commits{/sha}","git_commits_url":"https://api.github.com/repos/enthought/traits/git/commits{/sha}","comments_url":"https://api.github.com/repos/enthought/traits/comments{/number}","issue_comment_url":"https://api.github.com/repos/enthought/traits/issues/comments/{number}","contents_url":"https://api.github.com/repos/enthought/traits/contents/{+path}","compare_url":"https://api.github.com/repos/enthought/traits/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enthought/traits/merges","archive_url":"https://api.github.com/repos/enthought/traits/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enthought/traits/downloads","issues_url":"https://api.github.com/repos/enthought/traits/issues{/number}","pulls_url":"https://api.github.com/repos/enthought/traits/pulls{/number}","milestones_url":"https://api.github.com/repos/enthought/traits/milestones{/number}","notifications_url":"https://api.github.com/repos/enthought/traits/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enthought/traits/labels{/name}","releases_url":"https://api.github.com/repos/enthought/traits/releases{/id}","created_at":"2011-01-28T04:46:40Z","updated_at":"2015-01-06T12:53:24Z","pushed_at":"2015-01-06T18:20:32Z","git_url":"git://github.com/enthought/traits.git","ssh_url":"git@github.com:enthought/traits.git","clone_url":"https://github.com/enthought/traits.git","svn_url":"https://github.com/enthought/traits","homepage":"","size":44854,"stargazers_count":109,"watchers_count":109,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":40,"mirror_url":null,"open_issues_count":59,"forks":40,"open_issues":59,"watchers":109,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enthought/traits/pulls/205"},"html":{"href":"https://github.com/enthought/traits/pull/205"},"issue":{"href":"https://api.github.com/repos/enthought/traits/issues/205"},"comments":{"href":"https://api.github.com/repos/enthought/traits/issues/205/comments"},"review_comments":{"href":"https://api.github.com/repos/enthought/traits/pulls/205/comments"},"review_comment":{"href":"https://api.github.com/repos/enthought/traits/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/enthought/traits/pulls/205/commits"},"statuses":{"href":"https://api.github.com/repos/enthought/traits/statuses/ecef9ec240ed6a202706bc01d98b615ed0f55ade"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mdickinson","id":662003,"avatar_url":"https://avatars.githubusercontent.com/u/662003?v=3","gravatar_id":"","url":"https://api.github.com/users/mdickinson","html_url":"https://github.com/mdickinson","followers_url":"https://api.github.com/users/mdickinson/followers","following_url":"https://api.github.com/users/mdickinson/following{/other_user}","gists_url":"https://api.github.com/users/mdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdickinson/subscriptions","organizations_url":"https://api.github.com/users/mdickinson/orgs","repos_url":"https://api.github.com/users/mdickinson/repos","events_url":"https://api.github.com/users/mdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/mdickinson/received_events","type":"User","site_admin":false},"comments":21,"review_comments":34,"commits":32,"additions":250,"deletions":94,"changed_files":8}}