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

Setting opts with Options without a spec errors #3569

Closed
philippjfr opened this issue Mar 21, 2019 · 1 comment · Fixed by #4032
Closed

Setting opts with Options without a spec errors #3569

philippjfr opened this issue Mar 21, 2019 · 1 comment · Fixed by #4032
Assignees
Labels
tag: component: options type: bug Something isn't correct or isn't working
Milestone

Comments

@philippjfr
Copy link
Member

This code breaks with a pretty useless error:

opts = hv.opts(width=100)
(hv.Curve([1, 2, 3]) * hv.Curve([1, 2, 3])).opts(opts)
~/development/holoviews/holoviews/util/__init__.py in _expand_options(cls, options, backend)
    335 
    336         for objspec, options in options.items():
--> 337             objtype = objspec.split('.')[0]
    338             if objtype not in backend_options:
    339                 raise ValueError('%s type not found, could not apply options.'

AttributeError: 'NoneType' object has no attribute 'split'

The behavior I had assumed was implemented here is that an Options object without a spec would use the spec of the object it is applied to.

@philippjfr philippjfr added type: bug Something isn't correct or isn't working tag: component: options labels Mar 21, 2019
@jlstevens
Copy link
Contributor

For container types, I think an explicit spec is always clearest and safest. Given that the behavior of hv.opts without a spec is a dubious as it is, I did not consider implementing this behavior a priority (in fact it didn't even occur to me).

I don't particularly like the implicit behavior much but I suppose that it should be implemented for consistency with what happens when you supply keywords only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: component: options type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants