Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise warning when size_index set to non-numeric dimension #1011

Merged
merged 3 commits into from Dec 11, 2016

Conversation

Projects
None yet
2 participants
@philippjfr
Copy link
Contributor

philippjfr commented Dec 10, 2016

As suggested in #982 currently you get an uninformative exception when setting the size_index option to a non-numeric dimension. This raises a warning and adds unit tests to ensure the warning is raised.

@philippjfr philippjfr added the bokeh label Dec 10, 2016

@philippjfr philippjfr requested a review from jlstevens Dec 10, 2016

@philippjfr philippjfr added this to the v1.7.0 milestone Dec 10, 2016

@philippjfr philippjfr force-pushed the point_size_warning branch from c95f06a to b06636a Dec 10, 2016

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Dec 11, 2016

I think you could shorten this a bit and avoid some repetition with something like:

sizes =  self._apply_size_index(element, self.size_index)

This could be implemented in a common base class and would always return sizes, issuing the warning when the dimension type is inappropriate.

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Dec 11, 2016

This could be implemented in a common base class and would always return sizes, issuing the warning when the dimension type is inappropriate.

I've so far refrained from shared baseclasses for ElementPlots because a fair amount of the API is different. I'd be happy to factor it out into the shared compute_sizes function that already exists.

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Dec 11, 2016

I'd be happy to factor it out into the shared compute_sizes function that already exists.

That also makes sense.

@philippjfr philippjfr force-pushed the point_size_warning branch from 21e991a to 0970453 Dec 11, 2016

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Dec 11, 2016

Unfortunately I didn't manage to factor out much, the warning needs the dimension and element name to be useful and I didn't want to add even more arguments to the compute_sizes function.

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Dec 11, 2016

Ok, nevermind then. Merging.

@jlstevens jlstevens merged commit 4d0d2a3 into master Dec 11, 2016

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 76.022%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the point_size_warning branch Jan 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.