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

This comment has been minimized.

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

This comment has been minimized.

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 Sep 20, 2019
@philippjfr philippjfr merged commit d36f53c into master Sep 20, 2019
2 of 4 checks passed
2 of 4 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.03%) to 88.13%
Details
@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
Projects
None yet
2 participants
You can’t perform that action at this time.