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 get_param_values() to work for Parameterized classes? #162

Closed
ceball opened this issue Jun 24, 2017 · 1 comment
Closed

Allow get_param_values() to work for Parameterized classes? #162

ceball opened this issue Jun 24, 2017 · 1 comment

Comments

@ceball
Copy link
Contributor

ceball commented Jun 24, 2017

I think it would be reasonable for Parameterized.get_param_values() to work for a class as well as an instance. What do you think?

>>> class A(param.Parameterized):
...    x = param.Number(1)

>>> a = A()
>>> a.get_param_values()
[('name', 'A00009'), ('x', 1)]
>>> A.get_param_values()
[...]
TypeError: get_param_values() missing 1 required positional argument: 'self'

Should be a straightforward change to use @bothmethod. I guess onlychanged=True would only make sense for an instance, but I don't think it matters much.

@ceball ceball changed the title get_param_values() does not work for Parameterized classes Allow get_param_values() to work for Parameterized classes? Jun 24, 2017
@jbednar
Copy link
Member

jbednar commented Jun 24, 2017

Sounds good!

@ceball ceball closed this as completed in 20a806b Jun 27, 2017
ceball added a commit that referenced this issue Jun 27, 2017
Allow get_param_values() to work on class (fixes #162).
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

2 participants