{"action":"closed","number":152,"pull_request":{"url":"https://api.github.com/repos/pysb/pysb/pulls/152","id":45454212,"html_url":"https://github.com/pysb/pysb/pull/152","diff_url":"https://github.com/pysb/pysb/pull/152.diff","patch_url":"https://github.com/pysb/pysb/pull/152.patch","issue_url":"https://api.github.com/repos/pysb/pysb/issues/152","number":152,"state":"closed","locked":false,"title":"Change stringification of Expressions to allow expressions with one Parameter (or Observable)","user":{"login":"johnbachman","id":432756,"avatar_url":"https://avatars.githubusercontent.com/u/432756?v=3","gravatar_id":"","url":"https://api.github.com/users/johnbachman","html_url":"https://github.com/johnbachman","followers_url":"https://api.github.com/users/johnbachman/followers","following_url":"https://api.github.com/users/johnbachman/following{/other_user}","gists_url":"https://api.github.com/users/johnbachman/gists{/gist_id}","starred_url":"https://api.github.com/users/johnbachman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnbachman/subscriptions","organizations_url":"https://api.github.com/users/johnbachman/orgs","repos_url":"https://api.github.com/users/johnbachman/repos","events_url":"https://api.github.com/users/johnbachman/events{/privacy}","received_events_url":"https://api.github.com/users/johnbachman/received_events","type":"User","site_admin":false},"body":"This fixes issue #151. The problem was that sympy_to_muparser in pysb.generator.bng was calling the str() function on Expression.expr directly, which works when the Expression is some kind of algebraic formula, but not when it's a single Parameter or Observable (because the Parameter/Observable's own repr method supersedes sympy.Symbol). To fix this I added a function that is explicitly for getting the string representation of the Expression formula.\r\n\r\nAdded two new tests to test_bng.py, which pass as a result of this patch.","created_at":"2015-09-18T21:21:59Z","updated_at":"2015-09-21T15:36:45Z","closed_at":"2015-09-21T15:36:45Z","merged_at":null,"merge_commit_sha":"6caf937ad4604604d7cc2f7acf7a4ea783e39a49","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pysb/pysb/pulls/152/commits","review_comments_url":"https://api.github.com/repos/pysb/pysb/pulls/152/comments","review_comment_url":"https://api.github.com/repos/pysb/pysb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pysb/pysb/issues/152/comments","statuses_url":"https://api.github.com/repos/pysb/pysb/statuses/f5d080368eed6c93941a822e33a2189aec0e5a27","head":{"label":"johnbachman:exprs_with_1param","ref":"exprs_with_1param","sha":"f5d080368eed6c93941a822e33a2189aec0e5a27","user":{"login":"johnbachman","id":432756,"avatar_url":"https://avatars.githubusercontent.com/u/432756?v=3","gravatar_id":"","url":"https://api.github.com/users/johnbachman","html_url":"https://github.com/johnbachman","followers_url":"https://api.github.com/users/johnbachman/followers","following_url":"https://api.github.com/users/johnbachman/following{/other_user}","gists_url":"https://api.github.com/users/johnbachman/gists{/gist_id}","starred_url":"https://api.github.com/users/johnbachman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnbachman/subscriptions","organizations_url":"https://api.github.com/users/johnbachman/orgs","repos_url":"https://api.github.com/users/johnbachman/repos","events_url":"https://api.github.com/users/johnbachman/events{/privacy}","received_events_url":"https://api.github.com/users/johnbachman/received_events","type":"User","site_admin":false},"repo":{"id":1666772,"name":"pysb","full_name":"johnbachman/pysb","owner":{"login":"johnbachman","id":432756,"avatar_url":"https://avatars.githubusercontent.com/u/432756?v=3","gravatar_id":"","url":"https://api.github.com/users/johnbachman","html_url":"https://github.com/johnbachman","followers_url":"https://api.github.com/users/johnbachman/followers","following_url":"https://api.github.com/users/johnbachman/following{/other_user}","gists_url":"https://api.github.com/users/johnbachman/gists{/gist_id}","starred_url":"https://api.github.com/users/johnbachman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnbachman/subscriptions","organizations_url":"https://api.github.com/users/johnbachman/orgs","repos_url":"https://api.github.com/users/johnbachman/repos","events_url":"https://api.github.com/users/johnbachman/events{/privacy}","received_events_url":"https://api.github.com/users/johnbachman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/johnbachman/pysb","description":"Python framework for Systems Biology modeling","fork":true,"url":"https://api.github.com/repos/johnbachman/pysb","forks_url":"https://api.github.com/repos/johnbachman/pysb/forks","keys_url":"https://api.github.com/repos/johnbachman/pysb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johnbachman/pysb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johnbachman/pysb/teams","hooks_url":"https://api.github.com/repos/johnbachman/pysb/hooks","issue_events_url":"https://api.github.com/repos/johnbachman/pysb/issues/events{/number}","events_url":"https://api.github.com/repos/johnbachman/pysb/events","assignees_url":"https://api.github.com/repos/johnbachman/pysb/assignees{/user}","branches_url":"https://api.github.com/repos/johnbachman/pysb/branches{/branch}","tags_url":"https://api.github.com/repos/johnbachman/pysb/tags","blobs_url":"https://api.github.com/repos/johnbachman/pysb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johnbachman/pysb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johnbachman/pysb/git/refs{/sha}","trees_url":"https://api.github.com/repos/johnbachman/pysb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johnbachman/pysb/statuses/{sha}","languages_url":"https://api.github.com/repos/johnbachman/pysb/languages","stargazers_url":"https://api.github.com/repos/johnbachman/pysb/stargazers","contributors_url":"https://api.github.com/repos/johnbachman/pysb/contributors","subscribers_url":"https://api.github.com/repos/johnbachman/pysb/subscribers","subscription_url":"https://api.github.com/repos/johnbachman/pysb/subscription","commits_url":"https://api.github.com/repos/johnbachman/pysb/commits{/sha}","git_commits_url":"https://api.github.com/repos/johnbachman/pysb/git/commits{/sha}","comments_url":"https://api.github.com/repos/johnbachman/pysb/comments{/number}","issue_comment_url":"https://api.github.com/repos/johnbachman/pysb/issues/comments{/number}","contents_url":"https://api.github.com/repos/johnbachman/pysb/contents/{+path}","compare_url":"https://api.github.com/repos/johnbachman/pysb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johnbachman/pysb/merges","archive_url":"https://api.github.com/repos/johnbachman/pysb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johnbachman/pysb/downloads","issues_url":"https://api.github.com/repos/johnbachman/pysb/issues{/number}","pulls_url":"https://api.github.com/repos/johnbachman/pysb/pulls{/number}","milestones_url":"https://api.github.com/repos/johnbachman/pysb/milestones{/number}","notifications_url":"https://api.github.com/repos/johnbachman/pysb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johnbachman/pysb/labels{/name}","releases_url":"https://api.github.com/repos/johnbachman/pysb/releases{/id}","created_at":"2011-04-26T19:18:30Z","updated_at":"2015-04-15T17:07:53Z","pushed_at":"2015-09-18T21:16:25Z","git_url":"git://github.com/johnbachman/pysb.git","ssh_url":"git@github.com:johnbachman/pysb.git","clone_url":"https://github.com/johnbachman/pysb.git","svn_url":"https://github.com/johnbachman/pysb","homepage":"","size":7123,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"pysb:master","ref":"master","sha":"8f9206b5841cee1a9db472007bb0f0c5d6615e15","user":{"login":"pysb","id":1583829,"avatar_url":"https://avatars.githubusercontent.com/u/1583829?v=3","gravatar_id":"","url":"https://api.github.com/users/pysb","html_url":"https://github.com/pysb","followers_url":"https://api.github.com/users/pysb/followers","following_url":"https://api.github.com/users/pysb/following{/other_user}","gists_url":"https://api.github.com/users/pysb/gists{/gist_id}","starred_url":"https://api.github.com/users/pysb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pysb/subscriptions","organizations_url":"https://api.github.com/users/pysb/orgs","repos_url":"https://api.github.com/users/pysb/repos","events_url":"https://api.github.com/users/pysb/events{/privacy}","received_events_url":"https://api.github.com/users/pysb/received_events","type":"Organization","site_admin":false},"repo":{"id":972691,"name":"pysb","full_name":"pysb/pysb","owner":{"login":"pysb","id":1583829,"avatar_url":"https://avatars.githubusercontent.com/u/1583829?v=3","gravatar_id":"","url":"https://api.github.com/users/pysb","html_url":"https://github.com/pysb","followers_url":"https://api.github.com/users/pysb/followers","following_url":"https://api.github.com/users/pysb/following{/other_user}","gists_url":"https://api.github.com/users/pysb/gists{/gist_id}","starred_url":"https://api.github.com/users/pysb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pysb/subscriptions","organizations_url":"https://api.github.com/users/pysb/orgs","repos_url":"https://api.github.com/users/pysb/repos","events_url":"https://api.github.com/users/pysb/events{/privacy}","received_events_url":"https://api.github.com/users/pysb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pysb/pysb","description":"Python framework for Systems Biology modeling","fork":false,"url":"https://api.github.com/repos/pysb/pysb","forks_url":"https://api.github.com/repos/pysb/pysb/forks","keys_url":"https://api.github.com/repos/pysb/pysb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pysb/pysb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pysb/pysb/teams","hooks_url":"https://api.github.com/repos/pysb/pysb/hooks","issue_events_url":"https://api.github.com/repos/pysb/pysb/issues/events{/number}","events_url":"https://api.github.com/repos/pysb/pysb/events","assignees_url":"https://api.github.com/repos/pysb/pysb/assignees{/user}","branches_url":"https://api.github.com/repos/pysb/pysb/branches{/branch}","tags_url":"https://api.github.com/repos/pysb/pysb/tags","blobs_url":"https://api.github.com/repos/pysb/pysb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pysb/pysb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pysb/pysb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pysb/pysb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pysb/pysb/statuses/{sha}","languages_url":"https://api.github.com/repos/pysb/pysb/languages","stargazers_url":"https://api.github.com/repos/pysb/pysb/stargazers","contributors_url":"https://api.github.com/repos/pysb/pysb/contributors","subscribers_url":"https://api.github.com/repos/pysb/pysb/subscribers","subscription_url":"https://api.github.com/repos/pysb/pysb/subscription","commits_url":"https://api.github.com/repos/pysb/pysb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pysb/pysb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pysb/pysb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pysb/pysb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pysb/pysb/contents/{+path}","compare_url":"https://api.github.com/repos/pysb/pysb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pysb/pysb/merges","archive_url":"https://api.github.com/repos/pysb/pysb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pysb/pysb/downloads","issues_url":"https://api.github.com/repos/pysb/pysb/issues{/number}","pulls_url":"https://api.github.com/repos/pysb/pysb/pulls{/number}","milestones_url":"https://api.github.com/repos/pysb/pysb/milestones{/number}","notifications_url":"https://api.github.com/repos/pysb/pysb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pysb/pysb/labels{/name}","releases_url":"https://api.github.com/repos/pysb/pysb/releases{/id}","created_at":"2010-10-08T16:51:11Z","updated_at":"2015-07-03T08:33:15Z","pushed_at":"2015-09-18T21:21:59Z","git_url":"git://github.com/pysb/pysb.git","ssh_url":"git@github.com:pysb/pysb.git","clone_url":"https://github.com/pysb/pysb.git","svn_url":"https://github.com/pysb/pysb","homepage":"","size":7397,"stargazers_count":23,"watchers_count":23,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":75,"forks":25,"open_issues":75,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pysb/pysb/pulls/152"},"html":{"href":"https://github.com/pysb/pysb/pull/152"},"issue":{"href":"https://api.github.com/repos/pysb/pysb/issues/152"},"comments":{"href":"https://api.github.com/repos/pysb/pysb/issues/152/comments"},"review_comments":{"href":"https://api.github.com/repos/pysb/pysb/pulls/152/comments"},"review_comment":{"href":"https://api.github.com/repos/pysb/pysb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pysb/pysb/pulls/152/commits"},"statuses":{"href":"https://api.github.com/repos/pysb/pysb/statuses/f5d080368eed6c93941a822e33a2189aec0e5a27"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":4,"additions":45,"deletions":11,"changed_files":3}}