-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Enhance resolve_dependent_value if value is list or tuples #5184
Conversation
Nice, presumably we also need to ensure that it actually watches the widget/parameter though. Don't recall how offhand so if you don't see a way let me know and I'll dig into it. |
I don't know if anything is needed in holoviews, but in hvplot the function |
This should now watch the widget/parameter. See: example.mp4The code: import holoviews as hv
import hvplot.pandas # noqa
import panel as pn
from bokeh.sampledata.autompg import autompg_clean as df
hv.extension("bokeh")
idf = df.interactive()
cylinders = pn.widgets.IntSlider(start=4, end=8, step=2, name="Cylinders")
mfr = pn.widgets.ToggleGroup(
options=["ford", "chevrolet", "plymouth", "honda", "sbaru", "volkswagen"],
value=["ford", "chevrolet", "plymouth", "honda", "sbaru", "volkswagen"],
)
xaxis = pn.widgets.RadioButtonGroup(name="X axis", options=["mpg", "yr"])
yaxis = pn.widgets.RadioButtonGroup(name="Y axis", options=["hp", "weight"])
ipipeline = (
idf[(idf.mfr.isin(mfr)) & (idf.cyl == cylinders)]
.groupby(["origin", xaxis])[yaxis]
.mean()
)
pn.Column(ipipeline.hvplot(by="origin"), sizing_mode="stretch_both").servable() I have noted the linecolor change when changing the yaxis, I don't know if this is a feature or a bug. |
I have added an unittest. When trying to run the test suite on my computer it stops at |
This is really cool, @hoxbro ! Does anyone know of other Pandas or Xarray API argument types that remain unsupported? So far it seems like scalars, lists, tuples, and dictionaries are handled. I don't expect there are any arguments that take sets? Any other containers worth adding? |
parameterized functions with dependencies on the supplied value. | ||
Resolves parameter values, Parameterized instance methods, | ||
parameterized functions with dependencies on the supplied value, | ||
including such parameters embedded in a list or tuple. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated again with dictionary but will wait with an update until a final decision have been made.
- Added recursive for tuple and list in resolve_dependent_value
68cb4b0
to
62dcdcc
Compare
@philippjfr , I'm eager to get this in place; is there anything else needed before merging, other than the docs fix above? |
Nice, all looks good. Will merge. |
Co-authored-by: James A. Bednar <[email protected]>
Was not updated in holoviz#5184
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Recursive calling
resolve_dependent_value
if value is a list or tuple. If this implementation crash and burn in the CI an alternative is the changes described here holoviz/hvplot#697 (comment).This PR should make it able to run:
Will add a unit test later this week.