-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
component: dynamic valuesstatus: discussionDiscussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.type-featureFeature requestFeature request
Milestone
Description
One thing that has frequently aggravates me about param is that there is no way (that I know of) to get at a dynamic value generator e.g a numbergen object. Perhaps there is a proper way to do this, but I have hacked in this method into my copy of param (on the Dynamic class) for the time being:
def get_generator(self, obj):
"""
Given a parameterized object, gets the dynamic value generator.
"""
return super(Dynamic,self).__get__(obj, obj.__class__)
This is still awkward to use, but better than nothing. Say I have an imagen.Gaussian
object and I want to fiddle the random number generator used for the orientation. Now I can do:
generator = gaussian.params('orientation').get_generator(gaussian)
Now for instance, I could change the time_fn
for this numbergen object.
Any thoughts? Is there already a better way of doing this?
Metadata
Metadata
Assignees
Labels
component: dynamic valuesstatus: discussionDiscussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.type-featureFeature requestFeature request