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

Parser and divide #1105

Closed
vascotenner opened this issue Feb 7, 2017 · 3 comments
Closed

Parser and divide #1105

vascotenner opened this issue Feb 7, 2017 · 3 comments
Assignees
Milestone

Comments

@vascotenner
Copy link
Contributor

In python 2, the division of two integers leads to a new integer. In python three, this is relaxed (will yield float). This behaviour can be used in python2 also. However, the optspec parser does not do this:

from __future__ import division
assert 0.75 == 3/4

%%opts Raster [aspect=3/4]
hv.Raster(np.random.randint((10,20))

Gives ZeroDivisionError

@philippjfr
Copy link
Member

Agreed, the parser module should simply import from __future__ import division.

@jlstevens
Copy link
Contributor

This has been fixed in the PR reference above. I'll close this issue once it is merged.

@jlstevens
Copy link
Contributor

The PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants