martin-saurer / jkernel

Jupyter Notebook / J Integration
GNU General Public License v3.0
44 stars 15 forks source link

GitHub chokes on notebooks with this kernel #7

Closed DaneWeber closed 7 years ago

DaneWeber commented 7 years ago

GitHub chokes on notebooks with this kernel. Any ideas on the cause?

While it applies to my notebooks (I tested a notebook that has only a single markdown cell and no code), you can see the problem by trying to view of the example notebooks in this repo: https://github.com/martin-saurer/jkernel/blob/master/examples/Rain_Temperature.ipynb

GitHub will work for awhile and then display, "Sorry, something went wrong. Reload?"

Also compare the following https://github.com/Fluffums/MixerRepulsionMotes/blob/master/Simple%20Python%20Notebook.ipynb https://github.com/Fluffums/MixerRepulsionMotes/blob/master/Simple%20J%20Notebook.ipynb

This last notebook in particular, when I view the raw files, I notice that the Python notebook has some metadata missing from the J notebook.

Python:

 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}

vs. J:

 "metadata": {
  "kernelspec": {
   "display_name": "J",
   "language": "J",
   "name": "jkernel"
  },
  "language_info": {
   "file_extension": "ijs",
   "mimetype": "text/x-J",
   "name": "J"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
martin-saurer commented 7 years ago

@Fluffums Hmm... I will investigate in that issue, as soon as my time permits. But from a quick view, it doesn't surprise me that viewing a J notebook from within github does not work. On github there is no J infrastructure (as far as I know). So there is also no J kernel for jupyter notebook. The server part (when you start "jupyter notebook" on your local machine) includes all the needed J stuff. Not so on github. Please tell me if I'm wrong. How ever ... I will take a look at it.

DaneWeber commented 7 years ago

Displaying a notebook in GitHub should not involve running any code, and thus shouldn't involve a kernel, J or otherwise. If you look at the code in a Jupyter notebook, it includes all output, so which is what should be displayed.

Here a couple other working examples of languages where I'd doubt that GitHub is doing anything other than formatting the .ipynb for display:

iTorch: https://github.com/facebook/iTorch/blob/master/iTorch_Demo.ipynb

OCaml: https://github.com/andrewray/iocaml/blob/master/notebooks/iocaml-the-core-language.ipynb

But then here's a failing example of Q+KDB: https://github.com/jvictorchen/IKdbQ/blob/master/examples/QforMortals2_tables.ipynb

DaneWeber commented 7 years ago

Interestingly, the Jupyter nbviewer site handles the J notebooks just fine, so this really might be entirely on GitHub's side. http://nbviewer.jupyter.org/github/fluffums/MixerRepulsionMotes/blob/master/Simple%20J%20Notebook.ipynb

nbviewer's repo: https://github.com/jupyter/nbviewer

I wonder where GitHub's notebook viewer comes from, or if they're running an old broken version of Jupyter's nbviewer.

DaneWeber commented 7 years ago

I just opened an issue with nbviewer: https://github.com/jupyter/nbviewer/issues/644

DaneWeber commented 7 years ago

No follow up, but the notebooks are working in GitHub now, so that's good.