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
merged 1 commit into from
Sep 20, 2019

Conversation

philippjfr
Copy link
Member

@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

@jbednar
Copy link
Member

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...

@jbednar
Copy link
Member

jbednar commented Sep 19, 2019

Ok, I've tested it and it works perfectly! You can see the result at https://anaconda.org/jbednar/dashboard_barewidgets , comparing it to the Param-based version at http://datashader.org/dashboard.html . 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 September 20, 2019 09:18
@philippjfr philippjfr merged commit d36f53c into master Sep 20, 2019
@philippjfr philippjfr deleted the philippjfr/resolve_dependent_function branch September 20, 2019 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants