Giter Club home page Giter Club logo

Comments (7)

jtpio avatar jtpio commented on September 1, 2024

Thanks @TK-21st!

That would indeed be very useful. I guess another way would be to get a hold on the current notebook (either the current notebook or by accessing the currentWidget from the notebook tracker), and get the session context with:

opts = notebook.sessionContext()

from ipylab.

jtpio avatar jtpio commented on September 1, 2024

By the way if you feel like opening a PR (even as a draft), please don't hesitate!

from ipylab.

TK-21st avatar TK-21st commented on September 1, 2024

By the way if you feel like opening a PR (even as a draft), please don't hesitate!

Just did! WIP on reporting the current kernel back.

Also I tried to define a bunch of HasTraits to map the interface from JLab's Typescript API but I clearly do not understand how traitlets are supposed to work 🙄 so that's WIP too..

from ipylab.

TK-21st avatar TK-21st commented on September 1, 2024

The latest PR should have the feature necessary.

It was easy to show all sessions, since I can just expose app.serviceManager.sessions
It was a bit harder to make the currrentWidget work. I ended up exposing the private attribute app.shell._tracker which gives me access to the currently in focused widget and go from there.

Need to figure out linter still but it is functional

from ipylab.

TK-21st avatar TK-21st commented on September 1, 2024

Thanks @TK-21st!

That would indeed be very useful. I guess another way would be to get a hold on the current notebook (either the current notebook or by accessing the currentWidget from the notebook tracker), and get the session context with:

opts = notebook.sessionContext()

I opted for using tracker since I wanted to potentially get the session of console widgets too. Turns out that's not working.. Comm open error.
Looks actually like a problem with using ipywidget in console.

from ipylab.

jtpio avatar jtpio commented on September 1, 2024

opted for using tracker since I wanted to potentially get the session of console widgets too. Turns out that's not working.. Comm open error.
Looks actually like a problem with using ipywidget in console.

Right, the current JupyterLab widget manager does not handle consoles (yet).

from ipylab.

jtpio avatar jtpio commented on September 1, 2024

Fixed by #46.

from ipylab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.