{"action":"created","issue":{"url":"https://api.github.com/repos/CCI-Tools/cate-core/issues/151","repository_url":"https://api.github.com/repos/CCI-Tools/cate-core","labels_url":"https://api.github.com/repos/CCI-Tools/cate-core/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/CCI-Tools/cate-core/issues/151/comments","events_url":"https://api.github.com/repos/CCI-Tools/cate-core/issues/151/events","html_url":"https://github.com/CCI-Tools/cate-core/pull/151","id":213326571,"number":151,"title":"46 type validation","user":{"login":"JanisGailis","id":9655353,"avatar_url":"https://avatars3.githubusercontent.com/u/9655353?v=3","gravatar_id":"","url":"https://api.github.com/users/JanisGailis","html_url":"https://github.com/JanisGailis","followers_url":"https://api.github.com/users/JanisGailis/followers","following_url":"https://api.github.com/users/JanisGailis/following{/other_user}","gists_url":"https://api.github.com/users/JanisGailis/gists{/gist_id}","starred_url":"https://api.github.com/users/JanisGailis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanisGailis/subscriptions","organizations_url":"https://api.github.com/users/JanisGailis/orgs","repos_url":"https://api.github.com/users/JanisGailis/repos","events_url":"https://api.github.com/users/JanisGailis/events{/privacy}","received_events_url":"https://api.github.com/users/JanisGailis/received_events","type":"User","site_admin":false},"labels":[{"id":445223336,"url":"https://api.github.com/repos/CCI-Tools/cate-core/labels/api","name":"api","color":"fbca04","default":false},{"id":397909556,"url":"https://api.github.com/repos/CCI-Tools/cate-core/labels/cli","name":"cli","color":"fbca04","default":false},{"id":397909655,"url":"https://api.github.com/repos/CCI-Tools/cate-core/labels/gui","name":"gui","color":"fbca04","default":false},{"id":459291330,"url":"https://api.github.com/repos/CCI-Tools/cate-core/labels/ops","name":"ops","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":{"login":"forman","id":206773,"avatar_url":"https://avatars0.githubusercontent.com/u/206773?v=3","gravatar_id":"","url":"https://api.github.com/users/forman","html_url":"https://github.com/forman","followers_url":"https://api.github.com/users/forman/followers","following_url":"https://api.github.com/users/forman/following{/other_user}","gists_url":"https://api.github.com/users/forman/gists{/gist_id}","starred_url":"https://api.github.com/users/forman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forman/subscriptions","organizations_url":"https://api.github.com/users/forman/orgs","repos_url":"https://api.github.com/users/forman/repos","events_url":"https://api.github.com/users/forman/events{/privacy}","received_events_url":"https://api.github.com/users/forman/received_events","type":"User","site_admin":false},"assignees":[{"login":"forman","id":206773,"avatar_url":"https://avatars0.githubusercontent.com/u/206773?v=3","gravatar_id":"","url":"https://api.github.com/users/forman","html_url":"https://github.com/forman","followers_url":"https://api.github.com/users/forman/followers","following_url":"https://api.github.com/users/forman/following{/other_user}","gists_url":"https://api.github.com/users/forman/gists{/gist_id}","starred_url":"https://api.github.com/users/forman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forman/subscriptions","organizations_url":"https://api.github.com/users/forman/orgs","repos_url":"https://api.github.com/users/forman/repos","events_url":"https://api.github.com/users/forman/events{/privacy}","received_events_url":"https://api.github.com/users/forman/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/CCI-Tools/cate-core/milestones/4","html_url":"https://github.com/CCI-Tools/cate-core/milestone/4","labels_url":"https://api.github.com/repos/CCI-Tools/cate-core/milestones/4/labels","id":2297110,"number":4,"title":"IPM4","description":"","creator":{"login":"forman","id":206773,"avatar_url":"https://avatars0.githubusercontent.com/u/206773?v=3","gravatar_id":"","url":"https://api.github.com/users/forman","html_url":"https://github.com/forman","followers_url":"https://api.github.com/users/forman/followers","following_url":"https://api.github.com/users/forman/following{/other_user}","gists_url":"https://api.github.com/users/forman/gists{/gist_id}","starred_url":"https://api.github.com/users/forman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forman/subscriptions","organizations_url":"https://api.github.com/users/forman/orgs","repos_url":"https://api.github.com/users/forman/repos","events_url":"https://api.github.com/users/forman/events{/privacy}","received_events_url":"https://api.github.com/users/forman/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":17,"state":"open","created_at":"2017-02-03T09:28:50Z","updated_at":"2017-03-10T12:18:10Z","due_on":"2017-03-16T07:00:00Z","closed_at":null},"comments":2,"created_at":"2017-03-10T12:18:10Z","updated_at":"2017-03-10T13:50:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CCI-Tools/cate-core/pulls/151","html_url":"https://github.com/CCI-Tools/cate-core/pull/151","diff_url":"https://github.com/CCI-Tools/cate-core/pull/151.diff","patch_url":"https://github.com/CCI-Tools/cate-core/pull/151.patch"},"body":"Fixes issue #46 \r\n\r\nGoes a long way towards resolving #130 and #72 \r\n\r\nThe main idea is an added core module types.py that lets us define complex types, as well as some auxiliary methods for working with these, such as validation routines, resolving routines, or anything else we might want to have. Then the types can be used as:\r\n```python\r\nfrom op.core.types import TYPE, TYPE_ALIAS, is_type, to_op_object\r\n\r\n@op\r\n@op_input('name1', data_type=TYPE)\r\ndef some_op(name1: TYPE_ALIAS):\r\n   # Get the 'default' object (a List, a Shapely shape, a Pandas Dataframe)\r\n   name1 = to_op_object(name1, TYPE) \r\n   # Do something\r\n   pass\r\n```\r\nor more generally:\r\n```python\r\ndef some_method(name1: TYPE_ALIAS):\r\n    # Use instead of isinstance()\r\n    is_type(name1, TYPE)\r\n    # Do something useful\r\n    pass\r\n```\r\n\r\nI haven't paid too much attention to code architecture, so everything is in a single file, without exported imports to core. This is because I'd like to have your opinion on where this should go and how this would fit in the overall architecture. Should it go into util, core, separate 'types' folder under cate?. Should the abstract interface class be split out and left in core, while the defintions of particular types go to the 'types' folder, as with 'ds')?\r\n\r\nAny comments welcome!"},"comment":{"url":"https://api.github.com/repos/CCI-Tools/cate-core/issues/comments/285673353","html_url":"https://github.com/CCI-Tools/cate-core/pull/151#issuecomment-285673353","issue_url":"https://api.github.com/repos/CCI-Tools/cate-core/issues/151","id":285673353,"user":{"login":"JanisGailis","id":9655353,"avatar_url":"https://avatars3.githubusercontent.com/u/9655353?v=3","gravatar_id":"","url":"https://api.github.com/users/JanisGailis","html_url":"https://github.com/JanisGailis","followers_url":"https://api.github.com/users/JanisGailis/followers","following_url":"https://api.github.com/users/JanisGailis/following{/other_user}","gists_url":"https://api.github.com/users/JanisGailis/gists{/gist_id}","starred_url":"https://api.github.com/users/JanisGailis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanisGailis/subscriptions","organizations_url":"https://api.github.com/users/JanisGailis/orgs","repos_url":"https://api.github.com/users/JanisGailis/repos","events_url":"https://api.github.com/users/JanisGailis/events{/privacy}","received_events_url":"https://api.github.com/users/JanisGailis/received_events","type":"User","site_admin":false},"created_at":"2017-03-10T13:50:40Z","updated_at":"2017-03-10T13:50:40Z","body":"Yay!"}}
{"actor":{"display_login":"JanisGailis"}}