{"action":"created","comment":{"url":"https://api.github.com/repos/Unidata/MetPy/pulls/comments/129582269","pull_request_review_id":52369966,"id":129582269,"diff_hunk":"@@ -51,3 +52,51 @@ def precipitable_water(dewpt, p, top=400 * units('hPa')):\n     pw = -1. * (np.trapz(w.magnitude, pres_layer.magnitude) * (w.units * pres_layer.units) /\n                 (g * rho_l))\n     return pw.to('millimeters')\n+\n+\n+@exporter.export\n+@check_units('[speed]', '[speed]', '[pressure]', '[length]')\n+def mean_wind_pressure_weighted(u, v, p, hgt, depth, bottom=None, obs_only=False):\n+    r\"\"\"Calculate pressure-weighted mean wind through a layer.\n+\n+    Layer bottom and depth specified in meters AGL.\n+\n+    Parameters\n+    ----------\n+    u : array-like\n+        U-component of wind.\n+    v : array-like\n+        V-component of wind.\n+    p : array-like\n+        Atmospheric pressure profile\n+    hgt : array-like\n+        Heights from sounding\n+    depth: `pint.Quantity`\n+        The depth of the layer in meters.\n+    bottom: `pint.Quantity`\n+        The bottom of the layer in meters AGL.\n+        Default is the first observation, assumed to be the surface.\n+\n+    Returns\n+    -------\n+    `pint.Quantity`\n+        u_mean: u-component of layer mean wind, in m/s\n+    `pint.Quantity`\n+        v_mean: v-component of layer mean wind, in m/s\n+\n+    \"\"\"\n+    u = u.to('meters/second')\n+    v = v.to('meters/second')\n+    if bottom:\n+        bottom = bottom + hgt[0]\n+    w_int = get_layer(p, u, v, heights=hgt, bottom=bottom, depth=depth)","path":"metpy/calc/indices.py","position":49,"original_position":49,"commit_id":"b70855ae3c1bca1b6724f737c573a9d3560dc516","original_commit_id":"b70855ae3c1bca1b6724f737c573a9d3560dc516","user":{"login":"jrleeman","id":325269,"avatar_url":"https://avatars3.githubusercontent.com/u/325269?v=4","gravatar_id":"","url":"https://api.github.com/users/jrleeman","html_url":"https://github.com/jrleeman","followers_url":"https://api.github.com/users/jrleeman/followers","following_url":"https://api.github.com/users/jrleeman/following{/other_user}","gists_url":"https://api.github.com/users/jrleeman/gists{/gist_id}","starred_url":"https://api.github.com/users/jrleeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrleeman/subscriptions","organizations_url":"https://api.github.com/users/jrleeman/orgs","repos_url":"https://api.github.com/users/jrleeman/repos","events_url":"https://api.github.com/users/jrleeman/events{/privacy}","received_events_url":"https://api.github.com/users/jrleeman/received_events","type":"User","site_admin":false},"body":"Instead of using indexing, it's more readable to unpack into meaningful variable names. Something like:\r\n\r\n`layer_p, layer_u, layer_v = get_layer(...)`","created_at":"2017-07-26T14:10:28Z","updated_at":"2017-07-26T14:11:41Z","html_url":"https://github.com/Unidata/MetPy/pull/515#discussion_r129582269","pull_request_url":"https://api.github.com/repos/Unidata/MetPy/pulls/515","_links":{"self":{"href":"https://api.github.com/repos/Unidata/MetPy/pulls/comments/129582269"},"html":{"href":"https://github.com/Unidata/MetPy/pull/515#discussion_r129582269"},"pull_request":{"href":"https://api.github.com/repos/Unidata/MetPy/pulls/515"}}},"pull_request":{"url":"https://api.github.com/repos/Unidata/MetPy/pulls/515","id":131357486,"html_url":"https://github.com/Unidata/MetPy/pull/515","diff_url":"https://github.com/Unidata/MetPy/pull/515.diff","patch_url":"https://github.com/Unidata/MetPy/pull/515.patch","issue_url":"https://api.github.com/repos/Unidata/MetPy/issues/515","number":515,"state":"open","locked":false,"title":"Pressure-Weighted Mean Wind","user":{"login":"mwilson14","id":25419751,"avatar_url":"https://avatars2.githubusercontent.com/u/25419751?v=4","gravatar_id":"","url":"https://api.github.com/users/mwilson14","html_url":"https://github.com/mwilson14","followers_url":"https://api.github.com/users/mwilson14/followers","following_url":"https://api.github.com/users/mwilson14/following{/other_user}","gists_url":"https://api.github.com/users/mwilson14/gists{/gist_id}","starred_url":"https://api.github.com/users/mwilson14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwilson14/subscriptions","organizations_url":"https://api.github.com/users/mwilson14/orgs","repos_url":"https://api.github.com/users/mwilson14/repos","events_url":"https://api.github.com/users/mwilson14/events{/privacy}","received_events_url":"https://api.github.com/users/mwilson14/received_events","type":"User","site_admin":false},"body":"Adds a function to calculate the pressure-weighted mean wind through a layer.","created_at":"2017-07-19T15:54:01Z","updated_at":"2017-07-26T14:11:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a8ee2f5391340fc9dafb322c8c0ad1143c5c5ef","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/Unidata/MetPy/milestones/11","html_url":"https://github.com/Unidata/MetPy/milestone/11","labels_url":"https://api.github.com/repos/Unidata/MetPy/milestones/11/labels","id":2378571,"number":11,"title":"0.6","description":"We should do a webinar with the release to highlight new features.","creator":{"login":"dopplershift","id":221526,"avatar_url":"https://avatars2.githubusercontent.com/u/221526?v=4","gravatar_id":"","url":"https://api.github.com/users/dopplershift","html_url":"https://github.com/dopplershift","followers_url":"https://api.github.com/users/dopplershift/followers","following_url":"https://api.github.com/users/dopplershift/following{/other_user}","gists_url":"https://api.github.com/users/dopplershift/gists{/gist_id}","starred_url":"https://api.github.com/users/dopplershift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dopplershift/subscriptions","organizations_url":"https://api.github.com/users/dopplershift/orgs","repos_url":"https://api.github.com/users/dopplershift/repos","events_url":"https://api.github.com/users/dopplershift/events{/privacy}","received_events_url":"https://api.github.com/users/dopplershift/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":60,"state":"open","created_at":"2017-03-10T20:17:43Z","updated_at":"2017-07-25T20:42:47Z","due_on":"2017-09-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Unidata/MetPy/pulls/515/commits","review_comments_url":"https://api.github.com/repos/Unidata/MetPy/pulls/515/comments","review_comment_url":"https://api.github.com/repos/Unidata/MetPy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Unidata/MetPy/issues/515/comments","statuses_url":"https://api.github.com/repos/Unidata/MetPy/statuses/b70855ae3c1bca1b6724f737c573a9d3560dc516","head":{"label":"mwilson14:mean_wind","ref":"mean_wind","sha":"b70855ae3c1bca1b6724f737c573a9d3560dc516","user":{"login":"mwilson14","id":25419751,"avatar_url":"https://avatars2.githubusercontent.com/u/25419751?v=4","gravatar_id":"","url":"https://api.github.com/users/mwilson14","html_url":"https://github.com/mwilson14","followers_url":"https://api.github.com/users/mwilson14/followers","following_url":"https://api.github.com/users/mwilson14/following{/other_user}","gists_url":"https://api.github.com/users/mwilson14/gists{/gist_id}","starred_url":"https://api.github.com/users/mwilson14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwilson14/subscriptions","organizations_url":"https://api.github.com/users/mwilson14/orgs","repos_url":"https://api.github.com/users/mwilson14/repos","events_url":"https://api.github.com/users/mwilson14/events{/privacy}","received_events_url":"https://api.github.com/users/mwilson14/received_events","type":"User","site_admin":false},"repo":{"id":94251493,"name":"MetPy","full_name":"mwilson14/MetPy","owner":{"login":"mwilson14","id":25419751,"avatar_url":"https://avatars2.githubusercontent.com/u/25419751?v=4","gravatar_id":"","url":"https://api.github.com/users/mwilson14","html_url":"https://github.com/mwilson14","followers_url":"https://api.github.com/users/mwilson14/followers","following_url":"https://api.github.com/users/mwilson14/following{/other_user}","gists_url":"https://api.github.com/users/mwilson14/gists{/gist_id}","starred_url":"https://api.github.com/users/mwilson14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwilson14/subscriptions","organizations_url":"https://api.github.com/users/mwilson14/orgs","repos_url":"https://api.github.com/users/mwilson14/repos","events_url":"https://api.github.com/users/mwilson14/events{/privacy}","received_events_url":"https://api.github.com/users/mwilson14/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwilson14/MetPy","description":"A Python Package for Meteorological Data","fork":true,"url":"https://api.github.com/repos/mwilson14/MetPy","forks_url":"https://api.github.com/repos/mwilson14/MetPy/forks","keys_url":"https://api.github.com/repos/mwilson14/MetPy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwilson14/MetPy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwilson14/MetPy/teams","hooks_url":"https://api.github.com/repos/mwilson14/MetPy/hooks","issue_events_url":"https://api.github.com/repos/mwilson14/MetPy/issues/events{/number}","events_url":"https://api.github.com/repos/mwilson14/MetPy/events","assignees_url":"https://api.github.com/repos/mwilson14/MetPy/assignees{/user}","branches_url":"https://api.github.com/repos/mwilson14/MetPy/branches{/branch}","tags_url":"https://api.github.com/repos/mwilson14/MetPy/tags","blobs_url":"https://api.github.com/repos/mwilson14/MetPy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwilson14/MetPy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwilson14/MetPy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwilson14/MetPy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwilson14/MetPy/statuses/{sha}","languages_url":"https://api.github.com/repos/mwilson14/MetPy/languages","stargazers_url":"https://api.github.com/repos/mwilson14/MetPy/stargazers","contributors_url":"https://api.github.com/repos/mwilson14/MetPy/contributors","subscribers_url":"https://api.github.com/repos/mwilson14/MetPy/subscribers","subscription_url":"https://api.github.com/repos/mwilson14/MetPy/subscription","commits_url":"https://api.github.com/repos/mwilson14/MetPy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwilson14/MetPy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwilson14/MetPy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwilson14/MetPy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwilson14/MetPy/contents/{+path}","compare_url":"https://api.github.com/repos/mwilson14/MetPy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwilson14/MetPy/merges","archive_url":"https://api.github.com/repos/mwilson14/MetPy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwilson14/MetPy/downloads","issues_url":"https://api.github.com/repos/mwilson14/MetPy/issues{/number}","pulls_url":"https://api.github.com/repos/mwilson14/MetPy/pulls{/number}","milestones_url":"https://api.github.com/repos/mwilson14/MetPy/milestones{/number}","notifications_url":"https://api.github.com/repos/mwilson14/MetPy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwilson14/MetPy/labels{/name}","releases_url":"https://api.github.com/repos/mwilson14/MetPy/releases{/id}","deployments_url":"https://api.github.com/repos/mwilson14/MetPy/deployments","created_at":"2017-06-13T19:49:44Z","updated_at":"2017-06-13T19:49:47Z","pushed_at":"2017-07-25T21:25:47Z","git_url":"git://github.com/mwilson14/MetPy.git","ssh_url":"git@github.com:mwilson14/MetPy.git","clone_url":"https://github.com/mwilson14/MetPy.git","svn_url":"https://github.com/mwilson14/MetPy","homepage":"https://unidata.github.io/MetPy","size":111151,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_projects":true,"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":0,"default_branch":"master"}},"base":{"label":"Unidata:master","ref":"master","sha":"7a7ce6f56c347d2616189c74ff233455325a3b1f","user":{"login":"Unidata","id":613345,"avatar_url":"https://avatars3.githubusercontent.com/u/613345?v=4","gravatar_id":"","url":"https://api.github.com/users/Unidata","html_url":"https://github.com/Unidata","followers_url":"https://api.github.com/users/Unidata/followers","following_url":"https://api.github.com/users/Unidata/following{/other_user}","gists_url":"https://api.github.com/users/Unidata/gists{/gist_id}","starred_url":"https://api.github.com/users/Unidata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unidata/subscriptions","organizations_url":"https://api.github.com/users/Unidata/orgs","repos_url":"https://api.github.com/users/Unidata/repos","events_url":"https://api.github.com/users/Unidata/events{/privacy}","received_events_url":"https://api.github.com/users/Unidata/received_events","type":"Organization","site_admin":false},"repo":{"id":1409621,"name":"MetPy","full_name":"Unidata/MetPy","owner":{"login":"Unidata","id":613345,"avatar_url":"https://avatars3.githubusercontent.com/u/613345?v=4","gravatar_id":"","url":"https://api.github.com/users/Unidata","html_url":"https://github.com/Unidata","followers_url":"https://api.github.com/users/Unidata/followers","following_url":"https://api.github.com/users/Unidata/following{/other_user}","gists_url":"https://api.github.com/users/Unidata/gists{/gist_id}","starred_url":"https://api.github.com/users/Unidata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unidata/subscriptions","organizations_url":"https://api.github.com/users/Unidata/orgs","repos_url":"https://api.github.com/users/Unidata/repos","events_url":"https://api.github.com/users/Unidata/events{/privacy}","received_events_url":"https://api.github.com/users/Unidata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unidata/MetPy","description":"A Python Package for Meteorological Data","fork":false,"url":"https://api.github.com/repos/Unidata/MetPy","forks_url":"https://api.github.com/repos/Unidata/MetPy/forks","keys_url":"https://api.github.com/repos/Unidata/MetPy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unidata/MetPy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unidata/MetPy/teams","hooks_url":"https://api.github.com/repos/Unidata/MetPy/hooks","issue_events_url":"https://api.github.com/repos/Unidata/MetPy/issues/events{/number}","events_url":"https://api.github.com/repos/Unidata/MetPy/events","assignees_url":"https://api.github.com/repos/Unidata/MetPy/assignees{/user}","branches_url":"https://api.github.com/repos/Unidata/MetPy/branches{/branch}","tags_url":"https://api.github.com/repos/Unidata/MetPy/tags","blobs_url":"https://api.github.com/repos/Unidata/MetPy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unidata/MetPy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unidata/MetPy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unidata/MetPy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unidata/MetPy/statuses/{sha}","languages_url":"https://api.github.com/repos/Unidata/MetPy/languages","stargazers_url":"https://api.github.com/repos/Unidata/MetPy/stargazers","contributors_url":"https://api.github.com/repos/Unidata/MetPy/contributors","subscribers_url":"https://api.github.com/repos/Unidata/MetPy/subscribers","subscription_url":"https://api.github.com/repos/Unidata/MetPy/subscription","commits_url":"https://api.github.com/repos/Unidata/MetPy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unidata/MetPy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unidata/MetPy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unidata/MetPy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unidata/MetPy/contents/{+path}","compare_url":"https://api.github.com/repos/Unidata/MetPy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unidata/MetPy/merges","archive_url":"https://api.github.com/repos/Unidata/MetPy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unidata/MetPy/downloads","issues_url":"https://api.github.com/repos/Unidata/MetPy/issues{/number}","pulls_url":"https://api.github.com/repos/Unidata/MetPy/pulls{/number}","milestones_url":"https://api.github.com/repos/Unidata/MetPy/milestones{/number}","notifications_url":"https://api.github.com/repos/Unidata/MetPy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unidata/MetPy/labels{/name}","releases_url":"https://api.github.com/repos/Unidata/MetPy/releases{/id}","deployments_url":"https://api.github.com/repos/Unidata/MetPy/deployments","created_at":"2011-02-25T04:20:25Z","updated_at":"2017-07-20T17:20:10Z","pushed_at":"2017-07-26T14:05:26Z","git_url":"git://github.com/Unidata/MetPy.git","ssh_url":"git@github.com:Unidata/MetPy.git","clone_url":"https://github.com/Unidata/MetPy.git","svn_url":"https://github.com/Unidata/MetPy","homepage":"https://unidata.github.io/MetPy","size":149472,"stargazers_count":178,"watchers_count":178,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":86,"mirror_url":null,"open_issues_count":117,"forks":86,"open_issues":117,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Unidata/MetPy/pulls/515"},"html":{"href":"https://github.com/Unidata/MetPy/pull/515"},"issue":{"href":"https://api.github.com/repos/Unidata/MetPy/issues/515"},"comments":{"href":"https://api.github.com/repos/Unidata/MetPy/issues/515/comments"},"review_comments":{"href":"https://api.github.com/repos/Unidata/MetPy/pulls/515/comments"},"review_comment":{"href":"https://api.github.com/repos/Unidata/MetPy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Unidata/MetPy/pulls/515/commits"},"statuses":{"href":"https://api.github.com/repos/Unidata/MetPy/statuses/b70855ae3c1bca1b6724f737c573a9d3560dc516"}}}}
{"actor":{"display_login":"jrleeman"}}