-
Notifications
You must be signed in to change notification settings - Fork 184
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
Magic Command #43
Comments
It is by design:
The issue here is not the lack of magics, but the fact that currently I will implement a handler for |
Thanks @n-riesco ! Your comment is very helpful. btw, have you looked at the jupyter-nodejs project? I have always used yours but I'm wondering what are the pros and cons of each. As the person who built ijs, I think you know more about the details and feature set more than anyone else! ^_^ |
Hi @n-riesco! Thanks for this project. |
@episodeyang and @beilharz Sorry about the silence (other commitments are keeping me busy). I will comment on this further in the future, but for the time being I will refer you to what I wrote at jupyter-nodejs issue #4. |
I think the magic command would really make sense; then one can add the "npm install xxx" in the top cell of a worksheet. Otherwise one has to run this installs in the terminal, and there they can get easily lost. |
@awb99 The main problem with magics is that they aren't valid Javascript statements. Imagine the following case. Let's say we are using Hydrogen and the IPython kernel to write our code. Then, we end up with a file, that looks like a python script, but it isn't. And it can only be run within Hydrogen. I also gave above a simple example of how you easy is to run child_process.execSync("npm install superagent"); |
@n-riesko I understand your point. Let me give my point: I am using Jupyter/python to do data mining, experiments and prototyping in python. I now have integrated your Javascript kernel into my Jupyter docker image and want to start being productive in Javascript. Now one mayor issue I use the ! Function is to install dependencies via pip (python package manager). I think the same is true for Javascript with Npm. Also on python! Is not correct syntax. The developers of Jupyter have spent 15 years in designing it so it works very seamlessly in python. I think the features that they have added will make sense in other languages too. However is not the most important feature as it can be done in the terminal also. More important is it to be able to use all. Kind of controls (sliders /combo box /...) that python has to bind to models. This should be much easier in Javascript than in python I guess. This controls cannot be done in a terminal; therefore are more important. |
@awb99 I think your last comment brings up a different subject: notebook extensions and interactive output (sliders, combo box). I'm very interested in getting IJavascript and Plotly.js working seamlessly. IJavascript already provides some tools to customise its HTML output. And although I was planning to advertise this in the next major release of IJavascript, there is new functionality already available in the latest version. See a brief tutorial here and here. |
@n-riesco Very cool! BTW this is a working docker image that I created that uses ijavascript (it also has python 2 and python 3) : https://github.com/awb99/myjupyter/blob/master/node/Dockerfile |
I really really would like to see the magic command |
@crutchcorn This isn't really a question about magics. The functionality for Unfortunately, If you want to use
BTW, |
@n-riesco I'm really dumb, sorry for bothering 😅 |
@crutchcorn Not bothering at all! And it wasn't a dumb question! |
Linking to #157 (comment) to help people find the issue opened to discuss this matter. |
#229 proposes an API to add commands. A proof of concept is here and a working package can be found here. Here's a demo of the proposal in action: There are a few TODO's sprinkled throughout the code and it may make sense to hang the API off of the |
@apowers313 The reason jp-kernel exists is so that a project like yours doesn't have to deal with forking (and also to encourage people to name their own kernels; IJavascript is a kernel with very stable requirements and API; other kernels may choose otherwise). In principle, the main burden for a project like yours would be fixing bugs related to magic commands. I'd deal with anything related to |
I've figured out that if I monkey patch Technically this could be a startup script ( The only downside I see (other than the ugliness of monkey patching) is that people who want magics would have to go through some additional configuration steps and / or pass some command line options every time they fire up Jupyter. Any thoughts about adding a Or some other way of making the user experience better for people that want magics? |
That's a neat idea!
Why wouldn't Another option is setting |
I think that might work, I just didn't like the idea of making the user type that on the command line every time. I can use a postinstall script with some combination of |
As a user, I wouldn't want a kernel modify kernelspecs I have already installed. And as maintainer of IJavascript, I don't want the users of your kernel to think they are using the IJavascript kernel. |
Here's a solid working beta version: I'm going to use it for a few weeks and then I'll bump it to 1.0. If anyone finds bugs, feel free to submit issues. Any chance you'd be willing to throw a mention / link in the IJavascript README? |
Hi @n-riesco,
Thanks for this fantastic library! I am trying to run some command line command in the notebook, and realized that the iPython magic commands are not available.
For example, I was thinking about doing:
but then it turned out that this is recognized as invalid javascript.
Is this by design?
Best,
Ge
The text was updated successfully, but these errors were encountered: