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

All the async demos are broken #4561

Closed
s22chan opened this issue Mar 26, 2023 · 13 comments
Closed

All the async demos are broken #4561

s22chan opened this issue Mar 26, 2023 · 13 comments
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@s22chan
Copy link
Contributor

s22chan commented Mar 26, 2023

see https://panel.holoviz.org/user_guide/Async_and_Concurrency.html

possibly related to #4240 and #3882

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Mar 26, 2023
@philippjfr philippjfr added this to the v1.0.0 milestone Mar 26, 2023
@SarahG-579462
Copy link

Specifically, for the concurrency demo, they seem to work for me in my jupyter notebook, but not on my panel.show()

@SultanOrazbayev
Copy link
Contributor

And they seem to work when using .servable() and executing via panel --show.

@philippjfr
Copy link
Member

Thanks everyone, so to be clear the only scenario where they don't work is when using .show() from a notebook?

@SultanOrazbayev
Copy link
Contributor

I'm using this as standalone scripts. Here's a reproducible example (requires one pip install):

# assume this is in file app.py
import panel as pn
import param

# pip install ipyaladin==0.2.1
from ipyaladin import Aladin

pn.extension(
    "ipywidgets",
)


class Test(param.Parameterized):
    def __init__(self):
        super().__init__()

        # add ipyaladin view
        self.aladin = Aladin(
            target="12 25 41.676 +12 48 37.81",
            show_coo_grid=True,
            coo_frame="icsr",
            fov=1,
        )

    def ipyaladin_view(self):
        return pn.panel(
            self.aladin,
            defer_load=True,
            width=800,
        )


app = pn.template.BootstrapTemplate()
app.main.append(Test().ipyaladin_view)
app.show()

If I run the above with:

python app.py
# AttributeError: 'DummyComm' object has no attribute 'kernel'

If I change the last line in the snippet to app.servable() and run it via panel serve --show app.py, it works fine. (Sometimes I get a javascript error, but it usually disappears after refresh or two.)

@philippjfr
Copy link
Member

@SultanOrazbayev Yeah, that can't work. If you run the app as a regular script ipywidgets has no idea that it is running inside a Panel app, for this to work you should rewrite it to:

def app():
    app = pn.template.BootstrapTemplate()
    app.main.append(Test().ipyaladin_view)
    return app

pn.serve(app)

@philippjfr
Copy link
Member

Cannot really reproduce any other issues here, at least on main.

@philippjfr
Copy link
Member

If this persists please reopen with precise step-by-step instruction to reproduce.

@s22chan
Copy link
Contributor Author

s22chan commented May 2, 2023

by can't repro, do you mean you can goto https://panel.holoviz.org/user_guide/Async_and_Concurrency.html and interact with any of the widgets and something happens?

@hoxbro
Copy link
Member

hoxbro commented May 3, 2023

You should go to the dev website: https://pyviz-dev.github.io/panel/how_to/callbacks/async.html

@s22chan
Copy link
Contributor Author

s22chan commented May 3, 2023

that one works for you? same issue for me, none of the buttons or sliders do anything (on multiple browsers)

@MarcSkovMadsen
Copy link
Collaborator

Is it because something's get cached in the browser, so people also have different experiences?

@MarcSkovMadsen
Copy link
Collaborator

On my iPhone the dev docs example keeps loading aiohttp forever

image

@hoxbro
Copy link
Member

hoxbro commented May 3, 2023

I added aiohttp to dependencies without testing it, but it is not supported in Pyodide aio-libs/aiohttp#7253.

@hoxbro hoxbro mentioned this issue May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

6 participants