Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 24 05:06
    paul-brenner commented #929
  • Jun 23 12:35
    paul-brenner commented #929
  • Jun 22 18:53
    andrelfpinto opened #936
  • Jun 16 23:17

    dependabot[bot] on pip

    (compare)

  • Jun 16 23:17
    dependabot[bot] closed #926
  • Jun 16 23:17
    dependabot[bot] commented #926
  • Jun 16 23:17
    dependabot[bot] labeled #935
  • Jun 16 23:17
    dependabot[bot] labeled #935
  • Jun 16 23:16
    dependabot[bot] opened #935
  • Jun 16 23:16

    dependabot[bot] on pip

    Bump notebook from 6.1.5 to 6.4… (compare)

  • Jun 16 08:33
    dependabot[bot] edited #919
  • Jun 16 08:33
    dependabot[bot] edited #916
  • Jun 16 08:33
    dependabot[bot] edited #926
  • Jun 16 08:33

    alexarchambault on master

    (compare)

  • Jun 16 08:33
    dependabot[bot] edited #914
  • Jun 16 08:33
    dependabot[bot] edited #908
  • Jun 16 08:33

    alexarchambault on main

    (compare)

  • Jun 14 12:16

    alexarchambault on gh-pages

    Update website (compare)

  • Jun 14 11:17

    alexarchambault on fix-publish-settings

    (compare)

  • Jun 14 11:15

    alexarchambault on master

    Fix upload-launcher job Resume 0.13.0 CI jobs Vendor website scripts repo It… and 6 more (compare)

Alexandre Archambault
@alexarchambault
@trepidacious The session load / save API of Ammonite might work in almond (I never tried to use it)
It allows to roll-back a session up to a previous checkpoint, effectively "unloading" dependencies added since
trepidacious
@trepidacious
@alexarchambault Ah that sounds handy, I'll have a look. The restart isn't too bad but that sounds quicker.
hamero
@hamero
hi, trying to install almond behind fw (with nexus proxy for central repos) and I'm getting this jvm-repr 4.0 dependency missing, any ideas why?
Sören Brunk
@sbrunk
@hamero it seems like jvm-repr is only published to jitpack https://jitpack.io/#jupyter/jvm-repr
hamero
@hamero
ok, found this jupyter/jvm-repr#15, @alexarchambault do you think it can be published to central anytime soon?
Brian Schlining
@hohonuuli
Hi @alexarchambault , I just wanted to give a heads up that the docker images on dockerhub aren't up-to-date (See https://hub.docker.com/r/almondsh/almond/tags). The last tagged release is 0.6.0. Cheers (and thanks for your work, almond looks great!)
trepidacious
@trepidacious
Is it possible to disable repl printing completely? I've set up methods to plot graphs and display tables, and I can always print("something") explicitly if I want, so the repl output of variable definitions etc. isn't needed for my worksheet, and it makes it a lot longer
trepidacious
@trepidacious
I thought maybe I could implement a replacement PPrinter and provide it to repl.pprinter.update, but it's a case class so I guess not?
trepidacious
@trepidacious
I imagine almond could have an API method to disable the repl stuff though?
Sören Brunk
@sbrunk
@trepidacious as a workaround, you could set repl.pprinter() = repl.pprinter().copy(defaultHeight = 0) to almost disable repl printing
trepidacious
@trepidacious
@sbrunk Ah yes, I tried that and it does help, but it only seems to apply to some printing, I still see imports etc.
Sören Brunk
@sbrunk
@trepidacious yeah I agree we should be able to disable it completely but I guess it needs to be done in Ammonite
Srepfler Srdan
@schrepfler
can almond work with nteract somehow?
Sören Brunk
@sbrunk
@schrepfler yes in general, nteract should just work with almond. There were some almond-sh/almond#371. Not sure if they have been resolved.
Srepfler Srdan
@schrepfler
thanks @sbrunk
Andrew Valencik
@valencik

When I try and run the following in almond 0.82 I get an error:

interp.repositories() ++= Seq(
  coursier.MavenRepository("https://dl.bintray.com/cibotech/public")
)

object MavenRepository is not a member of package coursier

