Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/haifengl/smile
Browse files Browse the repository at this point in the history
  • Loading branch information
haifengl committed Apr 30, 2020
2 parents a2f4621 + f0091be commit 58618d5
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 73 deletions.
2 changes: 1 addition & 1 deletion binder/apt.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
openjdk-11-jdk
openjdk-8-jdk
maven
graphviz
3 changes: 1 addition & 2 deletions binder/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: smile-environment
name: smile-env
channels:
- conda-forge
- simplect
Expand All @@ -8,4 +8,3 @@ dependencies:
- jupyterlab-git
- kotlin-jupyter-kernel
- clojupyter
- scijava-jupyter-kernel
28 changes: 0 additions & 28 deletions binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,6 @@ SCALA_VERSION=2.13.1 ALMOND_VERSION=0.9.1
--metabrowse
rm -f almond-scala-2.13

# Install almond for Scala 2.12
SCALA_VERSION=2.12.10 ALMOND_VERSION=0.9.1
./coursier bootstrap \
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
--sources --default=true \
-o ./almond-scala-2.12
./almond-scala-2.12 --install --id scala212 --display-name "Scala (2.12)" \
--command "java -XX:MaxRAMPercentage=80.0 -jar almond-scala-2.12 --id scala212 --display-name 'Scala (2.12)'" \
--copy-launcher \
--metabrowse
rm -f almond-scala-2.12

# Install almond 0.6.0 for Scala 2.11
SCALA_VERSION=2.11.12 ALMOND_VERSION=0.6.0
./coursier bootstrap \
-r jitpack \
-i user -I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
--sources --default=true \
-o almond-scala-2.11
./almond-scala-2.11 --install --id scala211 --display-name "Scala (2.11)" \
--command "java -XX:MaxRAMPercentage=80.0 -jar almond-scala-2.11 --id scala211 --display-name 'Scala (2.11)'" \
--copy-launcher \
--metabrowse
rm -f almond-scala-2.11

# Clean up the directory. Keep only the notebooks and data.
rm -f coursier

Expand Down
7 changes: 4 additions & 3 deletions notebook/data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@
"outputs": [],
"source": [
"import $ivy.`org.apache.avro:avro:1.8.2`\n",
"import $ivy.`org.apache.hadoop:hadoop-common:3.0.0`\n",
"\n",
"val stream = Files.newInputStream(Paths.get(\"data/avro/userdata.avsc\"))\n",
"val schema = new org.apache.avro.Schema.Parser().parse(stream)\n",
"val userdata1 = read.avro(\"data/avro/userdata1.avro\", schema)\n",
"val userdata1 = read.avro(\"data/avro/userdata1.avro\", \"data/avro/userdata.avsc\")\n",
"display(userdata1)"
]
},
Expand All @@ -158,6 +157,8 @@
"metadata": {},
"outputs": [],
"source": [
"import $ivy.`org.apache.arrow:arrow-memory:0.16.0`\n",
"import $ivy.`org.apache.arrow:arrow-vector:0.16.0`\n",
"import $ivy.`org.xerial:sqlite-jdbc:3.28.0`\n",
"\n",
"// load SQLite JDBC driver\n",
Expand Down
72 changes: 72 additions & 0 deletions shell/src/universal/bin/notebook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

while [ $# -ne 0 ]
do
arg="$1"
case "$arg" in
--install)
install=true
;;
--install-almond)
installAlmond=true
;;
--install-kotlin)
installKotlin=true
;;
--install-clojure)
installClojure=true
;;
--install-scijava)
installSciJava=true
;;
*)
echo "Unknown argument $arg"
;;
esac
shift
done

if [ "$install" == true ]
then
conda create --name smile-env
conda install --name smile-env -c conda-forge jupyterlab
fi

if [ "$installKotlin" == true ]
then
conda install --name smile-env -c jetbrains kotlin-jupyter-kernel
fi

if [ "$installClojure" == true ]
then
conda install --name smile-env -c simplect clojupyter
fi

if [ "$installSciJava" == true ]
then
conda install --name smile-env -c conda-forge scijava-jupyter-kernel
fi

if [ "$installAlmond" == true ]
then
if [ -x ./coursier ]
then
curl -Lo coursier https://git.io/coursier-cli
chmod +x coursier
fi

SCALA_VERSION=2.13.1 ALMOND_VERSION=0.9.1

./coursier bootstrap -r jitpack \
-i user \
-I user:sh.almond:scala-kernel-api_$SCALA_VERSION:$ALMOND_VERSION \
sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
--sources \
--default=true \
-f -o almond-scala-2.13

./almond-scala-2.13 --install --force --id scala213 --display-name "Scala 2.13"
fi

source activate smile-env
jupyter lab
39 changes: 0 additions & 39 deletions shell/src/universal/bin/smile-notebook.sh

This file was deleted.

0 comments on commit 58618d5

Please sign in to comment.