I occasionally want to update a parameter without triggering the methods that depend on it. However, I still want the parameter widget in the GUI to update.
Here is a simple example:
class Demo(param.Parameterized):
a = param.Number(default=4)
@param.depends('a', watch=True)
def a_trigger(self):
print('a was triggered')
def panel(self):
return pn.Column(
self.param.a,
)
d = Demo()
d.panel()
In the first cell the method with the print statement is triggered, and the widget value updates.
In the second cell the method is not triggered nor is the widget updated.
Is there some way to not trigger the method, but still update the widget value?
@philippjfr I just ran into this issue again, and I remember discussing, at some point, a possible solution like having precedence argument to control when params are triggered. I thought there was an issue for it, but I can’t seem to find it now. Do you remember if we documented that anywhere?
Edit: I got more creative with my searching and was able to find the issue:
I filed the issue with Panel, but perhaps Param would be a better place for it.