This appears to be the case on 0.81 as well. Scala 2.12.8 and 2.12.10
trepidacious
@trepidacious
@sbrunk So I had a look at the source and it seems like it might be possible to disable repl output from almond (although I haven't looked through the details or tested much at all)
@sbrunk If you set silent to true on this line you get println and html but no stuff from repl about declaring variables: https://github.com/almond-sh/almond/blob/master/modules/scala/scala-interpreter/src/main/scala/almond/Execute.scala#L226
If this could be enabled/disabled from the API I think that would do the trick
trepidacious
@trepidacious
I'll see if I can work out how you would do that and submit a pull request :)
Sören Brunk
@sbrunk
@trepidacious that's great! Don't hesitate to ask if you get stuck at some point.
trepidacious
@trepidacious
@sbrunk Thanks :) Really enjoying using almond, I wish I'd found it years ago!
trepidacious
@trepidacious
@sbrunk I've tested that approach with a real notebook and it works well - repl completely suppressed, but html, plotly and println all come through fine, makes the notebook much neater.
Sören Brunk
@sbrunk
@trepidacious awesome! Would you mind opening an issue or a PR to discuss your approach? I guess we also have to look for a way to configure this.
trepidacious
@trepidacious
@sbrunk I will do, I had a look through the issues and couldn't find anything covering it so far, I guess almond-sh/almond#287 might be slightly related, in that suppressing all output would cover that issue :)
Sören Brunk
@sbrunk

@valencik the coursier API hast changed. Try

interp.repositories() ++= Seq(
  coursierapi.MavenRepository.of("https://dl.bintray.com/cibotech/public")
)

Note that I've updated the EvilPlot example accordingly.

Andrew Valencik
@valencik
woooow, thank you! I actually could not come across a fix for that. Out of curiosity, how did you figure this out?
Either way, thank you again.
Sören Brunk
@sbrunk
@valencik I think I saw someone mentioning that in the Ammonite gitter channel. Otherwise, I probably would have asked @alexarchambault, as he’s also the author of Coursier and should know. 😃
trepidacious
@trepidacious
@sbrunk I created a pull request for the "silent repl" feature - seems to work but I'm new to the code so it might not be implemented the best way :) almond-sh/almond#450
Sören Brunk
@sbrunk
@trepidacious thanks! I’m going to give it a try tomorrow
Hubert Plociniczak
@hubertp

Hi all, I'm trying to run a custom Scala kernel for 2.13 but encountering some compilation issues. I used to think it's a bug in Ammonite, but I'm not sure anymore. I can even reproduce it with official instructions available at https://almond.sh/docs/quick-start-install.html#create-a-launcher where I set SCALA_VERSION=2.13.0 (it works with 2.12.x). When running the kernel in jupyter I get:

Compiling (synthetic)/ammonite/predef/interpBridge.sc
ERROR AmmInterpreter$ Caught exception while initializing interpreter
almond.amm.AmmInterpreter$PredefException: 
  almond.amm.AmmInterpreter$.$anonfun$apply$3(AmmInterpreter.scala:130)
  almond.amm.AmmInterpreter$.$anonfun$apply$3$adapted(AmmInterpreter.scala:125)
  scala.Option$WithFilter.foreach(Option.scala:437)
  almond.amm.AmmInterpreter$.apply(AmmInterpreter.scala:125)
  almond.ScalaInterpreter.ammInterp$lzycompute(ScalaInterpreter.scala:97)
  almond.ScalaInterpreter.ammInterp(ScalaInterpreter.scala:61)
  almond.ScalaKernel$$anon$5.run(ScalaKernel.scala:136)
java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
  ammonite.interp.Compiler$.apply(Compiler.scala:141)
  ammonite.interp.CompilerLifecycleManager.init(CompilerLifecycleManager.scala:98)
  almond.amm.AmmInterpreter$$anon$1$$anon$2.preprocess(AmmInterpreter.scala:113)
  ammonite.interp.Interpreter.compileRunBlock$1(Interpreter.scala:509)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$15(Interpreter.scala:569)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$14(Interpreter.scala:566)
  ammonite.util.Res$Success.flatMap(Res.scala:62)

which is weird because scala/tools/nsc/reporters/AbstractReporter is a 2.12.x compiler class, not 2.13.x.
Any ideas?

Aleksei Alefirov
@alekseiAlefirov
Hi,
Is it possible to access ScalaInterpreter class from a library?
I don't need any server and concurrency logic, just scala execution, hence the interest.
Aleksei Alefirov
@alekseiAlefirov

Ok, managed to solve it.

"sh.almond" % "scala-interpreter" % V.almond cross CrossVersion.full

worked fine for me, the problem was missing jvm-repr, thankfully, not news in this chat.

Aleksei Alefirov
@alekseiAlefirov

Hi again,
I'd like to use ScalaIntepreter, but when I create it, I get

almond.amm.AmmInterpreter$PredefException: 
    at almond.amm.AmmInterpreter$.$anonfun$apply$3(AmmInterpreter.scala:130)
...
Caused by: scala.reflect.internal.FatalError: Error accessing /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-3.b10.fc26.x86_64/jre/lib/ext/java-atk-wrapper.jar
    at scala.tools.nsc.classpath.AggregateClassPath.$anonfun$list$3(AggregateClassPath.scala:99)
...

Can I somehow fixed? Maybe with correct ScalaInterpreterParams?
Thanks.

Aleksei Alefirov
@alekseiAlefirov

Hello again,
Playing with Classloaders (both ScalaIntepreter param and current Thread context one), I've managed to initialize ScalaInterpeter.
But trying to execute code there fails for me with Compilation Failure.
For code val x = 1 I get following error:

cmd0.sc:7: exception during macro expansion: 
java.lang.IllegalArgumentException: argument type mismatch

  .printOnChange(x, "x", _root_.scala.None, _root_.scala.None, _root_.scala.None)) }

Looked at almond code a bit, I've experimented and set ScalaInterpreter params autoUpdateLazyVals and autoUpdateVars both to false, and got slightly different error:

cmd0.sc:8: exception during macro expansion: 
java.lang.IllegalArgumentException: argument type mismatch

          .print(x, "x", _root_.scala.None)

Maybe someone can give me a clue, how to solve it? Thanks.

Hao Sun
@zenhao

java.lang.ClassCastException: almond.ReplApiImpl cannot be cast to ammonite.repl.ReplAPI
I am not sure what is happening. I was trying to load a locally published jar and I got this.

Seems like cats works..
(I am on almond 0.9.0 and scala 2.12.8)

Hao Sun
@zenhao
Solved. I had ammonite in my jar. Exclude it fixed my issue.
Adam Davidson
@Adi255
"Local clusters, Mesos, and Kubernetes, aren't supported by ammonite-spark yet". We use Spark on k8s here, just wondering if this means it does not work at all, or whether you can use it but without ammonite features?
Hubert Plociniczak
@hubertp
almond 0.9.1 (compared to 0.9.0) adds metabrowse dependency to the build. The latter, in turn, brings scala-compiler 2.13.1 dependency. This is problematic for custom kernels that are still on 2.13.0 because ammonite cross compiles to a full Scala version (not just binary one).
In the end one gets nomethod/noclass found exceptions during initialization of the kernel because of compiler interface differences. Would that be considered a bug/feature? I'm guessing metabrowse would need to be crosscompiled to a full Scala version to solve this properly.
Michał Gołębiewski
@mjgolebiewski
hello guys, ive encountered problem when i try to run Scala kernel on my Jupyter Notebook:
./almond --log debug --connection-file scala.kernel.json 
DEBUG ScalaKernel$ Auto dependency:
  Trigger: Module(org.apache.spark, *)
  Adds: Dependency(Module(sh.almond, almond-spark_2.12), 0.9.1)
DEBUG ScalaKernel$ Creating interpreter
DEBUG ScalaKernel$ Created interpreter
DEBUG ScalaKernel$ Running kernel
DEBUG ScalaKernel$ Initializing interpreter (background)
INFO AmmInterpreter$ Creating Ammonite interpreter
DEBUG AmmInterpreter$ Initializing interpreter predef
Compiling (synthetic)/ammonite/predef/interpBridge.sc
DEBUG ZeromqConnection Opening channels for ConnectionParameters(127.0.0.1,tcp,33763,35867,59313,42939,44325,****,Some(hmac-sha256),Some(scala))
ERROR AmmInterpreter$ Caught exception while initializing interpreter
almond.amm.AmmInterpreter$PredefException: 
  almond.amm.AmmInterpreter$.$anonfun$apply$3(AmmInterpreter.scala:130)
  almond.amm.AmmInterpreter$.$anonfun$apply$3$adapted(AmmInterpreter.scala:125)
  scala.Option$WithFilter.foreach(Option.scala:407)
  almond.amm.AmmInterpreter$.apply(AmmInterpreter.scala:125)
  almond.ScalaInterpreter.ammInterp$lzycompute(ScalaInterpreter.scala:97)
  almond.ScalaInterpreter.ammInterp(ScalaInterpreter.scala:61)
  almond.ScalaKernel$$anon$5.run(ScalaKernel.scala:136)
