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

Allow dictionaries as Dimension specs #2315

Closed
philippjfr opened this issue Feb 7, 2018 · 2 comments
Closed

Allow dictionaries as Dimension specs #2315

philippjfr opened this issue Feb 7, 2018 · 2 comments

Comments

@philippjfr
Copy link
Member

philippjfr commented Feb 7, 2018

When constructing an element and you want to supply explicit dimension ranges (or values, or any of the other Dimension attributes) you currently have to supply explicit Dimension objects or use redim after the fact:

hv.Image(..., vdims=hv.Dimension('Temperature', range=(0, 30)))

hv.Image(..., vdims='Temperature').redim.range(Temperature=(0, 30))

Being able to define Dimensions with dictionaries in the constructor can in some cases be nicer and more readable:

hv.Image(..., vdims={'name': 'Temperature', 'range': (0, 30)})

and also just matches what is already valid in redim:

hv.Image(...).redim(z={'name': 'Temperature', 'range': (0, 30)})
@jlstevens
Copy link
Contributor

I don't have any strong objection to this really. My main concern is that there may be too many ways of doing the same thing already and that impacts readability.

Copy link

This issue 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 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants