This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-13
Channels
- # announcements (1)
- # babashka (41)
- # beginners (194)
- # calva (14)
- # chlorine-clover (2)
- # cider (32)
- # circleci (9)
- # cljsrn (10)
- # clojure (110)
- # clojure-australia (1)
- # clojure-berlin (2)
- # clojure-dev (39)
- # clojure-europe (42)
- # clojure-france (3)
- # clojure-nl (19)
- # clojure-spec (22)
- # clojure-uk (23)
- # clojurescript (21)
- # conjure (41)
- # datomic (33)
- # depstar (16)
- # duct (46)
- # events (1)
- # fulcro (17)
- # graphql (14)
- # jobs (6)
- # jobs-discuss (9)
- # leiningen (6)
- # malli (29)
- # off-topic (21)
- # pathom (7)
- # portal (1)
- # rdf (81)
- # re-frame (3)
- # reagent (12)
- # reitit (2)
- # remote-jobs (1)
- # rum (1)
- # shadow-cljs (60)
- # specter (1)
- # sql (13)
- # tools-deps (23)
- # vrac (1)
- # yada (19)
Guten Morgen!
Guten Morgen!
does it then tie you to running JVM on a specific platform?
Yes, of course: it then depends on that executable being available in your external environment.
I'm writing a package manager that should help solve this problem: https://github.com/borkdude/glam
@borkdude this seems to have worked reasonably well
(defn ->nippy [dirname data]
(run!
(fn [data]
(let [idx (-> data first :simulation)]
(nippy/freeze-to-file (str dirname "simulated-transitions-" idx ".npy") data)))
(partition-by (fn [{:keys [simulation]}] (quot simulation 100)) data)))
(defn nippy->data [dirname]
(into []
(comp
(filter (fn [f] (re-find #"npy$" (.getName f))))
(x/sort-by (fn [f] (.getName f)))
(mapcat nippy/thaw-from-file))
(.listFiles (io/file dirname))))
reading in takes 78 seconds from nippy compared to 394 seconds converting from csv (with no compression)
I've not had a go with zip or gzip, tbh, I'm pretty happy I can dump my code that was doing the type conversions from csv
@borkdude any reason why you think I should not use nippy? Other than compatibility with other languages (which would probably drive me to arrow and http://tech.ml.dataset really)
Don't know. Btw, there's also a CLI for nippy (which can also be used as a pod from babashka: https://github.com/justone/brisk)
So then you could use it from other languages as well, by shelling out, or from bb scripts
arrow is really good for going to R (which we use) or Python (which we sometimes use but not often)
the benefit of using zip or gzip is that it's natively supported in many stdlibs (of Java as well)
I'm sort of enjoying the faster save and load times and not having more conversion code to maintain π
I hope! You could also write your own company branded GraalVM-based CLI tool around your data and then call this from Python, R, whatever.