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

Notebook API #99

Merged
merged 125 commits into from
Feb 9, 2021
Merged

Notebook API #99

merged 125 commits into from
Feb 9, 2021

Conversation

ileasile
Copy link
Collaborator

@ileasile ileasile commented Sep 3, 2020

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 like f(notebook)
  • Notebook interface gives an access to cells and execution results
  • CodeCell gives an access to code, streams and results of a given cell
  • Renderable interface, once implemented by your custom class, makes it renderable
  • DisplayResult interface is a "final" representation of your objects to be displayed with display_data
  • displayed data may be also updated by notebook.host.updateDisplay function

Relates to #20, #76, #88, #78

Copy link
Contributor

@altavir altavir left a 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.

}

interface ResultsAccessor {
operator fun get(i: Int): Any?
Copy link
Contributor

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.

@ileasile ileasile force-pushed the notebook-api branch 2 times, most recently from 776b775 to 9bb51cb Compare September 15, 2020 15:23
@altavir altavir mentioned this pull request Sep 18, 2020
@ileasile ileasile force-pushed the notebook-api branch 2 times, most recently from 334178a to 1dd527c Compare October 16, 2020 10:44
@ileasile ileasile force-pushed the notebook-api branch 4 times, most recently from f3d1a44 to 863e60d Compare November 4, 2020 03:32
@ileasile ileasile force-pushed the notebook-api branch 7 times, most recently from 15d114f to cc43a4b Compare November 23, 2020 05:17
@ileasile ileasile force-pushed the notebook-api branch 10 times, most recently from 03acc4a to a31f4d1 Compare December 3, 2020 22:17
@ileasile ileasile force-pushed the notebook-api branch 3 times, most recently from 8bb119a to 8837bb4 Compare December 21, 2020 23:04
@ileasile ileasile force-pushed the notebook-api branch 4 times, most recently from 0101278 to e61fccd Compare February 9, 2021 01:17
@nikitinas nikitinas merged commit dd04fad into master Feb 9, 2021
@ileasile ileasile deleted the notebook-api branch February 9, 2021 19:10
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

Successfully merging this pull request may close these issues.

3 participants