{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824/events","html_url":"https://github.com/matplotlib/matplotlib/pull/4824","id":98137414,"number":4824,"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},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12","html_url":"https://github.com/matplotlib/matplotlib/milestones/proposed%20next%20point%20release","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12/labels","id":534144,"number":12,"title":"proposed next point release","description":"","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":371,"closed_issues":215,"state":"open","created_at":"2014-01-13T03:21:09Z","updated_at":"2015-07-30T19:53:01Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-07-30T10:37:02Z","updated_at":"2015-07-31T07:45:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4824","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"},"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...*"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/126596275","html_url":"https://github.com/matplotlib/matplotlib/pull/4824#issuecomment-126596275","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4824","id":126596275,"user":{"login":"efiring","id":85125,"avatar_url":"https://avatars.githubusercontent.com/u/85125?v=3","gravatar_id":"","url":"https://api.github.com/users/efiring","html_url":"https://github.com/efiring","followers_url":"https://api.github.com/users/efiring/followers","following_url":"https://api.github.com/users/efiring/following{/other_user}","gists_url":"https://api.github.com/users/efiring/gists{/gist_id}","starred_url":"https://api.github.com/users/efiring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efiring/subscriptions","organizations_url":"https://api.github.com/users/efiring/orgs","repos_url":"https://api.github.com/users/efiring/repos","events_url":"https://api.github.com/users/efiring/events{/privacy}","received_events_url":"https://api.github.com/users/efiring/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T07:45:43Z","updated_at":"2015-07-31T07:45:43Z","body":"Nans are presently not supported in the Normalize API.  Obviously, this could be changed.  It would impose a performance penalty for large arrays.  Overall, this is an example of how the mpl API has evolved, without a clear statement of where operations like checking for invalid values should be done, and where they should not.  If we do the checking at every level of the API, the performance penalties mount up.  Certainly we want to do it at the highest level, like plot and contourf.  But Normalize is at a lower level, so we could leave it as-is and just say it is the caller's responsibility to clean up the input.\r\n\r\nWhenever it is decided that we need np.masked_invalid or np.fixed_invalid (which I think is a little more general, but slower), it would be good to use the copy kwarg to avoid a copy unless it is really needed.  With fixed_invalid it is probably needed in many cases, because fixed_invalid fills the invalid values.  Masked_invalid just returns a masked array without changing any underlying data values."}}