Opened 6 years ago

Closed 6 years ago

#19427 closed defect (fixed)

Jupyter R kernel

Reported by: vbraun Owned by:
Priority: major Milestone: sage-6.10
Component: packages: optional Keywords:
Cc: jdemeyer, charpent Merged in:
Authors: Volker Braun Reviewers: Emmanuel Charpentier
Report Upstream: N/A Work issues:
Branch: 7316730 (Commits, GitHub, GitLab) Commit: 731673067452f10e8f7aa62bba4d7004be05c76f
Dependencies: Stopgaps:

Status badges

Description (last modified by vbraun)

This introduces a new "script" type of packages that only run a script. This is supposed to be an alternative for optional/experimental packages so we can use third-party package managers to install things.

In this case, the R package manager, though it would presumably be useful for TexLive (instead of src/ext/texlive/texlive-install) and npm. But thats for future tickets...

Attachments (2)

Untitled3-native.pdf (47.7 KB) - added by charpent 6 years ago.
A few notebook commands with 6.10rc0+Trac#19427
Untitled3-19638.pdf (57.3 KB) - added by charpent 6 years ago.
A few notebook commands with 6.10rc0+Trac#19638(rpy2 update)+ manual installation of IRKernel

Download all attachments as: .zip

Change History (18)

comment:1 Changed 6 years ago by vbraun

  • Branch set to u/vbraun/jupyter_r_kernel

comment:2 Changed 6 years ago by vbraun

  • Authors set to Volker Braun
  • Cc jdemeyer added
  • Commit set to 2958d585514229caca197d73c34c1176c77210b6
  • Component changed from PLEASE CHANGE to packages: optional
  • Description modified (diff)
  • Status changed from new to needs_review
  • Type changed from PLEASE CHANGE to defect

New commits:

305f3e6Add new "script" type for packages
2958d58Install script for the R Jupyter kernel

comment:3 follow-up: Changed 6 years ago by vbraun

Note: need to bootstrap before the new make target is available, but since this is not urgent it can wait for the next beta release.

comment:4 in reply to: ↑ 3 Changed 6 years ago by jdemeyer

Could you please add a dependencies file (I guess this just depends on R).

comment:5 follow-up: Changed 6 years ago by vbraun

scripts depend on all standard packages (just like optional ones). It also depends on jupyter as it calls it to install its kernel specs. On the one hand it would be nice to have the dependencies explicit, but they would also just be wrong if we can't actually test them.

comment:6 in reply to: ↑ 5 Changed 6 years ago by jdemeyer

Replying to vbraun:

if we can't actually test them.

This describes a way to test dependencies: http://doc.sagemath.org/html/en/developer/packaging.html#package-dependencies

If make distclean && make base && make PACKAGE_NAME succeeds, the dependencies are probably correct.

I would certainly like to make dependencies mandatory, I am in the process of adding missing dependency files (see for example #19295).

comment:7 Changed 6 years ago by vbraun

Still, whats the point? Some packages can't be standard so depending on standard doesn't cost us anything. Whereas additional complexity, new ways of introducing dependency errors, and insufficient test coverage are very real downsides.

comment:8 Changed 6 years ago by jdemeyer

  • Status changed from needs_review to needs_work

Shouldn't the spkg-install script be run within a Sage shell at least?

comment:9 Changed 6 years ago by git

  • Commit changed from 2958d585514229caca197d73c34c1176c77210b6 to ef5a125d04b24694e5fca9b09d02ba36a19875dd

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8074932Add new "script" type for packages
0282c7eInstall script for the R Jupyter kernel
ef5a125Source sage-env before running spkg-install script

comment:10 Changed 6 years ago by vbraun

  • Cc charpent added
  • Status changed from needs_work to needs_review

New commits:

8074932Add new "script" type for packages
0282c7eInstall script for the R Jupyter kernel
ef5a125Source sage-env before running spkg-install script

Changed 6 years ago by charpent

A few notebook commands with 6.10rc0+Trac#19427

Changed 6 years ago by charpent

A few notebook commands with 6.10rc0+Trac#19638(rpy2 update)+ manual installation of IRKernel

comment:11 Changed 6 years ago by charpent

  • Status changed from needs_review to needs_work

Dear Volker,

  1. Great idea ! I am sure a lot of use cases exist in the Sagemath ecosystem.
  1. Your ticket (tested against a fresh clone of 6.10rc0) :
  • builds, and
  • passes ptestlong.
  • Installing r_jupyter effectively installs an R kernel in Sagemath's Jupyter notebook.
  • This notebook is functional (i. e. one can create a worksheet whose native language is R).
  1. However, over Sage 6.10rcO, the Rpy2 interface cannot be used in a Sagemath notebook :
  • The "%load_ext rpy2.ipython" command is not recognized
  • The "%load_ext rmagic" command is recognized (with a warning), but :
  • The %R (and %%R) commands are not recognized

You can compare these results (illustrated in "Untitled3-native.pdf") with those obtained on 6.10rc0+Trac#19638+manual installation of IRKernel in R, which also illustrates the problems with this current implementation :

  • uses a different instance of R than the Sage's pexpect interface
  • converts the output in strange formats, different from those used by Sages's pexpect interface.

If your goal was strictly limited to providing an R notebook in Sage's Jupyter, I think it's good to go. If you aimed at providing Sage with an alternative interface to R, it needs work (needs Trac#19638, IMHO, but I'm biased...).

I would be interested in your point of view in the question I posed in sage-devel. William's sarcastic non-answer misses a part of the point.

Sincerely yours,

comment:12 follow-up: Changed 6 years ago by vbraun

  • Status changed from needs_work to needs_review

This ticket has nothing to do with rpy2, its only about the jupyter R kernel. Really they are two totally independent approaches to using R, one from within Python and the other without Python.

comment:13 in reply to: ↑ 12 Changed 6 years ago by charpent

  • Reviewers set to Emmanuel Charpentier
  • Status changed from needs_review to positive_review

Replying to vbraun:

This ticket has nothing to do with rpy2, its only about the jupyter R kernel. Really they are two totally independent approaches to using R, one from within Python and the other without Python.

[ Sorry for the delay. I was busy... ]

Okay. This clarification (that should go in the description) enables positive review.

comment:14 Changed 6 years ago by git

  • Commit changed from ef5a125d04b24694e5fca9b09d02ba36a19875dd to 731673067452f10e8f7aa62bba4d7004be05c76f
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:

ba549f3Add new "script" type for packages
753f7bcInstall script for the R Jupyter kernel
4990f59Source sage-env before running spkg-install script
7316730Bump confball version since configure.ac changed

comment:15 Changed 6 years ago by vbraun

  • Status changed from needs_review to positive_review

comment:16 Changed 6 years ago by vbraun

  • Branch changed from u/vbraun/jupyter_r_kernel to 731673067452f10e8f7aa62bba4d7004be05c76f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.