{"action":"opened","number":191,"pull_request":{"url":"https://api.github.com/repos/tBuLi/symfit/pulls/191","id":224953778,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0OTUzNzc4","html_url":"https://github.com/tBuLi/symfit/pull/191","diff_url":"https://github.com/tBuLi/symfit/pull/191.diff","patch_url":"https://github.com/tBuLi/symfit/pull/191.patch","issue_url":"https://api.github.com/repos/tBuLi/symfit/issues/191","number":191,"state":"open","locked":false,"title":"Pickle minimizers and objectives","user":{"login":"tBuLi","id":2188968,"node_id":"MDQ6VXNlcjIxODg5Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/2188968?v=4","gravatar_id":"","url":"https://api.github.com/users/tBuLi","html_url":"https://github.com/tBuLi","followers_url":"https://api.github.com/users/tBuLi/followers","following_url":"https://api.github.com/users/tBuLi/following{/other_user}","gists_url":"https://api.github.com/users/tBuLi/gists{/gist_id}","starred_url":"https://api.github.com/users/tBuLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tBuLi/subscriptions","organizations_url":"https://api.github.com/users/tBuLi/orgs","repos_url":"https://api.github.com/users/tBuLi/repos","events_url":"https://api.github.com/users/tBuLi/events{/privacy}","received_events_url":"https://api.github.com/users/tBuLi/received_events","type":"User","site_admin":false},"body":"Adds picklability to Minimizers, and tests for objectives. (They seem to be picklable out of the box.)\r\n\r\nThe rational behind the choices in this PR is as follows:\r\n- A simple implementation of `__getstate__`/`__setstate__` is not sufficient, because in `__init__` we often do decorating or partialing of functions, which cannot be pickled because such function definitions are not at the module level.\r\n- We would therefore like to go through `__init__`, but `__reduce__` is not good enough because it does not support keyword arguments, and we are a big fan of keyword-only arguments here at symfit.\r\n- The only pythonic way is then to implement `__getnewargs_ex__`, which calls `__new__` with support for keyword-only.\r\n- Then `__init__` can be called by `__setstate__`, to make sure all decorating is performed.\r\n\r\nStricly speaking, I think we could do away with `__getnewargs_ex__` if we implement something similar manually, which means the dummy `__new__` methods could be removed from the objects. But this way ties in nicely with the pickle standard, so I think this way is preferred to coming up with our own lightweight solution which might become problematic in the future.","created_at":"2018-10-23T09:02:40Z","updated_at":"2018-10-23T09:02:40Z","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/tBuLi/symfit/pulls/191/commits","review_comments_url":"https://api.github.com/repos/tBuLi/symfit/pulls/191/comments","review_comment_url":"https://api.github.com/repos/tBuLi/symfit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tBuLi/symfit/issues/191/comments","statuses_url":"https://api.github.com/repos/tBuLi/symfit/statuses/d30e2ba9192e20d88dfa45ece0bd2cad291e42d2","head":{"label":"tBuLi:pickle_minimize_objective","ref":"pickle_minimize_objective","sha":"d30e2ba9192e20d88dfa45ece0bd2cad291e42d2","user":{"login":"tBuLi","id":2188968,"node_id":"MDQ6VXNlcjIxODg5Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/2188968?v=4","gravatar_id":"","url":"https://api.github.com/users/tBuLi","html_url":"https://github.com/tBuLi","followers_url":"https://api.github.com/users/tBuLi/followers","following_url":"https://api.github.com/users/tBuLi/following{/other_user}","gists_url":"https://api.github.com/users/tBuLi/gists{/gist_id}","starred_url":"https://api.github.com/users/tBuLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tBuLi/subscriptions","organizations_url":"https://api.github.com/users/tBuLi/orgs","repos_url":"https://api.github.com/users/tBuLi/repos","events_url":"https://api.github.com/users/tBuLi/events{/privacy}","received_events_url":"https://api.github.com/users/tBuLi/received_events","type":"User","site_admin":false},"repo":{"id":24005390,"node_id":"MDEwOlJlcG9zaXRvcnkyNDAwNTM5MA==","name":"symfit","full_name":"tBuLi/symfit","private":false,"owner":{"login":"tBuLi","id":2188968,"node_id":"MDQ6VXNlcjIxODg5Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/2188968?v=4","gravatar_id":"","url":"https://api.github.com/users/tBuLi","html_url":"https://github.com/tBuLi","followers_url":"https://api.github.com/users/tBuLi/followers","following_url":"https://api.github.com/users/tBuLi/following{/other_user}","gists_url":"https://api.github.com/users/tBuLi/gists{/gist_id}","starred_url":"https://api.github.com/users/tBuLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tBuLi/subscriptions","organizations_url":"https://api.github.com/users/tBuLi/orgs","repos_url":"https://api.github.com/users/tBuLi/repos","events_url":"https://api.github.com/users/tBuLi/events{/privacy}","received_events_url":"https://api.github.com/users/tBuLi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tBuLi/symfit","description":"Symbolic Fitting; fitting as it should be.","fork":false,"url":"https://api.github.com/repos/tBuLi/symfit","forks_url":"https://api.github.com/repos/tBuLi/symfit/forks","keys_url":"https://api.github.com/repos/tBuLi/symfit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tBuLi/symfit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tBuLi/symfit/teams","hooks_url":"https://api.github.com/repos/tBuLi/symfit/hooks","issue_events_url":"https://api.github.com/repos/tBuLi/symfit/issues/events{/number}","events_url":"https://api.github.com/repos/tBuLi/symfit/events","assignees_url":"https://api.github.com/repos/tBuLi/symfit/assignees{/user}","branches_url":"https://api.github.com/repos/tBuLi/symfit/branches{/branch}","tags_url":"https://api.github.com/repos/tBuLi/symfit/tags","blobs_url":"https://api.github.com/repos/tBuLi/symfit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tBuLi/symfit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tBuLi/symfit/git/refs{/sha}","trees_url":"https://api.github.com/repos/tBuLi/symfit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tBuLi/symfit/statuses/{sha}","languages_url":"https://api.github.com/repos/tBuLi/symfit/languages","stargazers_url":"https://api.github.com/repos/tBuLi/symfit/stargazers","contributors_url":"https://api.github.com/repos/tBuLi/symfit/contributors","subscribers_url":"https://api.github.com/repos/tBuLi/symfit/subscribers","subscription_url":"https://api.github.com/repos/tBuLi/symfit/subscription","commits_url":"https://api.github.com/repos/tBuLi/symfit/commits{/sha}","git_commits_url":"https://api.github.com/repos/tBuLi/symfit/git/commits{/sha}","comments_url":"https://api.github.com/repos/tBuLi/symfit/comments{/number}","issue_comment_url":"https://api.github.com/repos/tBuLi/symfit/issues/comments{/number}","contents_url":"https://api.github.com/repos/tBuLi/symfit/contents/{+path}","compare_url":"https://api.github.com/repos/tBuLi/symfit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tBuLi/symfit/merges","archive_url":"https://api.github.com/repos/tBuLi/symfit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tBuLi/symfit/downloads","issues_url":"https://api.github.com/repos/tBuLi/symfit/issues{/number}","pulls_url":"https://api.github.com/repos/tBuLi/symfit/pulls{/number}","milestones_url":"https://api.github.com/repos/tBuLi/symfit/milestones{/number}","notifications_url":"https://api.github.com/repos/tBuLi/symfit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tBuLi/symfit/labels{/name}","releases_url":"https://api.github.com/repos/tBuLi/symfit/releases{/id}","deployments_url":"https://api.github.com/repos/tBuLi/symfit/deployments","created_at":"2014-09-13T20:48:28Z","updated_at":"2018-10-14T15:05:51Z","pushed_at":"2018-10-23T08:49:27Z","git_url":"git://github.com/tBuLi/symfit.git","ssh_url":"git@github.com:tBuLi/symfit.git","clone_url":"https://github.com/tBuLi/symfit.git","svn_url":"https://github.com/tBuLi/symfit","homepage":"http://symfit.readthedocs.org","size":2398,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":8,"open_issues":36,"watchers":25,"default_branch":"master"}},"base":{"label":"tBuLi:master","ref":"master","sha":"43b77e26892089a3571d6693e7105c6fe3128712","user":{"login":"tBuLi","id":2188968,"node_id":"MDQ6VXNlcjIxODg5Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/2188968?v=4","gravatar_id":"","url":"https://api.github.com/users/tBuLi","html_url":"https://github.com/tBuLi","followers_url":"https://api.github.com/users/tBuLi/followers","following_url":"https://api.github.com/users/tBuLi/following{/other_user}","gists_url":"https://api.github.com/users/tBuLi/gists{/gist_id}","starred_url":"https://api.github.com/users/tBuLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tBuLi/subscriptions","organizations_url":"https://api.github.com/users/tBuLi/orgs","repos_url":"https://api.github.com/users/tBuLi/repos","events_url":"https://api.github.com/users/tBuLi/events{/privacy}","received_events_url":"https://api.github.com/users/tBuLi/received_events","type":"User","site_admin":false},"repo":{"id":24005390,"node_id":"MDEwOlJlcG9zaXRvcnkyNDAwNTM5MA==","name":"symfit","full_name":"tBuLi/symfit","private":false,"owner":{"login":"tBuLi","id":2188968,"node_id":"MDQ6VXNlcjIxODg5Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/2188968?v=4","gravatar_id":"","url":"https://api.github.com/users/tBuLi","html_url":"https://github.com/tBuLi","followers_url":"https://api.github.com/users/tBuLi/followers","following_url":"https://api.github.com/users/tBuLi/following{/other_user}","gists_url":"https://api.github.com/users/tBuLi/gists{/gist_id}","starred_url":"https://api.github.com/users/tBuLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tBuLi/subscriptions","organizations_url":"https://api.github.com/users/tBuLi/orgs","repos_url":"https://api.github.com/users/tBuLi/repos","events_url":"https://api.github.com/users/tBuLi/events{/privacy}","received_events_url":"https://api.github.com/users/tBuLi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tBuLi/symfit","description":"Symbolic Fitting; fitting as it should be.","fork":false,"url":"https://api.github.com/repos/tBuLi/symfit","forks_url":"https://api.github.com/repos/tBuLi/symfit/forks","keys_url":"https://api.github.com/repos/tBuLi/symfit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tBuLi/symfit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tBuLi/symfit/teams","hooks_url":"https://api.github.com/repos/tBuLi/symfit/hooks","issue_events_url":"https://api.github.com/repos/tBuLi/symfit/issues/events{/number}","events_url":"https://api.github.com/repos/tBuLi/symfit/events","assignees_url":"https://api.github.com/repos/tBuLi/symfit/assignees{/user}","branches_url":"https://api.github.com/repos/tBuLi/symfit/branches{/branch}","tags_url":"https://api.github.com/repos/tBuLi/symfit/tags","blobs_url":"https://api.github.com/repos/tBuLi/symfit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tBuLi/symfit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tBuLi/symfit/git/refs{/sha}","trees_url":"https://api.github.com/repos/tBuLi/symfit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tBuLi/symfit/statuses/{sha}","languages_url":"https://api.github.com/repos/tBuLi/symfit/languages","stargazers_url":"https://api.github.com/repos/tBuLi/symfit/stargazers","contributors_url":"https://api.github.com/repos/tBuLi/symfit/contributors","subscribers_url":"https://api.github.com/repos/tBuLi/symfit/subscribers","subscription_url":"https://api.github.com/repos/tBuLi/symfit/subscription","commits_url":"https://api.github.com/repos/tBuLi/symfit/commits{/sha}","git_commits_url":"https://api.github.com/repos/tBuLi/symfit/git/commits{/sha}","comments_url":"https://api.github.com/repos/tBuLi/symfit/comments{/number}","issue_comment_url":"https://api.github.com/repos/tBuLi/symfit/issues/comments{/number}","contents_url":"https://api.github.com/repos/tBuLi/symfit/contents/{+path}","compare_url":"https://api.github.com/repos/tBuLi/symfit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tBuLi/symfit/merges","archive_url":"https://api.github.com/repos/tBuLi/symfit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tBuLi/symfit/downloads","issues_url":"https://api.github.com/repos/tBuLi/symfit/issues{/number}","pulls_url":"https://api.github.com/repos/tBuLi/symfit/pulls{/number}","milestones_url":"https://api.github.com/repos/tBuLi/symfit/milestones{/number}","notifications_url":"https://api.github.com/repos/tBuLi/symfit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tBuLi/symfit/labels{/name}","releases_url":"https://api.github.com/repos/tBuLi/symfit/releases{/id}","deployments_url":"https://api.github.com/repos/tBuLi/symfit/deployments","created_at":"2014-09-13T20:48:28Z","updated_at":"2018-10-14T15:05:51Z","pushed_at":"2018-10-23T08:49:27Z","git_url":"git://github.com/tBuLi/symfit.git","ssh_url":"git@github.com:tBuLi/symfit.git","clone_url":"https://github.com/tBuLi/symfit.git","svn_url":"https://github.com/tBuLi/symfit","homepage":"http://symfit.readthedocs.org","size":2398,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":8,"open_issues":36,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tBuLi/symfit/pulls/191"},"html":{"href":"https://github.com/tBuLi/symfit/pull/191"},"issue":{"href":"https://api.github.com/repos/tBuLi/symfit/issues/191"},"comments":{"href":"https://api.github.com/repos/tBuLi/symfit/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/tBuLi/symfit/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/tBuLi/symfit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tBuLi/symfit/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/tBuLi/symfit/statuses/d30e2ba9192e20d88dfa45ece0bd2cad291e42d2"}},"author_association":"OWNER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":4,"additions":303,"deletions":8,"changed_files":6}}
{"actor":{"display_login":"tBuLi"}}