Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java/beakerx support #140

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

java/beakerx support #140

wants to merge 3 commits into from

Conversation

scottdraves
Copy link

@maartenbreddels
Copy link
Collaborator

Great, I also see you had to get some parts of ipywebrtc in.

@maartenbreddels
Copy link
Collaborator

This seems to work nicely with Clojure:

%classpath config resolver jitpack.io https://jitpack.io
%classpath add mvn com.github.twosigma:ipyvolume:lmitusinski~beakerx-widget-SNAPSHOT
(import ipyvolume.PyLab)

(defn ball 
    [size radius]
    (let [data           (make-array Float/TYPE size size size)
          square         #(* % %)
          center         #(- % (/ size 2))
          sum            (partial reduce +)
          sum-of-squares #(sum (map square %))]
        (doseq [i (range size)
                j (range size)
                k (range size)
                :let [[x y z] (map center [i j k])] 
                :when (> (square radius) 
                         (sum-of-squares [x y z]))]
             (aset data i j k (float 1)))
        data))
(PyLab/volShow (ball 32 12))

@scottdraves
Copy link
Author

as soon as we get pythreejs working, will look into the test failure:

_____________________________ test_threejs_version _____________________________
    def test_threejs_version():
        # a quick check, as a reminder to change if threejs version is updated
        configpath = os.path.join(os.path.abspath(ipyvolume.__path__[0]), "..", "js", "package.json")
        with open(configpath) as f:
            config = json.load(f)
        major, minor = ipyvolume._version.__version_threejs__.split(".")
        major_js, minor_js, patch_js = config['dependencies']['three'][1:].split(".")
        version_msg = "version in python and js side for three js conflect: %s vs %s" % (
            ipyvolume._version.__version_threejs__, config['dependencies']['three'])
>       assert (major == major_js) and (minor == minor_js), version_msg
E       AssertionError: version in python and js side for three js conflect: 0.85 vs ^0.91.0
E       assert ('0' == '0'
E           0 and '85' == '91'
E         - 85
E         + 91)
ipyvolume/test_all.py:366: AssertionError

@maartenbreddels
Copy link
Collaborator

I just fixed that, if you rebase against master it should work.
Btw, how is distribution and installation managed, did you think about it? Apart from a conda package, what is the way this should be distributed?

@coveralls
Copy link

coveralls commented Jun 7, 2018

Coverage Status

Coverage remained the same at 68.72% when pulling bedec29 on twosigma:master into ef7da2a on maartenbreddels:master.

@scottdraves
Copy link
Author

thanks, it's green now.

@scottdraves
Copy link
Author

for distribution, jitpack does fine for the java part afaik.

@mprogram
Copy link

mprogram commented Aug 25, 2018

I've got compiled ipyvolume-java-1.0-SNAPSHOT.jar in the ipyvolume-java folder. Any suggestion how does one need to integrate it further into the Debian system I'm running to look at it? I've passed the opening example to myBinder, unfortunately, with no visuals.

@maartenbreddels
Copy link
Collaborator

Did you install ipyvolume as well? Can you give me a link to a mybinder you are using for this?

@mprogram
Copy link

mprogram commented Sep 12, 2018

Yes, (locally) I did. I'm off my testing environment at the moment due to real life demands, however, I'm more than happy to provide a universal link to query virtually any notebook hosted on GitHub straight into myBinder environment (watching the 'Build logs' by clicking the 'show' link at the top would be a good thing to do as it hangs quite often):
https://mybinder.org/v2/gh/twosigma/beakerx/master?filepath=doc/groovy/3D.ipynb

EDIT: I've just checked the myBinder image (finally!), and remembered that "no visuals" corresponds to not knowing how one needs to seduce the Groovy API into installing the ipyvolume module (spotted: 'For this to work, the widget JS needs to be installed:' conda install -c conda-forge ipyvolume). I would be nice to have this missing piece of code be present in the notebook itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants