{"action":"created","comment":{"url":"https://api.github.com/repos/sci-wms/sci-wms/pulls/comments/36313968","id":36313968,"diff_hunk":"@@ -284,7 +281,29 @@ def getmap(self, layer, request):\n                     return self.empty_response(layer, request)\n \n                 if request.GET['image_type'] == 'filledcontours':\n-                    return mpl_handler.tricontourf_response(tri_subset, data, request)\n+                    if np.isnan(np.sum(data)):\n+                        data_mask = np.logical_not(np.isnan(data))  # mask for non-NaN data elements","path":"wms/models/datasets/ugrid.py","position":25,"original_position":25,"commit_id":"bd78769884899b4b6380daa9721e0934d20ee9fd","original_commit_id":"bd78769884899b4b6380daa9721e0934d20ee9fd","user":{"login":"ocefpaf","id":950575,"avatar_url":"https://avatars.githubusercontent.com/u/950575?v=3","gravatar_id":"","url":"https://api.github.com/users/ocefpaf","html_url":"https://github.com/ocefpaf","followers_url":"https://api.github.com/users/ocefpaf/followers","following_url":"https://api.github.com/users/ocefpaf/following{/other_user}","gists_url":"https://api.github.com/users/ocefpaf/gists{/gist_id}","starred_url":"https://api.github.com/users/ocefpaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocefpaf/subscriptions","organizations_url":"https://api.github.com/users/ocefpaf/orgs","repos_url":"https://api.github.com/users/ocefpaf/repos","events_url":"https://api.github.com/users/ocefpaf/events{/privacy}","received_events_url":"https://api.github.com/users/ocefpaf/received_events","type":"User","site_admin":false},"body":"Python method calls are a known bottleneck.  The difference might seem small now, but with subsequent calls this might make a difference.  I remember an old project of mine where changing the calls change from `np.deg2rad` to `deg2rad` make it 10% faster!  (To be fair there was a lot of those calls in a gigantic loop.)\r\n\r\nAnd if this change makes the code clearer it is a win-win :wink: ","created_at":"2015-08-05T15:19:03Z","updated_at":"2015-08-05T15:19:03Z","html_url":"https://github.com/sci-wms/sci-wms/pull/64#discussion_r36313968","pull_request_url":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/sci-wms/sci-wms/pulls/comments/36313968"},"html":{"href":"https://github.com/sci-wms/sci-wms/pull/64#discussion_r36313968"},"pull_request":{"href":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64","id":41014494,"html_url":"https://github.com/sci-wms/sci-wms/pull/64","diff_url":"https://github.com/sci-wms/sci-wms/pull/64.diff","patch_url":"https://github.com/sci-wms/sci-wms/pull/64.patch","issue_url":"https://api.github.com/repos/sci-wms/sci-wms/issues/64","number":64,"state":"open","locked":false,"title":"fix for NaNs in dataset (Issue #16)","user":{"login":"ayan-usgs","id":1903370,"avatar_url":"https://avatars.githubusercontent.com/u/1903370?v=3","gravatar_id":"","url":"https://api.github.com/users/ayan-usgs","html_url":"https://github.com/ayan-usgs","followers_url":"https://api.github.com/users/ayan-usgs/followers","following_url":"https://api.github.com/users/ayan-usgs/following{/other_user}","gists_url":"https://api.github.com/users/ayan-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/ayan-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayan-usgs/subscriptions","organizations_url":"https://api.github.com/users/ayan-usgs/orgs","repos_url":"https://api.github.com/users/ayan-usgs/repos","events_url":"https://api.github.com/users/ayan-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/ayan-usgs/received_events","type":"User","site_admin":false},"body":"Fix for issue #16.\r\n\r\nThe data is subsetted to remove the NaNs; latitude and longitude are similarly subsetted. The unfortunate thing about this, is the spatial index and face indices need to be recalculated... kinda lame. It seems the alternative would be to get data initially and then calculate the indices, but this seems even lamer considering that the data would be retrieved before even knowing if the tile is empty.\r\n\r\nSuggestions, as always, are appreciated.","created_at":"2015-07-28T14:01:46Z","updated_at":"2015-08-05T15:19:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1388c065dd4552f98038218f074e6df2a557398c","assignee":{"login":"kwilcox","id":13939,"avatar_url":"https://avatars.githubusercontent.com/u/13939?v=3","gravatar_id":"","url":"https://api.github.com/users/kwilcox","html_url":"https://github.com/kwilcox","followers_url":"https://api.github.com/users/kwilcox/followers","following_url":"https://api.github.com/users/kwilcox/following{/other_user}","gists_url":"https://api.github.com/users/kwilcox/gists{/gist_id}","starred_url":"https://api.github.com/users/kwilcox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwilcox/subscriptions","organizations_url":"https://api.github.com/users/kwilcox/orgs","repos_url":"https://api.github.com/users/kwilcox/repos","events_url":"https://api.github.com/users/kwilcox/events{/privacy}","received_events_url":"https://api.github.com/users/kwilcox/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64/commits","review_comments_url":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64/comments","review_comment_url":"https://api.github.com/repos/sci-wms/sci-wms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sci-wms/sci-wms/issues/64/comments","statuses_url":"https://api.github.com/repos/sci-wms/sci-wms/statuses/bd78769884899b4b6380daa9721e0934d20ee9fd","head":{"label":"ayan-usgs:master","ref":"master","sha":"bd78769884899b4b6380daa9721e0934d20ee9fd","user":{"login":"ayan-usgs","id":1903370,"avatar_url":"https://avatars.githubusercontent.com/u/1903370?v=3","gravatar_id":"","url":"https://api.github.com/users/ayan-usgs","html_url":"https://github.com/ayan-usgs","followers_url":"https://api.github.com/users/ayan-usgs/followers","following_url":"https://api.github.com/users/ayan-usgs/following{/other_user}","gists_url":"https://api.github.com/users/ayan-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/ayan-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayan-usgs/subscriptions","organizations_url":"https://api.github.com/users/ayan-usgs/orgs","repos_url":"https://api.github.com/users/ayan-usgs/repos","events_url":"https://api.github.com/users/ayan-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/ayan-usgs/received_events","type":"User","site_admin":false},"repo":{"id":39654817,"name":"sci-wms","full_name":"ayan-usgs/sci-wms","owner":{"login":"ayan-usgs","id":1903370,"avatar_url":"https://avatars.githubusercontent.com/u/1903370?v=3","gravatar_id":"","url":"https://api.github.com/users/ayan-usgs","html_url":"https://github.com/ayan-usgs","followers_url":"https://api.github.com/users/ayan-usgs/followers","following_url":"https://api.github.com/users/ayan-usgs/following{/other_user}","gists_url":"https://api.github.com/users/ayan-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/ayan-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayan-usgs/subscriptions","organizations_url":"https://api.github.com/users/ayan-usgs/orgs","repos_url":"https://api.github.com/users/ayan-usgs/repos","events_url":"https://api.github.com/users/ayan-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/ayan-usgs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ayan-usgs/sci-wms","description":"A Python WMS service for geospatial gridded data","fork":true,"url":"https://api.github.com/repos/ayan-usgs/sci-wms","forks_url":"https://api.github.com/repos/ayan-usgs/sci-wms/forks","keys_url":"https://api.github.com/repos/ayan-usgs/sci-wms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ayan-usgs/sci-wms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ayan-usgs/sci-wms/teams","hooks_url":"https://api.github.com/repos/ayan-usgs/sci-wms/hooks","issue_events_url":"https://api.github.com/repos/ayan-usgs/sci-wms/issues/events{/number}","events_url":"https://api.github.com/repos/ayan-usgs/sci-wms/events","assignees_url":"https://api.github.com/repos/ayan-usgs/sci-wms/assignees{/user}","branches_url":"https://api.github.com/repos/ayan-usgs/sci-wms/branches{/branch}","tags_url":"https://api.github.com/repos/ayan-usgs/sci-wms/tags","blobs_url":"https://api.github.com/repos/ayan-usgs/sci-wms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ayan-usgs/sci-wms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ayan-usgs/sci-wms/git/refs{/sha}","trees_url":"https://api.github.com/repos/ayan-usgs/sci-wms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ayan-usgs/sci-wms/statuses/{sha}","languages_url":"https://api.github.com/repos/ayan-usgs/sci-wms/languages","stargazers_url":"https://api.github.com/repos/ayan-usgs/sci-wms/stargazers","contributors_url":"https://api.github.com/repos/ayan-usgs/sci-wms/contributors","subscribers_url":"https://api.github.com/repos/ayan-usgs/sci-wms/subscribers","subscription_url":"https://api.github.com/repos/ayan-usgs/sci-wms/subscription","commits_url":"https://api.github.com/repos/ayan-usgs/sci-wms/commits{/sha}","git_commits_url":"https://api.github.com/repos/ayan-usgs/sci-wms/git/commits{/sha}","comments_url":"https://api.github.com/repos/ayan-usgs/sci-wms/comments{/number}","issue_comment_url":"https://api.github.com/repos/ayan-usgs/sci-wms/issues/comments{/number}","contents_url":"https://api.github.com/repos/ayan-usgs/sci-wms/contents/{+path}","compare_url":"https://api.github.com/repos/ayan-usgs/sci-wms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ayan-usgs/sci-wms/merges","archive_url":"https://api.github.com/repos/ayan-usgs/sci-wms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ayan-usgs/sci-wms/downloads","issues_url":"https://api.github.com/repos/ayan-usgs/sci-wms/issues{/number}","pulls_url":"https://api.github.com/repos/ayan-usgs/sci-wms/pulls{/number}","milestones_url":"https://api.github.com/repos/ayan-usgs/sci-wms/milestones{/number}","notifications_url":"https://api.github.com/repos/ayan-usgs/sci-wms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ayan-usgs/sci-wms/labels{/name}","releases_url":"https://api.github.com/repos/ayan-usgs/sci-wms/releases{/id}","created_at":"2015-07-24T20:10:27Z","updated_at":"2015-07-24T20:10:28Z","pushed_at":"2015-07-31T19:47:39Z","git_url":"git://github.com/ayan-usgs/sci-wms.git","ssh_url":"git@github.com:ayan-usgs/sci-wms.git","clone_url":"https://github.com/ayan-usgs/sci-wms.git","svn_url":"https://github.com/ayan-usgs/sci-wms","homepage":"http://sci-wms.github.io/sci-wms/","size":97017,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sci-wms:master","ref":"master","sha":"1b1eabf466127cc2389b04dd22de1092a1e82951","user":{"login":"sci-wms","id":11201121,"avatar_url":"https://avatars.githubusercontent.com/u/11201121?v=3","gravatar_id":"","url":"https://api.github.com/users/sci-wms","html_url":"https://github.com/sci-wms","followers_url":"https://api.github.com/users/sci-wms/followers","following_url":"https://api.github.com/users/sci-wms/following{/other_user}","gists_url":"https://api.github.com/users/sci-wms/gists{/gist_id}","starred_url":"https://api.github.com/users/sci-wms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sci-wms/subscriptions","organizations_url":"https://api.github.com/users/sci-wms/orgs","repos_url":"https://api.github.com/users/sci-wms/repos","events_url":"https://api.github.com/users/sci-wms/events{/privacy}","received_events_url":"https://api.github.com/users/sci-wms/received_events","type":"Organization","site_admin":false},"repo":{"id":31424428,"name":"sci-wms","full_name":"sci-wms/sci-wms","owner":{"login":"sci-wms","id":11201121,"avatar_url":"https://avatars.githubusercontent.com/u/11201121?v=3","gravatar_id":"","url":"https://api.github.com/users/sci-wms","html_url":"https://github.com/sci-wms","followers_url":"https://api.github.com/users/sci-wms/followers","following_url":"https://api.github.com/users/sci-wms/following{/other_user}","gists_url":"https://api.github.com/users/sci-wms/gists{/gist_id}","starred_url":"https://api.github.com/users/sci-wms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sci-wms/subscriptions","organizations_url":"https://api.github.com/users/sci-wms/orgs","repos_url":"https://api.github.com/users/sci-wms/repos","events_url":"https://api.github.com/users/sci-wms/events{/privacy}","received_events_url":"https://api.github.com/users/sci-wms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sci-wms/sci-wms","description":"A Python WMS service for geospatial gridded data","fork":false,"url":"https://api.github.com/repos/sci-wms/sci-wms","forks_url":"https://api.github.com/repos/sci-wms/sci-wms/forks","keys_url":"https://api.github.com/repos/sci-wms/sci-wms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sci-wms/sci-wms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sci-wms/sci-wms/teams","hooks_url":"https://api.github.com/repos/sci-wms/sci-wms/hooks","issue_events_url":"https://api.github.com/repos/sci-wms/sci-wms/issues/events{/number}","events_url":"https://api.github.com/repos/sci-wms/sci-wms/events","assignees_url":"https://api.github.com/repos/sci-wms/sci-wms/assignees{/user}","branches_url":"https://api.github.com/repos/sci-wms/sci-wms/branches{/branch}","tags_url":"https://api.github.com/repos/sci-wms/sci-wms/tags","blobs_url":"https://api.github.com/repos/sci-wms/sci-wms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sci-wms/sci-wms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sci-wms/sci-wms/git/refs{/sha}","trees_url":"https://api.github.com/repos/sci-wms/sci-wms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sci-wms/sci-wms/statuses/{sha}","languages_url":"https://api.github.com/repos/sci-wms/sci-wms/languages","stargazers_url":"https://api.github.com/repos/sci-wms/sci-wms/stargazers","contributors_url":"https://api.github.com/repos/sci-wms/sci-wms/contributors","subscribers_url":"https://api.github.com/repos/sci-wms/sci-wms/subscribers","subscription_url":"https://api.github.com/repos/sci-wms/sci-wms/subscription","commits_url":"https://api.github.com/repos/sci-wms/sci-wms/commits{/sha}","git_commits_url":"https://api.github.com/repos/sci-wms/sci-wms/git/commits{/sha}","comments_url":"https://api.github.com/repos/sci-wms/sci-wms/comments{/number}","issue_comment_url":"https://api.github.com/repos/sci-wms/sci-wms/issues/comments{/number}","contents_url":"https://api.github.com/repos/sci-wms/sci-wms/contents/{+path}","compare_url":"https://api.github.com/repos/sci-wms/sci-wms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sci-wms/sci-wms/merges","archive_url":"https://api.github.com/repos/sci-wms/sci-wms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sci-wms/sci-wms/downloads","issues_url":"https://api.github.com/repos/sci-wms/sci-wms/issues{/number}","pulls_url":"https://api.github.com/repos/sci-wms/sci-wms/pulls{/number}","milestones_url":"https://api.github.com/repos/sci-wms/sci-wms/milestones{/number}","notifications_url":"https://api.github.com/repos/sci-wms/sci-wms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sci-wms/sci-wms/labels{/name}","releases_url":"https://api.github.com/repos/sci-wms/sci-wms/releases{/id}","created_at":"2015-02-27T15:01:22Z","updated_at":"2015-07-24T19:25:56Z","pushed_at":"2015-08-04T19:45:49Z","git_url":"git://github.com/sci-wms/sci-wms.git","ssh_url":"git@github.com:sci-wms/sci-wms.git","clone_url":"https://github.com/sci-wms/sci-wms.git","svn_url":"https://github.com/sci-wms/sci-wms","homepage":"http://sci-wms.github.io/sci-wms/","size":97467,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":9,"forks":3,"open_issues":9,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64"},"html":{"href":"https://github.com/sci-wms/sci-wms/pull/64"},"issue":{"href":"https://api.github.com/repos/sci-wms/sci-wms/issues/64"},"comments":{"href":"https://api.github.com/repos/sci-wms/sci-wms/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/sci-wms/sci-wms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sci-wms/sci-wms/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/sci-wms/sci-wms/statuses/bd78769884899b4b6380daa9721e0934d20ee9fd"}}}}