Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    martinRenou
    @martinRenou
    I tried your code in Jupyter Notebook and it seems to behave the same way
    Duc Trung Le
    @trungleduc
    In Google Chrome, you need to activate Pop-ups and redirects option to make it works as intended
    popup.png
    martinRenou
    @martinRenou
    yeah I was wondering if it was something like that. Maybe the browser prevents you from opening too many new pages.
    maybe showing links instead of a button is what would be less surprising for the user?
    joseberlines
    @joseberlines
    image.png
    Thanks all. A colleague told me it runs on his side. It is very erratic, i.e. I still can not manage to make it work. Since I am working in jupyterHub I was wondering if this is a server-side thing or a client side thing. I will check out chrome options. and here it is:
    Indeed I had to change that option.
    what makes me think I have to think about other option (client side) since now I am going to get pop ups from other pages (probably).
    joseberlines
    @joseberlines
    After thinking about this situation for a bit I still find the situation a bit strange. Whatever settings you have in google chrome you can always open a link in other tab by clicking it. This is the behaviour of opening a new link rendering a notebook with voila. It is NOT a pop up. Its simply a new tab with a new link. Or am I wrong here (note: my knowledge of JS is very very limited)
    martinRenou
    @martinRenou
    This behavior actually makes sense. You don't want websites to be allowed to open as many new pages as they want, it could be the behavior of a potentially harmful website.
    joseberlines
    @joseberlines
    ok, thanks. I made a final test: here the gist:
    https://gist.github.com/joseberlines/8a5f0ba673d12034d69749cb831c2a88.js
    and indeed changing the dettings totally changes the behaiviour. that leaves me wondering what is the approach in a JupyterHub environment to launch voila-solutions made by your colleagues that are available through urls
    martinRenou
    @martinRenou
    The browser considers that the user clicking on links a different use-case than the page calling window.open by itself
    that's why I was saying earlier that showing links instead of using a custom button would maybe work better, and be less surprising from a user perspective
    and actually, having an HyperLink widget could maybe be a good addition to ipywidgets?
    joseberlines
    @joseberlines
    btw,more than the code itself perhaps the image shows better the desired behaiviour:
    image.png
    martinRenou
    @martinRenou
    if you think about it, you never have, anywhere on any website, a button or an image that opens multiple tabs at once
    joseberlines
    @joseberlines
    Of course the idea is not opening publically available websites, but jupyterhub based voila links. Different users might create different agregators of solutions.
    Wolf Vollprecht
    @wolfv
    you could open multiple JupyterLab Tabs :)
    joseberlines
    @joseberlines

    if you think about it, you never have, anywhere on any website, a button or an image that opens multiple tabs at once

    You are right. Perhpas the approach is somehow strange. But there is certainly a use case here. For a particular persona (type of user) and a particular task (task 1) 4 different jupyterHub voila based notebooks should be opened. For the same persona (user) but task 2, other different 5 notebook solutions should be opened. And this is totally transparent to the user, who does not even know what is python nor a notebook. the user is given a single url (the one displaying the above example). I am talking about an organization where 50 to 100 people might have code solutions in notebooks and where another 6000 people dont even know that is a notebook.

    I would be very interesting in knowing how jupyterHub based environments in big organisations go about "sharing work", also to people who are no coders. i.e. in an organization where everybody has access to the Hub anyone can render with coila notebook simply given an url. But you can not go around asking anyone to "open a notebook".
    Wolf Vollprecht
    @wolfv
    @joseberlines I don't know what your notebooks look like but maybe one way to make it simpler would be to have a single voila website that aggregates the multiple notebooks using a Tab view?
    joseberlines
    @joseberlines
    Hi @wolfv , thanks for suggesting, this is indeed one of the solutions, nevertheless it implies putting together stuff. INTEGRATING different solutions. For you to have an idea every of those solutions already include a bunch of menus and tabs and expansion panels. As analogy you can imagine that for doing job 1 you need MS word, and excel and for doing job two you need Word, MSexcel, powerpoint, and Access. Everyone is independent of each other. Every of the solutions is being developed by deifferent people. The agregator only opens word and excel for instance with url parameters in order to autoload the corresponding document. Putting excel and word in two tabs is not an option. Another analogy in the world of finance where JupyterHub is often used is having a complicated ipyvuetify based dashboard panel to invest in NYSE and another ipywidgets based dashboard for investing in raw materials. certainly in theory you could put both in two different tabs, but it is too much hacking. In a situation where there are, just say, 25 different dash boards, one starts to think about a kind of Launcher or aggregator. (as in pic above). I wonder how big tech companies go about this.
    Duc Trung Le
    @trungleduc
    @joseberlines in chrome you can just bookmark all your voila links into a folder and on right click you have option to open all tabs in a tab group.
    joseberlines
    @joseberlines
    @trungleduc thanks. thats a very good point, its a semi-solution, that would not allow for modifying urls "on the fly" with parameters. i.e. you might open a voila rendered notetebook of the jupytehub as www.blablabla.internal.org/voila/render/path/name.ipynb/?document=doc23456?api=QHWE?autorun=True?task=whatever were the parameters would be used as predefined default values to be prefilled in ipywidgets and/or ipyvuetify components. I am aiming at propagating default values across multiple notebooks.
    image.png
    A pic is worth a million words. In the above shown pic every APP is made by a different coder who DONT HAVE PRACTICALLY ANY RELATION TO EACH OTHER.
    joseberlines
    @joseberlines

    and actually, having an HyperLink widget could maybe be a good addition to ipywidgets?

    @martinRenou everything that avoids the user to have to go to JavaScript is a super plus. When bringing engineers to code who dont have CS background, neither any coding experience, speaking about more than one single language (being Python) is a no go. The moment you go: "well for this you need JS or HTML or..." its over. One of the superpowers of jupyterHub is that is one environment - one language. full stop. Its the most convenient place for non-CS background people.

    Duc Trung Le
    @trungleduc
    something like this with ipyvuetify can do the job
    ipyvuetify.Btn(children=["Link button"], href="https://www.google.com/", target="_blank" )
    John H. Ayad
    @johnhany97
    Hey - i was reading the 2021 review, loads of great cool things going on there! I was wondering where is do you currently have the code for the quetz plugin that does pypi wheels to conda packages conversion on the fly?
    joseberlines
    @joseberlines
    @trungleduc thats great. Can you shortly comment what is target="_blank" for? (in vuetify page stays: #target
    string
    undefined
    Designates the target attribute. This should only be applied when using the href prop.) Still not clear there what is the target
    1 reply
    @johnhany97 Thanks! We tried to add that to grayskull: conda-incubator/grayskull#218
    it might need some additional love :)
    DougRzz
    @DougRzz
    Hi. I have an issue with Voila that i cant seem to narrow down where the issue is coming from. I am using either v0.2.x or v0.3 and I'm having an issue with a particular dashboard/Notebook. The Notebook works well in Jupyter. Voila works OK for all Notebooks except just one problem Notebook. I have the same issue on 2 separate machines. Please can anyone give me some clues on what i should be looking for. I can't supply the Notebook unfortunately. 2022-01-12 13-05-10_Start.png. The image is a screenshot of the console error.
    1 reply
    vakokako
    @vakokako
    Hey, I have a question about c++ <-> python interop. xtensor-python does a great job of describing how to use c++ code from python, do you have any preffered way when the other way around is needed, i.e. using python code in c++?
    Wolf Vollprecht
    @wolfv
    @vakokako you can also do that with pybind11
    we are actually doing that extensively in xeus-python
    for example you can pass a python function to pybind and it converts it automatically to a std::function IIRC
    martinRenou
    @martinRenou
    you can also in C++ use the py::object APIs.
    vakokako
    @vakokako
    interesting, will check it out, thanks
    martinRenou
    @martinRenou
    the equivalent in Python would be something like:
    import ast
    import builtins
    
    # Parse code to AST
    code_ast = ast.parse(code_copy, "<string>", "exec")
    expressions = code_ast.body
    basically, accessing attributes and methods of a py::object is done using .attr("property_or_method")
    eyalk11
    @eyalk11
    Also, maybe in the future , make the user able to change cells there (maybe...), and rerun (like with shift-enter).
    eyalk11
    @eyalk11
    One last thing. I am using it through qt-voila inside qt app, and debugging with pycharm. It creates python process with Popen and sys.executable -m voila . Then , it creates a process of python pydevd.py (jetbrains debugger agent) with ipykernel , so that it somehow entangled in the same pycharm kernel, and if I do a syntax mistake inside the notebook, it crashes. Also, can't stop it . But I guess that is solveable..
    NSW1985
    @NSW19851_twitter
    I am using voila for a real-time app, I have a loop which is a sync and updates a widget / bqplot continuously as data comes in. But once in awhile a client browser will see that it’s stop updating ... if I check the voila server it would have error message stating web socket is closed. Are there any ways to restart dead connection or any parameters that may help with that ?
    DHUK
    @DHUKK
    Hi i am trying to set the file_whitelist (running voila with jupyterhub and cdsdashboards). I have tried as a command line arg passed to voila: --VoilaConfiguration.file_whitelist="['.']. I have also tried from my jupyter_notebook_config.py with c.VoilaConfiguration.file_whitelist = ['.'] and neither have an affect. I can modify the configuration.py in the voila site-packages and that works, but isnt really a solution. Could anyone assist me with getting this working?
    Duc Trung Le
    @trungleduc
    @DHUKK For the complicated settings, I would suggest creating a file named voila.json in the directory where you start voila to define your parameters.
    For example, the following content will allow you to serve your media files with the URL .../voila/files/static/...
    {
        "VoilaConfiguration": {
            "file_whitelist": [
                ".*\\.(png|jpg|gif|svg|mp4|avi|ogg)"
            ]
        }
    }