Hi everyone, I was just struggling for a couple of hours with a RecursionError
in the my param
class. I thought I’d be interesting to share my experience. In the following code you can find a minimal working example showing which fails to work:
import panel as pn
import param
import hvplot.pandas
import pandas as pd
import numpy as np
import holoviews as hv
df_all = pd.DataFrame(data=np.random.normal(size=100).cumsum(),columns=['col1'])
class Flex_datas(param.Parameterized):
df = param.DataFrame(default=df_all)
col1 = pn.widgets.RangeSlider(name='col1',start=df_all.col1.min(),end=df_all.col1.max())
def __init__(self,**params):
super().__init__(**params)
self.layout = pn.Row(self.col1,self.view)
@pn.depends('col1')
def view(self):
querystring = f'col1>{self.col1.value[0]} & col1<{self.col1.value[1]}'
self.df = df_all.query(querystring)
return hv.Layout([self.df.hvplot.scatter(y=col,label=col) for col in self.df.columns])
f = Flex_datas()
f.layout
Eventually, by constructing the minimal example above, I was able to figure out what was going on…