{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/5562","repository_url":"https://api.github.com/repos/bokeh/bokeh","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/5562/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/5562/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/5562/events","html_url":"https://github.com/bokeh/bokeh/issues/5562","id":195581478,"number":5562,"title":"Correctly deprecating ImageRGBA cols and rows properties","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},"labels":[{"id":91228996,"url":"https://api.github.com/repos/bokeh/bokeh/labels/type:%20discussion","name":"type: discussion","color":"2659A0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-14T16:38:58Z","updated_at":"2016-12-14T17:15:36Z","closed_at":null,"body":"As part of #5544 we are changing how 2D arrays are serialized in bokeh and in reworking that code @bryevdv noticed that unlike the ``Image`` glyph,  the ``ImageRGBA`` glyph supports setting  ``rows`` and ``cols`` properties and setting the image data to a flattened 1D-array. This is both inconsistent and a bit weird so it was suggested that this option should be deprecated.\r\n\r\nThe question now is how best to do this deprecation. Most of the deprecations currently either rename or move an existing property rather than deprecating it entirely so there is no standard approach here. Currently I see two options:\r\n\r\n1) My initial suggestion was to add hidden ``_rows`` and ``_cols`` props which matching rows and cols setter and getter properties write into.\r\n\r\n2) As an alternative @bryevdv suggested defining a ``DeprecatedNumberSpec`` property\r\nwhich would emit a warning on validation.\r\n\r\nNeither approach is great, however currently when I try to implement the second approach I noticed that the ``validate`` method is fired twice when supplying the property value to the constructor, causing the deprecation warning to be duplicated. Suggestions welcome on how to correctly perform this deprecation, it would also good to figure out why the value is being set and validated twice in the constructor."},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/267094843","html_url":"https://github.com/bokeh/bokeh/issues/5562#issuecomment-267094843","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/5562","id":267094843,"user":{"login":"mattpap","id":27475,"avatar_url":"https://avatars.githubusercontent.com/u/27475?v=3","gravatar_id":"","url":"https://api.github.com/users/mattpap","html_url":"https://github.com/mattpap","followers_url":"https://api.github.com/users/mattpap/followers","following_url":"https://api.github.com/users/mattpap/following{/other_user}","gists_url":"https://api.github.com/users/mattpap/gists{/gist_id}","starred_url":"https://api.github.com/users/mattpap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattpap/subscriptions","organizations_url":"https://api.github.com/users/mattpap/orgs","repos_url":"https://api.github.com/users/mattpap/repos","events_url":"https://api.github.com/users/mattpap/events{/privacy}","received_events_url":"https://api.github.com/users/mattpap/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T17:15:36Z","updated_at":"2016-12-14T17:15:36Z","body":"Maybe use this:\r\n```\r\nrows = NumberSpec(None, help=\"\"\"\r\n    The numbers of rows in the images\r\n    \"\"\").asserts(lambda _, __: False, \"rows is deprecated, bla\", soft=True)\r\n```\r\nThough it would be nice to use `bokeh.util.deprecation` for this. We could extend `asserts()` accordingly."}}
{"actor":{"display_login":"mattpap"}}