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

Auto-bootstrap of kernel-aware libraries #28

Closed
andrus opened this issue Jul 6, 2024 · 1 comment
Closed

Auto-bootstrap of kernel-aware libraries #28

andrus opened this issue Jul 6, 2024 · 1 comment
Milestone

Comments

@andrus
Copy link
Contributor

andrus commented Jul 6, 2024

Currently to use DFLib with Jupyter, you need to do this at the minimum:

%maven org.dflib:dflib-jupyter:1.0.0-M22 

import org.dflib.jupyter.*;
import org.dflib.*;

DFLibJupyter.init(getKernelInstance());

Would be great if only the first line above was needed, and connection to the kernel and default imports were added behind the scenes. After all, Jupyter is all about quick prototyping and experimentation.

So maybe we can support ServiceLoader (aka META-INF/services/xyz.MyLoader) "plugin" mechanism to allow dependencies to initialize themselves.

Other considerations

  • Is there a similar mechanism in Jupyter Python to make sure we don't reinvent the wheel?
  • We should be careful here. People already complain that adding the default hardcoded imports is too opinionated (is it possible to limit which java packages require no import statements? SpencerPark/IJava#156) . So likely we'll also need a new JJ_ variable that turns off the auto-loading behavior. This also presents an opportunity to implement the currently-hardcoded imports via auto-loading that can be optionally turned off
  • This competes with JJAVA_STARTUP_SCRIPT and JJAVA_STARTUP_SCRIPTS_PATH functionality, however I think the solution here is better - it allows to bootstrap things per-library, not per environment (and ultimately avoid custom configuration)
@andrus andrus changed the title Auto-bootstrap kernel-aware libraries Auto-bootstrap of kernel-aware libraries Jul 6, 2024
@stariy95 stariy95 added this to the 1.0-M3 milestone Aug 22, 2024
@stariy95
Copy link
Member

Mechanics are here, but need to make the API publicly available (see #36)

stariy95 added a commit that referenced this issue Sep 2, 2024
  - minor code refactoring
  - JavaDoc
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

No branches or pull requests

2 participants