-
Notifications
You must be signed in to change notification settings - Fork 106
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
Notebook API #99
Notebook API #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally to the comments above, I think that use
should be a function of the notebook, so it could be called both by magics and by implementing and calling library descriptor manually.
jupyter-lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/api.kt
Outdated
Show resolved
Hide resolved
} | ||
|
||
interface ResultsAccessor { | ||
operator fun get(i: Int): Any? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can understand this hold asynchronous results. I think it is worth using coroutines here.
jupyter-lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/api.kt
Outdated
Show resolved
Hide resolved
jupyter-lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/api.kt
Outdated
Show resolved
Hide resolved
...lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/libraryConnection.kt
Outdated
Show resolved
Hide resolved
jupyter-lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/results.kt
Outdated
Show resolved
Hide resolved
776b775
to
9bb51cb
Compare
334178a
to
1dd527c
Compare
f3d1a44
to
863e60d
Compare
15d114f
to
cc43a4b
Compare
03acc4a
to
a31f4d1
Compare
8bb119a
to
8837bb4
Compare
Currently not working because of https://youtrack.jetbrains.com/issue/KT-44580
…into abstract method
…nd 'repositories' methods
f39e3c8
to
251ed4c
Compare
0101278
to
e61fccd
Compare
e61fccd
to
13e62d1
Compare
05250f0
to
c047191
Compare
This PR adds notebook API which is published as a separate artifact and may be used with any Kotlin library to integrate it with this kernel.
Some highlights:
notebook
property is now availible in every cell, and it exposes the API. You may define, say,fun f(nb: Notebook<*>)
and then call it in the notebook likef(notebook)
Notebook
interface gives an access to cells and execution resultsCodeCell
gives an access to code, streams and results of a given cellRenderable
interface, once implemented by your custom class, makes it renderableDisplayResult
interface is a "final" representation of your objects to be displayed withdisplay_data
notebook.host.updateDisplay
functionRelates to #20, #76, #88, #78