holoviz / holoviz/param

Should methods on Parameterizeds be treated as references by default

Open
#936 3 comments 0 reactions 0 assignees View on GitHub
status: discussion
Dominant language
Python
Stars
521
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
35

Description

panel==1.4.1

When using a parameterized class methods that are not explicitly annotated with `.depends` my understanding is that they implicitly depend on all class parameters. Thus I should be able to use them as references just as methods marked with `.depends`.

I cannot when using Tabulator.

```python
import panel as pn
import param
import pandas as pd

pn.extension()

class CustomComponent(pn.viewable.Viewer):
value = param.Integer(default=2, bounds=(1,10))

# @param.depends("value")
def data(self):
return pd.DataFrame({"x": [self.value]*self.value})

def __panel__(self):
return pn.Column(
self.param.value,
pn.widgets.Tabulator(self.data, pagination="remote", page_size=10)
)

pn.extension("tabulator")
CustomComponent().servable()
```

![image](https://github.com/holoviz/panel/assets/42288570/d9147fe7-b427-4f86-9aac-9d72adfc7a98)

It works without the using Tabulator or if I `.depends` on the `value`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.