{"action":"opened","number":14949,"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/14949","id":202897182,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyODk3MTgy","html_url":"https://github.com/sympy/sympy/pull/14949","diff_url":"https://github.com/sympy/sympy/pull/14949.diff","patch_url":"https://github.com/sympy/sympy/pull/14949.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/14949","number":14949,"state":"open","locked":false,"title":"Clean up Theano printer, add comments and docstrings","user":{"login":"jlumpe","id":7455396,"node_id":"MDQ6VXNlcjc0NTUzOTY=","avatar_url":"https://avatars0.githubusercontent.com/u/7455396?v=4","gravatar_id":"","url":"https://api.github.com/users/jlumpe","html_url":"https://github.com/jlumpe","followers_url":"https://api.github.com/users/jlumpe/followers","following_url":"https://api.github.com/users/jlumpe/following{/other_user}","gists_url":"https://api.github.com/users/jlumpe/gists{/gist_id}","starred_url":"https://api.github.com/users/jlumpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlumpe/subscriptions","organizations_url":"https://api.github.com/users/jlumpe/orgs","repos_url":"https://api.github.com/users/jlumpe/repos","events_url":"https://api.github.com/users/jlumpe/events{/privacy}","received_events_url":"https://api.github.com/users/jlumpe/received_events","type":"User","site_admin":false},"body":"### Overview\r\n\r\nMade the following changes to the Theano code printer:\r\n\r\n* Added docstrings to major parts of user API with detailed information on parameters\r\n* Unified some of the code for caching Theano variables which the printer has created for Sympy symbols.\r\n* General cleanup of code\r\n\r\n### Remaining issues\r\n\r\n* The `dim_handling` function only serves to process arguments to `theano_function()`, but seems to be part of the public API. I think this function should be deprecated and the functionality moved to `TheanoPrinter.doprint()` so that it is available through all parts of the public API.\r\n* I have changed the API for `theano_function()` in a way that breaks backward compatibility. The previous implementation always took a list of output expressions, and if the list had only one element the printed value was de-nested before being passed to `theano.function()`. The new API I think is more consistent, which always has sequence in --> sequence out behavior, and to get a function which gives scalar output you pass a single output expression instead of a list of length one. I could possibly add an additional keyword argument to enable the new behavior and print a deprecation warning if the old functionality is used.\r\n* The current logic behind caching Theano variables created for Sympy symbols is opaque to the user. The key incorporates the requested data type, so different Theano variables may be created for the same symbol in different calls to `TheanoPrinter.doprint()` if the user gives that data type the first time but not the 2nd. I have started trying to make this process more transparent with a defined contract with the user.\r\n* The user should be able to associate existing Theano variables (created by themselves or by another library) with Sympy symbols. This was my original motivation for working on this and I am planning on submitting it as a follow-up PR.","created_at":"2018-07-20T16:24:08Z","updated_at":"2018-07-20T16:24:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/14949/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/14949/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/14949/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/5f2151206dbfdafae681647a7eb062924d7b3152","head":{"label":"jlumpe:theano-printer-fixes","ref":"theano-printer-fixes","sha":"5f2151206dbfdafae681647a7eb062924d7b3152","user":{"login":"jlumpe","id":7455396,"node_id":"MDQ6VXNlcjc0NTUzOTY=","avatar_url":"https://avatars0.githubusercontent.com/u/7455396?v=4","gravatar_id":"","url":"https://api.github.com/users/jlumpe","html_url":"https://github.com/jlumpe","followers_url":"https://api.github.com/users/jlumpe/followers","following_url":"https://api.github.com/users/jlumpe/following{/other_user}","gists_url":"https://api.github.com/users/jlumpe/gists{/gist_id}","starred_url":"https://api.github.com/users/jlumpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlumpe/subscriptions","organizations_url":"https://api.github.com/users/jlumpe/orgs","repos_url":"https://api.github.com/users/jlumpe/repos","events_url":"https://api.github.com/users/jlumpe/events{/privacy}","received_events_url":"https://api.github.com/users/jlumpe/received_events","type":"User","site_admin":false},"repo":{"id":136275962,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyNzU5NjI=","name":"sympy","full_name":"jlumpe/sympy","owner":{"login":"jlumpe","id":7455396,"node_id":"MDQ6VXNlcjc0NTUzOTY=","avatar_url":"https://avatars0.githubusercontent.com/u/7455396?v=4","gravatar_id":"","url":"https://api.github.com/users/jlumpe","html_url":"https://github.com/jlumpe","followers_url":"https://api.github.com/users/jlumpe/followers","following_url":"https://api.github.com/users/jlumpe/following{/other_user}","gists_url":"https://api.github.com/users/jlumpe/gists{/gist_id}","starred_url":"https://api.github.com/users/jlumpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlumpe/subscriptions","organizations_url":"https://api.github.com/users/jlumpe/orgs","repos_url":"https://api.github.com/users/jlumpe/repos","events_url":"https://api.github.com/users/jlumpe/events{/privacy}","received_events_url":"https://api.github.com/users/jlumpe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlumpe/sympy","description":"A computer algebra system written in pure Python","fork":true,"url":"https://api.github.com/repos/jlumpe/sympy","forks_url":"https://api.github.com/repos/jlumpe/sympy/forks","keys_url":"https://api.github.com/repos/jlumpe/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlumpe/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlumpe/sympy/teams","hooks_url":"https://api.github.com/repos/jlumpe/sympy/hooks","issue_events_url":"https://api.github.com/repos/jlumpe/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/jlumpe/sympy/events","assignees_url":"https://api.github.com/repos/jlumpe/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/jlumpe/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/jlumpe/sympy/tags","blobs_url":"https://api.github.com/repos/jlumpe/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlumpe/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlumpe/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlumpe/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlumpe/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/jlumpe/sympy/languages","stargazers_url":"https://api.github.com/repos/jlumpe/sympy/stargazers","contributors_url":"https://api.github.com/repos/jlumpe/sympy/contributors","subscribers_url":"https://api.github.com/repos/jlumpe/sympy/subscribers","subscription_url":"https://api.github.com/repos/jlumpe/sympy/subscription","commits_url":"https://api.github.com/repos/jlumpe/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlumpe/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlumpe/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlumpe/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlumpe/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/jlumpe/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlumpe/sympy/merges","archive_url":"https://api.github.com/repos/jlumpe/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlumpe/sympy/downloads","issues_url":"https://api.github.com/repos/jlumpe/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/jlumpe/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/jlumpe/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/jlumpe/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlumpe/sympy/labels{/name}","releases_url":"https://api.github.com/repos/jlumpe/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/jlumpe/sympy/deployments","created_at":"2018-06-06T05:24:00Z","updated_at":"2018-07-18T22:44:44Z","pushed_at":"2018-07-20T16:05:26Z","git_url":"git://github.com/jlumpe/sympy.git","ssh_url":"git@github.com:jlumpe/sympy.git","clone_url":"https://github.com/jlumpe/sympy.git","svn_url":"https://github.com/jlumpe/sympy","homepage":"http://sympy.org/","size":92074,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sympy:master","ref":"master","sha":"cc9009cc51a9ea337303426ef1cafd92e8deb10e","user":{"login":"sympy","id":260832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MDgzMg==","avatar_url":"https://avatars1.githubusercontent.com/u/260832?v=4","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"repo":{"id":640534,"node_id":"MDEwOlJlcG9zaXRvcnk2NDA1MzQ=","name":"sympy","full_name":"sympy/sympy","owner":{"login":"sympy","id":260832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MDgzMg==","avatar_url":"https://avatars1.githubusercontent.com/u/260832?v=4","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sympy/sympy","description":"A computer algebra system written in pure Python","fork":false,"url":"https://api.github.com/repos/sympy/sympy","forks_url":"https://api.github.com/repos/sympy/sympy/forks","keys_url":"https://api.github.com/repos/sympy/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sympy/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sympy/sympy/teams","hooks_url":"https://api.github.com/repos/sympy/sympy/hooks","issue_events_url":"https://api.github.com/repos/sympy/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/sympy/sympy/events","assignees_url":"https://api.github.com/repos/sympy/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/sympy/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/sympy/sympy/tags","blobs_url":"https://api.github.com/repos/sympy/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sympy/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sympy/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sympy/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/sympy/sympy/languages","stargazers_url":"https://api.github.com/repos/sympy/sympy/stargazers","contributors_url":"https://api.github.com/repos/sympy/sympy/contributors","subscribers_url":"https://api.github.com/repos/sympy/sympy/subscribers","subscription_url":"https://api.github.com/repos/sympy/sympy/subscription","commits_url":"https://api.github.com/repos/sympy/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sympy/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sympy/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sympy/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sympy/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/sympy/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sympy/sympy/merges","archive_url":"https://api.github.com/repos/sympy/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sympy/sympy/downloads","issues_url":"https://api.github.com/repos/sympy/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/sympy/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/sympy/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/sympy/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sympy/sympy/labels{/name}","releases_url":"https://api.github.com/repos/sympy/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/sympy/sympy/deployments","created_at":"2010-04-30T20:37:14Z","updated_at":"2018-07-20T14:54:02Z","pushed_at":"2018-07-20T15:57:54Z","git_url":"git://github.com/sympy/sympy.git","ssh_url":"git@github.com:sympy/sympy.git","clone_url":"https://github.com/sympy/sympy.git","svn_url":"https://github.com/sympy/sympy","homepage":"http://sympy.org/","size":92041,"stargazers_count":4954,"watchers_count":4954,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2307,"mirror_url":null,"archived":false,"open_issues_count":3386,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2307,"open_issues":3386,"watchers":4954,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14949"},"html":{"href":"https://github.com/sympy/sympy/pull/14949"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/14949"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/14949/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14949/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/14949/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/5f2151206dbfdafae681647a7eb062924d7b3152"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":339,"deletions":79,"changed_files":2}}
{"actor":{"display_login":"jlumpe"}}