{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/35871629","id":35871629,"diff_hunk":"@@ -1270,22 +1270,22 @@ def __init__(self, boundaries, ncolors, clip=False):\n     def __call__(self, x, clip=None):\n         if clip is None:\n             clip = self.clip\n-        x = ma.asarray(x)\n-        mask = ma.getmaskarray(x)\n-        xx = x.filled(self.vmax + 1)\n+        _x = ma.asarray(x)\n+        mask = ma.getmaskarray(_x)\n+        xx = np.atleast_1d(_x.filled(self.vmax + 1))\n         if clip:\n-            np.clip(xx, self.vmin, self.vmax)\n-        iret = np.zeros(x.shape, dtype=np.int16)\n+            np.clip(xx, self.vmin, self.vmax, out=xx)\n+        iret = np.atleast_1d(np.zeros(_x.shape, dtype=np.int16))\n         for i, b in enumerate(self.boundaries):\n             iret[xx >= b] = i\n         if self._interp:\n             scalefac = float(self.Ncmap - 1) / (self.N - 2)\n             iret = (iret * scalefac).astype(np.int16)\n         iret[xx < self.vmin] = -1\n-        iret[xx >= self.vmax] = self.Ncmap\n+        iret[xx >= self.vmax] = self.Ncmap  # ISSUE here: clip is ignored","path":"lib/matplotlib/colors.py","position":22,"original_position":22,"commit_id":"32e727b00a7ddd86a20ab8f0117e0b0706cabfaf","original_commit_id":"32e727b00a7ddd86a20ab8f0117e0b0706cabfaf","user":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"body":"Is the clip still ignored? I thought it is now taken into account by virtue of setting the `out` parameter of the call to `np.clip`?","created_at":"2015-07-30T13:50:41Z","updated_at":"2015-07-30T13:50:41Z","html_url":"https://github.com/matplotlib/matplotlib/pull/4824#discussion_r35871629","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/35871629"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/4824#discussion_r35871629"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824","id":41219658,"html_url":"https://github.com/matplotlib/matplotlib/pull/4824","diff_url":"https://github.com/matplotlib/matplotlib/pull/4824.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/4824.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824","number":4824,"state":"open","locked":false,"title":"Two bugs in colors.BoundaryNorm","user":{"login":"fmaussion","id":10050469,"avatar_url":"https://avatars.githubusercontent.com/u/10050469?v=3","gravatar_id":"","url":"https://api.github.com/users/fmaussion","html_url":"https://github.com/fmaussion","followers_url":"https://api.github.com/users/fmaussion/followers","following_url":"https://api.github.com/users/fmaussion/following{/other_user}","gists_url":"https://api.github.com/users/fmaussion/gists{/gist_id}","starred_url":"https://api.github.com/users/fmaussion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmaussion/subscriptions","organizations_url":"https://api.github.com/users/fmaussion/orgs","repos_url":"https://api.github.com/users/fmaussion/repos","events_url":"https://api.github.com/users/fmaussion/events{/privacy}","received_events_url":"https://api.github.com/users/fmaussion/received_events","type":"User","site_admin":false},"body":"**Bug 1: calling BoundaryNorm with a scalar**\r\n\r\nShort discussion on the ML: http://matplotlib.1069221.n5.nabble.com/Misleading-BoundaryNorm-error-td45970.html\r\nI added some extra tests to the previous test-suite which was quite short.\r\n\r\n**Bug 2: clipping was ignored**\r\n\r\nThe previous call to np.clip was silently useless (not in place). I don't think that clipping makes much sense in the case of BoundaryNorm but still.\r\nBefore merging, I'd like to discuss the point I mention in the code comments: what about clipping the max values? Currently this is inconsistent and I'd like to change it, but I'd like to have your opinion on it. \r\n\r\n*disclaimer: this is my first PR, I hope to have done everything right. I did not see the \"maintenance\" branch so I branched from master. I think there are a couple of thing we can do better with these normalizing tools but I need more time to think about it...*","created_at":"2015-07-30T10:37:02Z","updated_at":"2015-07-30T13:50:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc2c41fc5d0feb1ef8c077e11abb1c8492119256","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/32e727b00a7ddd86a20ab8f0117e0b0706cabfaf","head":{"label":"fmaussion:maintenance-colors","ref":"maintenance-colors","sha":"32e727b00a7ddd86a20ab8f0117e0b0706cabfaf","user":{"login":"fmaussion","id":10050469,"avatar_url":"https://avatars.githubusercontent.com/u/10050469?v=3","gravatar_id":"","url":"https://api.github.com/users/fmaussion","html_url":"https://github.com/fmaussion","followers_url":"https://api.github.com/users/fmaussion/followers","following_url":"https://api.github.com/users/fmaussion/following{/other_user}","gists_url":"https://api.github.com/users/fmaussion/gists{/gist_id}","starred_url":"https://api.github.com/users/fmaussion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmaussion/subscriptions","organizations_url":"https://api.github.com/users/fmaussion/orgs","repos_url":"https://api.github.com/users/fmaussion/repos","events_url":"https://api.github.com/users/fmaussion/events{/privacy}","received_events_url":"https://api.github.com/users/fmaussion/received_events","type":"User","site_admin":false},"repo":{"id":39940138,"name":"matplotlib","full_name":"fmaussion/matplotlib","owner":{"login":"fmaussion","id":10050469,"avatar_url":"https://avatars.githubusercontent.com/u/10050469?v=3","gravatar_id":"","url":"https://api.github.com/users/fmaussion","html_url":"https://github.com/fmaussion","followers_url":"https://api.github.com/users/fmaussion/followers","following_url":"https://api.github.com/users/fmaussion/following{/other_user}","gists_url":"https://api.github.com/users/fmaussion/gists{/gist_id}","starred_url":"https://api.github.com/users/fmaussion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmaussion/subscriptions","organizations_url":"https://api.github.com/users/fmaussion/orgs","repos_url":"https://api.github.com/users/fmaussion/repos","events_url":"https://api.github.com/users/fmaussion/events{/privacy}","received_events_url":"https://api.github.com/users/fmaussion/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fmaussion/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/fmaussion/matplotlib","forks_url":"https://api.github.com/repos/fmaussion/matplotlib/forks","keys_url":"https://api.github.com/repos/fmaussion/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fmaussion/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fmaussion/matplotlib/teams","hooks_url":"https://api.github.com/repos/fmaussion/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/fmaussion/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/fmaussion/matplotlib/events","assignees_url":"https://api.github.com/repos/fmaussion/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/fmaussion/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/fmaussion/matplotlib/tags","blobs_url":"https://api.github.com/repos/fmaussion/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fmaussion/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fmaussion/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/fmaussion/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fmaussion/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/fmaussion/matplotlib/languages","stargazers_url":"https://api.github.com/repos/fmaussion/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/fmaussion/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/fmaussion/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/fmaussion/matplotlib/subscription","commits_url":"https://api.github.com/repos/fmaussion/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/fmaussion/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/fmaussion/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/fmaussion/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/fmaussion/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/fmaussion/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fmaussion/matplotlib/merges","archive_url":"https://api.github.com/repos/fmaussion/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fmaussion/matplotlib/downloads","issues_url":"https://api.github.com/repos/fmaussion/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/fmaussion/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/fmaussion/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/fmaussion/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fmaussion/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/fmaussion/matplotlib/releases{/id}","created_at":"2015-07-30T08:34:48Z","updated_at":"2015-07-30T08:34:56Z","pushed_at":"2015-07-30T10:25:30Z","git_url":"git://github.com/fmaussion/matplotlib.git","ssh_url":"git@github.com:fmaussion/matplotlib.git","clone_url":"https://github.com/fmaussion/matplotlib.git","svn_url":"https://github.com/fmaussion/matplotlib","homepage":"http://matplotlib.org/","size":273680,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"7539b61f6286d73aaf6cb08d90f44b4fe1c7c90a","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2015-07-30T13:29:51Z","pushed_at":"2015-07-30T13:40:18Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":273680,"stargazers_count":2691,"watchers_count":2691,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1385,"mirror_url":null,"open_issues_count":598,"forks":1385,"open_issues":598,"watchers":2691,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/4824"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/32e727b00a7ddd86a20ab8f0117e0b0706cabfaf"}}}}