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

Fixed Parameter __setstate__ bug #266

Merged
merged 1 commit into from Sep 19, 2018
Merged

Fixed Parameter __setstate__ bug #266

merged 1 commit into from Sep 19, 2018

Conversation

philippjfr
Copy link
Member

This is a somewhat subtle bug and I have no minimal example except for trying to run through the panel Param notebook and trying to set Example.unbounded_float = 3.14.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 76.836% when pulling 9f3e0a4 on fix_parameter_copy into 56764fd on master.

@philippjfr
Copy link
Member Author

philippjfr commented Sep 18, 2018

Actually, here is a minimal example of the bug:

import param

class A(param.Parameterized):
    
    a = param.Number(default=0)
    
class B(A):
    
    pass

B.param.watch(lambda x: x, 'a', 'bounds')

B.a = 3.14

@ceball
Copy link
Member

ceball commented Sep 18, 2018 via email

@philippjfr
Copy link
Member Author

That method is just a hack to allow watching of parameter metadata
(i.e. things other than value) - do we still need that?

Yes, I use it in panel and it works well.

I'd need to run it (or if you have a session where you
already ran it, maybe you could copy/paste that...?)

The example above leads directly to the traceback, it occurs when setting the parameter value on a subclass which did not define the parameter, because this triggers a copy operation on the parameter which in turn triggers __setstate__.

@ceball
Copy link
Member

ceball commented Sep 18, 2018

By the way, I'd be fine with this being merged and a new dev release being made so you can proceed with panel.

We can discuss more if necessary when reviewing the whole mechanism later on.

@jbednar jbednar merged commit 447e7c1 into master Sep 19, 2018
@jbednar jbednar deleted the fix_parameter_copy branch September 19, 2018 14:16
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

Successfully merging this pull request may close these issues.

None yet

4 participants