{"action":"created","comment":{"url":"https://api.github.com/repos/ioam/holoviews/pulls/comments/62853548","id":62853548,"diff_hunk":"@@ -601,6 +601,106 @@\n    \"cell_type\": \"markdown\",\n    \"metadata\": {},\n    \"source\": [\n+    \"### Using groupby to discretize a DynamicMap\\n\",\n+    \"\\n\",\n+    \"A DynamicMap also makes it easy to partially or completely discretize a function to evaluate in a complex plot. By grouping over specific dimensions dimensions which define a fixed sampling via the Dimension values parameter can be viewed as a ``GridSpace``, ``NdLayout`` or ``NdOverlay``. If a dimension specifies only a continuous range it can't be grouped over but it may still be explored using the widgets. This means we can plot partial or completely discretized views of a parameter space easily.\\n\",\n+    \"\\n\",\n+    \"#### Partially discretize\\n\",\n+    \"\\n\",\n+    \"Fundamentally all the groupby operations use the ``groupby`` method, however there are three convenience functions to group dimensions into an ``NdOverlay`` (``.overlay``), ``GridSpace`` (``.grid``) and ``NdLayout`` (``.layout``).\\n\",\n+    \"\\n\",\n+    \"Here we will evaluate a simple sine function with three dimensions, the phase, frequency and amplitude. We assign the frequency and amplitude discrete samples and define a continuous range for the phase.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": null,\n+   \"metadata\": {},\n+   \"outputs\": [],\n+   \"source\": [\n+    \"xs = np.linspace(0, 2*np.pi)\\n\",\n+    \"\\n\",\n+    \"def sin(ph, f, amp):\\n\",\n+    \"    return hv.Curve((xs, np.sin(xs*f+ph)*amp))\\n\",\n+    \"\\n\",\n+    \"kdims=[hv.Dimension('phase', range=(0, np.pi)),\\n\",\n+    \"       hv.Dimension('frequency', values=[0.1, 1, 2, 5, 10]),\\n\",\n+    \"       hv.Dimension('amplitude', values=[0.5, 5, 10])]\\n\",\n+    \"\\n\",\n+    \"sine_dmap = hv.DynamicMap(sin, kdims=kdims)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Now we define the amplitude dimension to be overlaid and the amplitude dimension to be gridded.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": null,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"%%opts GridSpace [show_legend=True]\\n\",\n+    \"sine_dmap.overlay('amplitude').grid('frequency')\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"#### Fully discretize\\n\",\n+    \"\\n\",\n+    \"Now we define a function to evaluate over a space, instead of sampling it manually we can evaluate it using the groupby method. The function is a spiral with a frequency and a first and second order phase term. Then we define the dimension values for all the parameters and declare the DynamicMap.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": null,\n+   \"metadata\": {},\n+   \"outputs\": [],\n+   \"source\": [\n+    \"%opts Path (linewidth=1 color=Palette('Blues'))\\n\",\n+    \"\\n\",\n+    \"def spiral_equation(f, ph, ph2):\\n\",\n+    \"    r = np.arange(0, 1, 0.005)\\n\",\n+    \"    xs, ys = (r * fn(f*np.pi*np.sin(r+ph)+ph2) for fn in (np.cos, np.sin))\\n\",\n+    \"    return hv.Path((xs, ys))\\n\",\n+    \"\\n\",\n+    \"kdims=[hv.Dimension('f', values=list(np.linspace(1, 10, 10))),\\n\",\n+    \"       hv.Dimension('ph', values=list(np.linspace(0, np.pi, 10))),\\n\",\n+    \"       hv.Dimension('ph2', values=list(np.linspace(0, np.pi, 4)))]\\n\",\n+    \"\\n\",\n+    \"spiral_dmap = hv.DynamicMap(spiral_equation, kdims=kdims)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Now we can make use of the groupby method directly to group over the frequency and phase dimensions, which we will display as part of a GridSpace by setting the ``container_type``. This leaves second phase variable, which we assign to an NdOverlay by setting the ``group_type``:\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": null,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"%%opts GridSpace [xaxis=None yaxis=None] Path [bgcolor='w' xaxis=None yaxis=None]\\n\",\n+    \"spiral_dmap.groupby(['f', 'ph'], group_type=hv.NdOverlay, container_type=hv.GridSpace)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [","path":"doc/Tutorials/Dynamic_Map.ipynb","position":36,"original_position":103,"commit_id":"900a90175dc4a8db9a9c577f0163ce533b343d06","original_commit_id":"900a90175dc4a8db9a9c577f0163ce533b343d06","user":{"login":"jbednar","id":1695496,"avatar_url":"https://avatars.githubusercontent.com/u/1695496?v=3","gravatar_id":"","url":"https://api.github.com/users/jbednar","html_url":"https://github.com/jbednar","followers_url":"https://api.github.com/users/jbednar/followers","following_url":"https://api.github.com/users/jbednar/following{/other_user}","gists_url":"https://api.github.com/users/jbednar/gists{/gist_id}","starred_url":"https://api.github.com/users/jbednar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbednar/subscriptions","organizations_url":"https://api.github.com/users/jbednar/orgs","repos_url":"https://api.github.com/users/jbednar/repos","events_url":"https://api.github.com/users/jbednar/events{/privacy}","received_events_url":"https://api.github.com/users/jbednar/received_events","type":"User","site_admin":false},"body":"Ok, I'll remove the qualifier while I'm doing an editing pass on this tutorial to clean up the new changes.","created_at":"2016-05-11T14:04:00Z","updated_at":"2016-05-11T14:04:00Z","html_url":"https://github.com/ioam/holoviews/pull/667#discussion_r62853548","pull_request_url":"https://api.github.com/repos/ioam/holoviews/pulls/667","_links":{"self":{"href":"https://api.github.com/repos/ioam/holoviews/pulls/comments/62853548"},"html":{"href":"https://github.com/ioam/holoviews/pull/667#discussion_r62853548"},"pull_request":{"href":"https://api.github.com/repos/ioam/holoviews/pulls/667"}}},"pull_request":{"url":"https://api.github.com/repos/ioam/holoviews/pulls/667","id":69634921,"html_url":"https://github.com/ioam/holoviews/pull/667","diff_url":"https://github.com/ioam/holoviews/pull/667.diff","patch_url":"https://github.com/ioam/holoviews/pull/667.patch","issue_url":"https://api.github.com/repos/ioam/holoviews/issues/667","number":667,"state":"closed","locked":false,"title":"Added Tutorial section to explain DynamicMap groupby methods","user":{"login":"philippjfr","id":1550771,"avatar_url":"https://avatars.githubusercontent.com/u/1550771?v=3","gravatar_id":"","url":"https://api.github.com/users/philippjfr","html_url":"https://github.com/philippjfr","followers_url":"https://api.github.com/users/philippjfr/followers","following_url":"https://api.github.com/users/philippjfr/following{/other_user}","gists_url":"https://api.github.com/users/philippjfr/gists{/gist_id}","starred_url":"https://api.github.com/users/philippjfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philippjfr/subscriptions","organizations_url":"https://api.github.com/users/philippjfr/orgs","repos_url":"https://api.github.com/users/philippjfr/repos","events_url":"https://api.github.com/users/philippjfr/events{/privacy}","received_events_url":"https://api.github.com/users/philippjfr/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-11T08:44:39Z","updated_at":"2016-05-11T14:04:00Z","closed_at":"2016-05-11T10:57:53Z","merged_at":"2016-05-11T10:57:53Z","merge_commit_sha":"79924b80cb904e402c238a03f0c9cd473e1a5f5a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ioam/holoviews/pulls/667/commits","review_comments_url":"https://api.github.com/repos/ioam/holoviews/pulls/667/comments","review_comment_url":"https://api.github.com/repos/ioam/holoviews/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ioam/holoviews/issues/667/comments","statuses_url":"https://api.github.com/repos/ioam/holoviews/statuses/900a90175dc4a8db9a9c577f0163ce533b343d06","head":{"label":"ioam:dynamic_groupby_tutorial","ref":"dynamic_groupby_tutorial","sha":"900a90175dc4a8db9a9c577f0163ce533b343d06","user":{"login":"ioam","id":1693676,"avatar_url":"https://avatars.githubusercontent.com/u/1693676?v=3","gravatar_id":"","url":"https://api.github.com/users/ioam","html_url":"https://github.com/ioam","followers_url":"https://api.github.com/users/ioam/followers","following_url":"https://api.github.com/users/ioam/following{/other_user}","gists_url":"https://api.github.com/users/ioam/gists{/gist_id}","starred_url":"https://api.github.com/users/ioam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioam/subscriptions","organizations_url":"https://api.github.com/users/ioam/orgs","repos_url":"https://api.github.com/users/ioam/repos","events_url":"https://api.github.com/users/ioam/events{/privacy}","received_events_url":"https://api.github.com/users/ioam/received_events","type":"Organization","site_admin":false},"repo":{"id":19542768,"name":"holoviews","full_name":"ioam/holoviews","owner":{"login":"ioam","id":1693676,"avatar_url":"https://avatars.githubusercontent.com/u/1693676?v=3","gravatar_id":"","url":"https://api.github.com/users/ioam","html_url":"https://github.com/ioam","followers_url":"https://api.github.com/users/ioam/followers","following_url":"https://api.github.com/users/ioam/following{/other_user}","gists_url":"https://api.github.com/users/ioam/gists{/gist_id}","starred_url":"https://api.github.com/users/ioam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioam/subscriptions","organizations_url":"https://api.github.com/users/ioam/orgs","repos_url":"https://api.github.com/users/ioam/repos","events_url":"https://api.github.com/users/ioam/events{/privacy}","received_events_url":"https://api.github.com/users/ioam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ioam/holoviews","description":"Stop plotting your data - annotate your data and let it visualize itself","fork":false,"url":"https://api.github.com/repos/ioam/holoviews","forks_url":"https://api.github.com/repos/ioam/holoviews/forks","keys_url":"https://api.github.com/repos/ioam/holoviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ioam/holoviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ioam/holoviews/teams","hooks_url":"https://api.github.com/repos/ioam/holoviews/hooks","issue_events_url":"https://api.github.com/repos/ioam/holoviews/issues/events{/number}","events_url":"https://api.github.com/repos/ioam/holoviews/events","assignees_url":"https://api.github.com/repos/ioam/holoviews/assignees{/user}","branches_url":"https://api.github.com/repos/ioam/holoviews/branches{/branch}","tags_url":"https://api.github.com/repos/ioam/holoviews/tags","blobs_url":"https://api.github.com/repos/ioam/holoviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ioam/holoviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ioam/holoviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/ioam/holoviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ioam/holoviews/statuses/{sha}","languages_url":"https://api.github.com/repos/ioam/holoviews/languages","stargazers_url":"https://api.github.com/repos/ioam/holoviews/stargazers","contributors_url":"https://api.github.com/repos/ioam/holoviews/contributors","subscribers_url":"https://api.github.com/repos/ioam/holoviews/subscribers","subscription_url":"https://api.github.com/repos/ioam/holoviews/subscription","commits_url":"https://api.github.com/repos/ioam/holoviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/ioam/holoviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/ioam/holoviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/ioam/holoviews/issues/comments{/number}","contents_url":"https://api.github.com/repos/ioam/holoviews/contents/{+path}","compare_url":"https://api.github.com/repos/ioam/holoviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ioam/holoviews/merges","archive_url":"https://api.github.com/repos/ioam/holoviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ioam/holoviews/downloads","issues_url":"https://api.github.com/repos/ioam/holoviews/issues{/number}","pulls_url":"https://api.github.com/repos/ioam/holoviews/pulls{/number}","milestones_url":"https://api.github.com/repos/ioam/holoviews/milestones{/number}","notifications_url":"https://api.github.com/repos/ioam/holoviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ioam/holoviews/labels{/name}","releases_url":"https://api.github.com/repos/ioam/holoviews/releases{/id}","deployments_url":"https://api.github.com/repos/ioam/holoviews/deployments","created_at":"2014-05-07T16:59:22Z","updated_at":"2016-05-10T21:11:39Z","pushed_at":"2016-05-11T13:49:00Z","git_url":"git://github.com/ioam/holoviews.git","ssh_url":"git@github.com:ioam/holoviews.git","clone_url":"https://github.com/ioam/holoviews.git","svn_url":"https://github.com/ioam/holoviews","homepage":"http://holoviews.org","size":9087,"stargazers_count":232,"watchers_count":232,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":139,"forks":36,"open_issues":139,"watchers":232,"default_branch":"master"}},"base":{"label":"ioam:master","ref":"master","sha":"a47510b0458d0a8997c9715acfcad084d7898491","user":{"login":"ioam","id":1693676,"avatar_url":"https://avatars.githubusercontent.com/u/1693676?v=3","gravatar_id":"","url":"https://api.github.com/users/ioam","html_url":"https://github.com/ioam","followers_url":"https://api.github.com/users/ioam/followers","following_url":"https://api.github.com/users/ioam/following{/other_user}","gists_url":"https://api.github.com/users/ioam/gists{/gist_id}","starred_url":"https://api.github.com/users/ioam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioam/subscriptions","organizations_url":"https://api.github.com/users/ioam/orgs","repos_url":"https://api.github.com/users/ioam/repos","events_url":"https://api.github.com/users/ioam/events{/privacy}","received_events_url":"https://api.github.com/users/ioam/received_events","type":"Organization","site_admin":false},"repo":{"id":19542768,"name":"holoviews","full_name":"ioam/holoviews","owner":{"login":"ioam","id":1693676,"avatar_url":"https://avatars.githubusercontent.com/u/1693676?v=3","gravatar_id":"","url":"https://api.github.com/users/ioam","html_url":"https://github.com/ioam","followers_url":"https://api.github.com/users/ioam/followers","following_url":"https://api.github.com/users/ioam/following{/other_user}","gists_url":"https://api.github.com/users/ioam/gists{/gist_id}","starred_url":"https://api.github.com/users/ioam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioam/subscriptions","organizations_url":"https://api.github.com/users/ioam/orgs","repos_url":"https://api.github.com/users/ioam/repos","events_url":"https://api.github.com/users/ioam/events{/privacy}","received_events_url":"https://api.github.com/users/ioam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ioam/holoviews","description":"Stop plotting your data - annotate your data and let it visualize itself","fork":false,"url":"https://api.github.com/repos/ioam/holoviews","forks_url":"https://api.github.com/repos/ioam/holoviews/forks","keys_url":"https://api.github.com/repos/ioam/holoviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ioam/holoviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ioam/holoviews/teams","hooks_url":"https://api.github.com/repos/ioam/holoviews/hooks","issue_events_url":"https://api.github.com/repos/ioam/holoviews/issues/events{/number}","events_url":"https://api.github.com/repos/ioam/holoviews/events","assignees_url":"https://api.github.com/repos/ioam/holoviews/assignees{/user}","branches_url":"https://api.github.com/repos/ioam/holoviews/branches{/branch}","tags_url":"https://api.github.com/repos/ioam/holoviews/tags","blobs_url":"https://api.github.com/repos/ioam/holoviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ioam/holoviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ioam/holoviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/ioam/holoviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ioam/holoviews/statuses/{sha}","languages_url":"https://api.github.com/repos/ioam/holoviews/languages","stargazers_url":"https://api.github.com/repos/ioam/holoviews/stargazers","contributors_url":"https://api.github.com/repos/ioam/holoviews/contributors","subscribers_url":"https://api.github.com/repos/ioam/holoviews/subscribers","subscription_url":"https://api.github.com/repos/ioam/holoviews/subscription","commits_url":"https://api.github.com/repos/ioam/holoviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/ioam/holoviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/ioam/holoviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/ioam/holoviews/issues/comments{/number}","contents_url":"https://api.github.com/repos/ioam/holoviews/contents/{+path}","compare_url":"https://api.github.com/repos/ioam/holoviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ioam/holoviews/merges","archive_url":"https://api.github.com/repos/ioam/holoviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ioam/holoviews/downloads","issues_url":"https://api.github.com/repos/ioam/holoviews/issues{/number}","pulls_url":"https://api.github.com/repos/ioam/holoviews/pulls{/number}","milestones_url":"https://api.github.com/repos/ioam/holoviews/milestones{/number}","notifications_url":"https://api.github.com/repos/ioam/holoviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ioam/holoviews/labels{/name}","releases_url":"https://api.github.com/repos/ioam/holoviews/releases{/id}","deployments_url":"https://api.github.com/repos/ioam/holoviews/deployments","created_at":"2014-05-07T16:59:22Z","updated_at":"2016-05-10T21:11:39Z","pushed_at":"2016-05-11T13:49:00Z","git_url":"git://github.com/ioam/holoviews.git","ssh_url":"git@github.com:ioam/holoviews.git","clone_url":"https://github.com/ioam/holoviews.git","svn_url":"https://github.com/ioam/holoviews","homepage":"http://holoviews.org","size":9087,"stargazers_count":232,"watchers_count":232,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":139,"forks":36,"open_issues":139,"watchers":232,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ioam/holoviews/pulls/667"},"html":{"href":"https://github.com/ioam/holoviews/pull/667"},"issue":{"href":"https://api.github.com/repos/ioam/holoviews/issues/667"},"comments":{"href":"https://api.github.com/repos/ioam/holoviews/issues/667/comments"},"review_comments":{"href":"https://api.github.com/repos/ioam/holoviews/pulls/667/comments"},"review_comment":{"href":"https://api.github.com/repos/ioam/holoviews/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ioam/holoviews/pulls/667/commits"},"statuses":{"href":"https://api.github.com/repos/ioam/holoviews/statuses/900a90175dc4a8db9a9c577f0163ce533b343d06"}}}}