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

Can't display pipeline layout two times #179

Closed
xavArtley opened this issue Dec 11, 2018 · 0 comments
Closed

Can't display pipeline layout two times #179

xavArtley opened this issue Dec 11, 2018 · 0 comments

Comments

@xavArtley
Copy link
Collaborator

To reproduce the error I just done the user guide notebook:
https://panel.pyviz.org/user_guide/Pipelines.html

import param
import panel as pn
import holoviews as hv

pn.extension()

class Stage1(param.Parameterized):
    
    a = param.Number(default=5, bounds=(0, 10))

    b = param.Number(default=5, bounds=(0, 10))
    
    @param.output(c=param.Number)
    def output(self):
        return self.a * self.b
    
    @param.depends('a', 'b')
    def view(self):
        return pn.pane.LaTeX('$%s * %s = %s$' % (self.a, self.b, self.output()))

    def panel(self):
        return pn.Row(self.param, self.view)

class Stage2(param.Parameterized):
    
    c = param.Number(default=5, precedence=-1, bounds=(0, None))

    exp = param.Number(default=0.1, bounds=(0, 3))
    
    @param.depends('c', 'exp')
    def view(self):
        return pn.pane.LaTeX('${%s}^{%s}={%.3f}$' % (self.c, self.exp, self.c**self.exp))

    def panel(self):
        return pn.Row(self.param, self.view)

stages = [
    ('Stage 1', Stage1),
    ('Stage 2', Stage2)
]

pipeline = pn.pipeline.Pipeline(stages)

First display is ok :
image

However second one:
image
.
image

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

No branches or pull requests

1 participant