Skip to content
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

Resolve dependent functions in Dynamic operations #3975

merged 1 commit into from Sep 20, 2019


Copy link

@philippjfr philippjfr commented Sep 19, 2019

This makes it possible to provide a function which declares param dependencies in .apply and in operations, e.g.:

@pn.depends(field.param.value, agg_fn.param.value)
def aggregator(field, agg_fn):
    field = None if field == "counts" else field
    return agg_fn(field)

datashade(..., agg=aggregator)
# or
obj.apply(datashade, agg=aggregator)

This complements the ability to use functions with dependencies as DynamicMap callbacks.

Cc: @jbednar

Copy link

jbednar commented Sep 19, 2019

Excellent! I can't test it because my new laptop doesn't have Xcode yet and I'm having Apple ID problems, but it certainly looks like it would work...

Copy link

jbednar commented Sep 19, 2019

Ok, I've tested it and it works perfectly! You can see the result at , comparing it to the Param-based version at . The main remaining awkwardness in that notebook is the constant .param.value invocations, which would be addressed by #3976 and changes already in Panel master that will be in 0.7.0.

@philippjfr philippjfr force-pushed the philippjfr/resolve_dependent_function branch from 3cf8a22 to f276083 Compare Sep 20, 2019
@philippjfr philippjfr merged commit d36f53c into master Sep 20, 2019
2 of 4 checks passed
@philippjfr philippjfr deleted the philippjfr/resolve_dependent_function branch Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants