Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 17 11:52

    alexarchambault on master

    Update fs2-core to 2.0.0 (#435) (compare)

  • Sep 17 11:52
    alexarchambault closed #435
  • Sep 13 12:44

    alexarchambault on gh-pages

    Update website (compare)

  • Sep 13 10:03

    alexarchambault on v0.8.1

    (compare)

  • Sep 13 09:59

    alexarchambault on master

    Switch to Ammonite 1.7.1 Switch to scala 2.12.10 Merge pull request #440 from al… (compare)

  • Sep 13 09:59
    alexarchambault closed #440
  • Sep 13 09:50
    alexarchambault edited #440
  • Sep 13 09:50
    alexarchambault edited #440
  • Sep 13 09:49
    alexarchambault synchronize #440
  • Sep 13 09:45
    alexarchambault opened #440
  • Sep 12 17:28

    alexarchambault on gh-pages

    Update website (compare)

  • Sep 12 16:44

    alexarchambault on coursier-2.0.0-RC3-4

    (compare)

  • Sep 12 16:44

    alexarchambault on master

    Switch to coursier 2.0.0-RC3-4 … (compare)

  • Sep 12 16:44
    alexarchambault closed #439
  • Sep 12 16:43

    alexarchambault on sbt-coursier-2.0.0-RC3-5

    (compare)

  • Sep 12 16:43

    alexarchambault on master

    Switch to sbt-coursier 2.0.0-RC… (compare)

  • Sep 12 16:43
    alexarchambault closed #438
  • Sep 12 12:42
    alexarchambault closed #436
  • Sep 12 12:42
    alexarchambault commented #436
  • Sep 12 12:42
    alexarchambault opened #439
Sören Brunk
@sbrunk
I’ve just created an issue for that question: almond-sh/almond#384
Alexandre Archambault
@alexarchambault
@sbrunk I had examples notebook involving them locally, trying to find them right now
vakkadar
@vakkadar
I am trying to use almond but our corporate repo has no access to jtpack
is there an alternative way to get the jvm-repr dependency
Alexandre Archambault
@alexarchambault
@vakkadar I should have the rights to push jvm-repr to Maven Central now. I'll look into it
Jasper Aorangi
@spmp

I have created an issue in GitHub (almond-sh/almond#390), but checking the same thing here in case can get a quicker/interactive solution.
With Almond from Docker or installed via coursier-cli I am getting the following error when trying to build the spark session:

cmd1.sc:104: Symbol 'type ammonite.interp.InterpAPI' is missing from the classpath.
This symbol is required by 'value org.apache.spark.sql.NotebookSparkSession.interpApi'.
Make sure that type InterpAPI is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'NotebookSparkSession.class' was compiled against an incompatible version of ammonite.interp.
import _root_.org.apache.spark.sql.{
       ^cmd1.sc:2: could not find implicit value for parameter interpApi: ammonite.interp.InterpAPI
  NotebookSparkSession.builder()
                              ^Compilation Failed

Noting that ammonite-spark did not like the latest Ammonite version, and instead worked with version 1.67 I tried with almond 0.4 as well with the same result.
Any ideas?

David Bouyssié
@david-bouyssie
Hi there. I'm not able have syntax highlighting in my Jupyter lab notebooks.
Do I need to configure something?
Sören Brunk
@sbrunk
@david-bouyssie usually it should work out of the box. Does it work in Python notebooks with your setup?
Raghav Bharadwaj
@raghavbharadwaj
Hello all! Is there a way i can include a dependency with a "classifier"? I am using Tensorflow-scala that relies on a specific build for every type of machine. My build.sbt includes a dependency that looks like this - "org.platanios" % "tensorflow_2.12" % "0.4.0" classifier "darwin-cpu-x86_64". Thanks!
Sören Brunk
@sbrunk
@raghavbharadwaj you can call interp.load.ivy to load dependencies with the coursier API, including artifacts with classifiers.
We actually have an example notebook for TF Scala doing exactly that: https://github.com/almond-sh/examples/blob/master/notebooks/tensorflow_scala.ipynb
Raghav Bharadwaj
@raghavbharadwaj
Thanks @sbrunk, Worked like a charm!! It also looks like the current version of coursier has a slightly different signature, but that easy to figure out. I got it to work by modifying the load ivy as follows : interp.load.ivy( coursier.Dependency( coursier.Module(coursier.core.Organization("org.platanios"), coursier.core.ModuleName("tensorflow_2.12")), "0.4.0", // replace with linux-gpu-x86_64 on linux with nvidia gpu or with darwin-cpu-x86_64 on macOS attributes = coursier.Attributes(coursier.Type(""), coursier.Classifier("darwin-cpu-x86_64")) ) )
David Bouyssié
@david-bouyssie
@sbrunk yes it works for Python but not for Scala
image.png
here is what I have
Sören Brunk
@sbrunk
@david-bouyssie you’re right it seems that for new notebooks the language_info field in the notebook metadata isn’t populated anymore. That’s definitely a regression.
Would you mind creating an issue?
David Bouyssié
@david-bouyssie
@sbrunk ok, thank you for checking this
I create the issue right now
Sören Brunk
@sbrunk
Thanks!
David Bouyssié
@david-bouyssie
@sbrunk here you go almond-sh/almond#398
Andrew Richards
@ajrnz
Hi can anyone point me to a simple project which creates a javascript cell and then communicates with it. The plotting ones look pretty complicated and I'd like to start with a simple skeleton. Thanks
杨博 (Yang Bo)
@Atry
Sören Brunk
@sbrunk
@Atry No that’s not intended, thanks. It’s only the latest tag, snapshot and versioned tags seem to be correct.
@alexarchambault the almondsh/almond docker repo seems have a build trigger connected to the examples git repo, could you check that?
Sören Brunk
@sbrunk
Antoine Doeraene
@sherpal
hi there, is there an easy way to clear the output cell programmatically? I would like to display and update a graph as iterations go. thanks!
Sören Brunk
@sbrunk
@sherpal are you using the almond.display API?
It allows you to keep a handle for updating and clearing your output.
val img = Image.from("https://almond.sh/logos/impure-logos-almond-3b.png“)
Then in a subsequent cell, call
img.clear()
Antoine Doeraene
@sherpal
@sbrunk In this particular case it's a plotly graph using plotly-scala. But when we plot we receive a string, which I assume is the ID of something than I could clear as you do.
Sören Brunk
@sbrunk

@sherpal that id probably won’t work, at least not when using JupyterLab.

Essentially you have to provide an id when calling kernel.publish.display (or one of the more specialized variants like kernel.publish.html) and then provide that same id when calling kernel.publish.updateDisplay. See https://almond.sh/docs/api-jupyter.html#updatable-display-data

plotly-scala calls kernel.publish.display internally but unfortunately it does not allow you to set this id at the moment. So I think it’s not possible to update/clear plots in subsequent cells until we expose that functionality in plotly-scala
Sören Brunk
@sbrunk

If you’re using the classic Jupyter Notebook UI, it’s possible though:

val data = // your plotly input
val divId = plot(data)

Then in a subsequent cell

Javascript(s"""document.getElementById("${divId}").innerHTML = "";"“")
Sören Brunk
@sbrunk
That works because in Jupyter classic we can inject any JavaScript into the frontend, and plotly-scala uses that to add the plot and render it via plotly.js. It wraps it in a div with the id the plot function returns. We can then use it to inject our own JS and change that div later.
JupyterLab is much more restrictive when it comes to JS injection, so plotly-scala will also send the plot JSON (using the application/vnd.plotly.v1+jsonmime type) to the browser where the JupyterLab plotly extension renders it if installed.
Antoine Doeraene
@sherpal
@sbrunk Well currently I'm using jupyter notebook so that solution would be "fine". Thanks! I'll search for another solution if I wanna do the same in jupyter lab
Anthony Mak
@anthonymak
I used to be able to display cell runtime with "%%time". How can I do this with Almond inside Jupyter?
Sören Brunk
@sbrunk
@anthonymak you could use Ammonite’s time utility function.
time {
  (1 to 1000000).map(_.toLong).sum
}
res1: (Long, concurrent.duration.FiniteDuration) = (
  500000500000L,
  27650242 nanoseconds
)
Anthony Mak
@anthonymak
@sbrunk thanks! Will try :)
Marvin Ward Jr.
@choct155

Hi, thanks for all of the work on this project. I think it's kind of perfect for my use case in principle, but I'm hitting a bit of a snag. When I try to import the breeze library, it appears to have already acquired the relevant dependencies, insofar as it does not download anything. My guess was maybe it was sharing the dependencies acquired from using a standalone Ammonite REPL. However, when I try to use the library, it seems to only see the macros module Imgur

I thought maybe I just needed to clear the cache and reload, but everything seems to work fine from standalone Ammonite. I muse be missing something dumb, so any help would be appreciated!

Sören Brunk
@sbrunk
@choct155 Which version of almond/Scala are you using? I can’t reproduce the issue with almond 0.7.0/Scala 2.12
yang
@ererermao
hello, guys
I want to add local jar, But it's some question.
import ammonite._, ammonite.ops._
import ammonite._

val path = java.nio.file.FileSystems.getDefault().getPath("/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/a.jar")
val x = ammonite.ops.Path(path)
interp.load.cp(x)
error logs:
cmd3.sc:6: object loadjar is not a member of package ammonite.interp
val res3_4 = interp.loadjar.cp(x)
                    ^Compilation Failed
Alexandre Archambault
@alexarchambault
@ererermao Remove the import ammonite._, like
import ammonite.ops._

val path = java.nio.file.FileSystems.getDefault().getPath("/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/a.jar")
val x = ammonite.ops.Path(path)
interp.load.cp(x)
yang
@ererermao
@alexarchambault Thank you very much for your reply, let me try
yang
@ererermao
It's work. Thank you very much. I like almond very much