java.lang.NoSuchMethodError: scala.tools.nsc.classpath.ZipAndJarClassPathFactory$.create(Lscala/reflect/io/AbstractFile;Lscala/tools/nsc/Settings;)Lscala/tools/nsc/util/ClassPath;
  ammonite.interp.ExtraCompilerCompatibility.createZipJarFactory(ExtraCompilerCompatibility.scala:10)
  ammonite.interp.Compiler$.$anonfun$prepareJarCp$2(Compiler.scala:372)
  scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
  scala.collection.Iterator.foreach(Iterator.scala:941)
  scala.collection.Iterator.foreach$(Iterator.scala:941)
  scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
  scala.collection.IterableLike.foreach(IterableLike.scala:74)
  scala.collection.IterableLike.foreach$(IterableLike.scala:73)
  scala.collection.AbstractIterable.foreach(Iterable.scala:56)
  scala.collection.TraversableLike.map(TraversableLike.scala:238)
  scala.collection.TraversableLike.map$(TraversableLike.scala:231)
  scala.collection.AbstractTraversable.map(Traversable.scala:108)
  ammonite.interp.Compiler$.prepareJarCp(Compiler.scala:369)
  ammonite.interp.Compiler$.initGlobalClasspath(Compiler.scala:400)
  ammonite.interp.Compiler$$anon$1.<init>(Compiler.scala:206)
  ammonite.interp.Compiler$.apply(Compiler.scala:141)
  ammonite.interp.CompilerLifecycleManager.init(CompilerLifecycleManager.scala:98)
  almond.amm.AmmInterpreter$$anon$1$$anon$2.preprocess(AmmInterpreter.scala:113)
  ammonite.interp.Interpreter.compileRunBlock$1(Interpreter.scala:509)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$15(Interpreter.scala:569)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$14(Interpreter.scala:566)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$12(Interpreter.scala:563)
  scala.Option.getOrElse(Option.scala:189)
  ammonite.interp.Interpreter.loop$1(Interpreter.scala:563)
  ammonite.interp.Interpreter.processAllScriptBlocks(Interpreter.scala:601)
  ammonite.interp.Interpreter.$anonfun$processModule$6(Interpreter.scala:397)
  ammonite.util.Catching.flatMap(Res.scala:115)
  ammonite.interp.Interpreter.$anonfun$processModule$5(Interpreter.scala:388)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.processModule(Interpreter.scala:378)
  ammonite.interp.Interpreter.$anonfun$initializePredef$1(Interpreter.scala:126)
  ammonite.interp.Interpreter.$anonfun$initializePredef$1$adapted(Interpreter.scala:126)
  ammonite.interp.PredefInitialization$.$anonfun$apply$7(PredefInitialization.scala:75)
  ammonite.util.Res$.$anonfun$fold$1(Res.scala:32)

here is rest of the error:

 scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
  scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
  scala.collection.immutable.List.foldLeft(List.scala:89)
  ammonite.util.Res$.fold(Res.scala:30)
  ammonite.interp.PredefInitialization$.apply(PredefInitialization.scala:63)
  ammonite.interp.Interpreter.initializePredef(Interpreter.scala:128)
  almond.amm.AmmInterpreter$.apply(AmmInterpreter.scala:125)
  almond.ScalaInterpreter.ammInterp$lzycompute(ScalaInterpreter.scala:97)
  almond.ScalaInterpreter.ammInterp(ScalaInterpreter.scala:61)
  almond.ScalaKernel$$anon$5.run(ScalaKernel.scala:136)

and here are version numbers:

$ scala -version
Scala code runner version 2.12.8 -- Copyright 2002-2018, LAMP/EPFL and Lightbend, Inc.

$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

$ javac -version
javac 1.8.0_242
Hubert Plociniczak
@hubertp
@mjgolebiewski That's similar to what I was encountering. Except you seem to be on 2.12.x and you are getting scala-reflect binary incompatibilies. I've also been fighting with that once I resolved scala-compilar compatibility issues.
How did you build that particular almond kernel? Is that from a fresh clone of the repo?
I can show you the (not so pretty) workaround I used, but I think this should be solved in general in almond itself, by fetching dependencies with full scala version, not just the binary compatible one.
Ghost
@ghost~558c900115522ed4b3e2ce89
@mjgolebiewski I ran into the same problem on my FreeBSD dev machine. Just for fun, I tried SCALA_VERSION=2.13.1 ALMOND_VERSION=0.9.1 and it works
Michał Gołębiewski
@mjgolebiewski
@hubertp @oddodaoddo changing scala version helped. thank you guys
Michail Chatzis
@mchatzis
Good morning everyone, I have run to a problem during installation. I would appreciate any help, thank you!
image.png
Sudheer Doppalapudi
@sudheer
Hi Team, I am trying to use mermaid JS inside Scala shell launched with the help of almond. I want to draw diagrams right form the Jupiter notebooks. Anybody tried this or have any luck with it ? Thanks in advance.