{"action":"opened","number":321,"pull_request":{"url":"https://api.github.com/repos/joblib/joblib/pulls/321","id":63264059,"html_url":"https://github.com/joblib/joblib/pull/321","diff_url":"https://github.com/joblib/joblib/pull/321.diff","patch_url":"https://github.com/joblib/joblib/pull/321.patch","issue_url":"https://api.github.com/repos/joblib/joblib/issues/321","number":321,"state":"open","locked":false,"title":"[MRG] make it possible to pass n_jobs to parallel_backend context","user":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"body":"This is a refinement for the new `parallel_backend` context manager introduced in #306.\r\n\r\nThis makes it possible to override the default value of `n_jobs` used internally by library code using the context manager.\r\n\r\nNote in particular that `parallel_backend` uses `n_jobs=-1` by default meaning to use all the available workers of my registered backend. For instance the following will use all the `ipyparallel` backend and by default will use all the available worker without having the change all my code to pass `n_jobs=-1` everywhere. This is particularly useful when doing nested cross-validation of scikit-learn models, for instance by calling `cross_val_score` and `GridSearchCV` within one another:\r\n\r\n```python\r\nwith parallel_backend('ipyparallel'):\r\n    call_my_nested_cross_vall_parameter_search()\r\n```\r\n\r\nsimilarly, I am running the same code on a shared compute servers with 48 cores and I want to leave some compute power for other users working on the same machine I can globally set the number of process workers I want to use in my main script without having to :\r\n\r\n```python\r\nwith parallel_backend('multiprocessing', n_jobs=12):\r\n    call_my_nested_cross_vall_parameter_search()\r\n```","created_at":"2016-03-17T17:46:20Z","updated_at":"2016-03-17T17:46:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joblib/joblib/pulls/321/commits","review_comments_url":"https://api.github.com/repos/joblib/joblib/pulls/321/comments","review_comment_url":"https://api.github.com/repos/joblib/joblib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joblib/joblib/issues/321/comments","statuses_url":"https://api.github.com/repos/joblib/joblib/statuses/556506d5fb596ff328c03d9e5fddf74a33548811","head":{"label":"ogrisel:parallel-backend-n-jobs","ref":"parallel-backend-n-jobs","sha":"556506d5fb596ff328c03d9e5fddf74a33548811","user":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"repo":{"id":2454172,"name":"joblib","full_name":"ogrisel/joblib","owner":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ogrisel/joblib","description":"Python function as pipeline jobs. THIS IS NOT THE MAIN REPO! See https://github.com/joblib/joblib","fork":true,"url":"https://api.github.com/repos/ogrisel/joblib","forks_url":"https://api.github.com/repos/ogrisel/joblib/forks","keys_url":"https://api.github.com/repos/ogrisel/joblib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ogrisel/joblib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ogrisel/joblib/teams","hooks_url":"https://api.github.com/repos/ogrisel/joblib/hooks","issue_events_url":"https://api.github.com/repos/ogrisel/joblib/issues/events{/number}","events_url":"https://api.github.com/repos/ogrisel/joblib/events","assignees_url":"https://api.github.com/repos/ogrisel/joblib/assignees{/user}","branches_url":"https://api.github.com/repos/ogrisel/joblib/branches{/branch}","tags_url":"https://api.github.com/repos/ogrisel/joblib/tags","blobs_url":"https://api.github.com/repos/ogrisel/joblib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ogrisel/joblib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ogrisel/joblib/git/refs{/sha}","trees_url":"https://api.github.com/repos/ogrisel/joblib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ogrisel/joblib/statuses/{sha}","languages_url":"https://api.github.com/repos/ogrisel/joblib/languages","stargazers_url":"https://api.github.com/repos/ogrisel/joblib/stargazers","contributors_url":"https://api.github.com/repos/ogrisel/joblib/contributors","subscribers_url":"https://api.github.com/repos/ogrisel/joblib/subscribers","subscription_url":"https://api.github.com/repos/ogrisel/joblib/subscription","commits_url":"https://api.github.com/repos/ogrisel/joblib/commits{/sha}","git_commits_url":"https://api.github.com/repos/ogrisel/joblib/git/commits{/sha}","comments_url":"https://api.github.com/repos/ogrisel/joblib/comments{/number}","issue_comment_url":"https://api.github.com/repos/ogrisel/joblib/issues/comments{/number}","contents_url":"https://api.github.com/repos/ogrisel/joblib/contents/{+path}","compare_url":"https://api.github.com/repos/ogrisel/joblib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ogrisel/joblib/merges","archive_url":"https://api.github.com/repos/ogrisel/joblib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ogrisel/joblib/downloads","issues_url":"https://api.github.com/repos/ogrisel/joblib/issues{/number}","pulls_url":"https://api.github.com/repos/ogrisel/joblib/pulls{/number}","milestones_url":"https://api.github.com/repos/ogrisel/joblib/milestones{/number}","notifications_url":"https://api.github.com/repos/ogrisel/joblib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ogrisel/joblib/labels{/name}","releases_url":"https://api.github.com/repos/ogrisel/joblib/releases{/id}","deployments_url":"https://api.github.com/repos/ogrisel/joblib/deployments","created_at":"2011-09-25T10:31:19Z","updated_at":"2014-07-20T15:14:57Z","pushed_at":"2016-03-17T17:17:13Z","git_url":"git://github.com/ogrisel/joblib.git","ssh_url":"git@github.com:ogrisel/joblib.git","clone_url":"https://github.com/ogrisel/joblib.git","svn_url":"https://github.com/ogrisel/joblib","homepage":"http://packages.python.org/joblib/","size":2382,"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":"joblib:master","ref":"master","sha":"04b001861e1dd03a857b7b419c336de64e05714c","user":{"login":"joblib","id":332661,"avatar_url":"https://avatars.githubusercontent.com/u/332661?v=3","gravatar_id":"","url":"https://api.github.com/users/joblib","html_url":"https://github.com/joblib","followers_url":"https://api.github.com/users/joblib/followers","following_url":"https://api.github.com/users/joblib/following{/other_user}","gists_url":"https://api.github.com/users/joblib/gists{/gist_id}","starred_url":"https://api.github.com/users/joblib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joblib/subscriptions","organizations_url":"https://api.github.com/users/joblib/orgs","repos_url":"https://api.github.com/users/joblib/repos","events_url":"https://api.github.com/users/joblib/events{/privacy}","received_events_url":"https://api.github.com/users/joblib/received_events","type":"Organization","site_admin":false},"repo":{"id":654608,"name":"joblib","full_name":"joblib/joblib","owner":{"login":"joblib","id":332661,"avatar_url":"https://avatars.githubusercontent.com/u/332661?v=3","gravatar_id":"","url":"https://api.github.com/users/joblib","html_url":"https://github.com/joblib","followers_url":"https://api.github.com/users/joblib/followers","following_url":"https://api.github.com/users/joblib/following{/other_user}","gists_url":"https://api.github.com/users/joblib/gists{/gist_id}","starred_url":"https://api.github.com/users/joblib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joblib/subscriptions","organizations_url":"https://api.github.com/users/joblib/orgs","repos_url":"https://api.github.com/users/joblib/repos","events_url":"https://api.github.com/users/joblib/events{/privacy}","received_events_url":"https://api.github.com/users/joblib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joblib/joblib","description":"Python function as pipeline jobs.","fork":false,"url":"https://api.github.com/repos/joblib/joblib","forks_url":"https://api.github.com/repos/joblib/joblib/forks","keys_url":"https://api.github.com/repos/joblib/joblib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joblib/joblib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joblib/joblib/teams","hooks_url":"https://api.github.com/repos/joblib/joblib/hooks","issue_events_url":"https://api.github.com/repos/joblib/joblib/issues/events{/number}","events_url":"https://api.github.com/repos/joblib/joblib/events","assignees_url":"https://api.github.com/repos/joblib/joblib/assignees{/user}","branches_url":"https://api.github.com/repos/joblib/joblib/branches{/branch}","tags_url":"https://api.github.com/repos/joblib/joblib/tags","blobs_url":"https://api.github.com/repos/joblib/joblib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joblib/joblib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joblib/joblib/git/refs{/sha}","trees_url":"https://api.github.com/repos/joblib/joblib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joblib/joblib/statuses/{sha}","languages_url":"https://api.github.com/repos/joblib/joblib/languages","stargazers_url":"https://api.github.com/repos/joblib/joblib/stargazers","contributors_url":"https://api.github.com/repos/joblib/joblib/contributors","subscribers_url":"https://api.github.com/repos/joblib/joblib/subscribers","subscription_url":"https://api.github.com/repos/joblib/joblib/subscription","commits_url":"https://api.github.com/repos/joblib/joblib/commits{/sha}","git_commits_url":"https://api.github.com/repos/joblib/joblib/git/commits{/sha}","comments_url":"https://api.github.com/repos/joblib/joblib/comments{/number}","issue_comment_url":"https://api.github.com/repos/joblib/joblib/issues/comments{/number}","contents_url":"https://api.github.com/repos/joblib/joblib/contents/{+path}","compare_url":"https://api.github.com/repos/joblib/joblib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joblib/joblib/merges","archive_url":"https://api.github.com/repos/joblib/joblib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joblib/joblib/downloads","issues_url":"https://api.github.com/repos/joblib/joblib/issues{/number}","pulls_url":"https://api.github.com/repos/joblib/joblib/pulls{/number}","milestones_url":"https://api.github.com/repos/joblib/joblib/milestones{/number}","notifications_url":"https://api.github.com/repos/joblib/joblib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joblib/joblib/labels{/name}","releases_url":"https://api.github.com/repos/joblib/joblib/releases{/id}","deployments_url":"https://api.github.com/repos/joblib/joblib/deployments","created_at":"2010-05-07T06:48:26Z","updated_at":"2016-03-16T20:57:14Z","pushed_at":"2016-03-17T17:46:20Z","git_url":"git://github.com/joblib/joblib.git","ssh_url":"git@github.com:joblib/joblib.git","clone_url":"https://github.com/joblib/joblib.git","svn_url":"https://github.com/joblib/joblib","homepage":"http://packages.python.org/joblib/","size":3189,"stargazers_count":655,"watchers_count":655,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":106,"mirror_url":null,"open_issues_count":84,"forks":106,"open_issues":84,"watchers":655,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joblib/joblib/pulls/321"},"html":{"href":"https://github.com/joblib/joblib/pull/321"},"issue":{"href":"https://api.github.com/repos/joblib/joblib/issues/321"},"comments":{"href":"https://api.github.com/repos/joblib/joblib/issues/321/comments"},"review_comments":{"href":"https://api.github.com/repos/joblib/joblib/pulls/321/comments"},"review_comment":{"href":"https://api.github.com/repos/joblib/joblib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joblib/joblib/pulls/321/commits"},"statuses":{"href":"https://api.github.com/repos/joblib/joblib/statuses/556506d5fb596ff328c03d9e5fddf74a33548811"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":65,"deletions":29,"changed_files":3}}