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

Define Dimension formatters for numpy integer types #1009

Merged
merged 1 commit into from
Jan 18, 2017
Merged

Conversation

philippjfr
Copy link
Member

As described in #975, widgets do not correctly format integers at the moment. This is easily fixed by defining Dimension.type_formatters for the numpy integer types.

@jlstevens
Copy link
Contributor

Looks good and I a happy to merge once the tests are passing.

The only suggestion I have is to investigate whether there is an easy way to iterate over all numpy integer types - if so, iterating over them would be better than having to list them all explicitly this way.

@philippjfr philippjfr added this to the v1.7.0 milestone Dec 10, 2016
@philippjfr
Copy link
Member Author

philippjfr commented Dec 11, 2016

The only suggestion I have is to investigate whether there is an easy way to iterate over all numpy integer types.

As long as we are treating them all as separate types I prefer to be explicit about it. I do think that rather than specifying it by an actual type it might be more useful to declare that all integer types should respect the formatter. May we should consider whether int and float formatters should also apply to all numpy types where dtype.kind=='i' and dtype.kind=='f' respectively, if no more specific formatter has been set.

@philippjfr
Copy link
Member Author

Apparently this has resulted in small changes in the bokeh table tests. Will update.

@philippjfr
Copy link
Member Author

@jlstevens Any opinions on my comment above?

@jlstevens
Copy link
Contributor

jlstevens commented Jan 4, 2017

...it might be more useful to declare that all integer types should respect the formatter

I think I agree that this makes sense.

May we should consider whether int and float formatters should also apply to all numpy types where dtype.kind=='i' and dtype.kind=='f' respectively, if no more specific formatter has been set.

Sounds reasonable for scalars...I assume the formatters won't do a good job for arbitrary arrays.

Edit: Note that I am happy to merge if you want to tackle these other ideas later.

@philippjfr
Copy link
Member Author

Let's go with this for now. Rebuilding test data shortly.

@jlstevens
Copy link
Contributor

The pr build passed. Merging.

@jlstevens jlstevens merged commit 4624484 into master Jan 18, 2017
@philippjfr philippjfr deleted the integer_format branch January 27, 2017 02:53
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants