mirror of https://github.com/logos-co/scratch.git
Summarize output files suitable for plotting
This commit is contained in:
parent
73546f9896
commit
d9c0eeebc6
|
@ -8,5 +8,6 @@
|
|||
:pathname "./"
|
||||
:components ((:file "package")
|
||||
(:file "json-path")
|
||||
(:file "plot")
|
||||
(:file "glacier")))))
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
(in-package :glacier)
|
||||
|
||||
(defun summarize (file)
|
||||
(let* ((s
|
||||
(alexandria:read-file-into-string file))
|
||||
(j
|
||||
(jsown:parse s))
|
||||
(rounds
|
||||
(loop :for column :in (get-path j '$.columns)
|
||||
:collecting (get-path column '$.values))))
|
||||
(loop :for round :in rounds
|
||||
:collecting ;; TODO optimize
|
||||
(list
|
||||
(length
|
||||
(remove-if-not #'zerop round))
|
||||
(length
|
||||
(remove-if-not
|
||||
(lambda (x) (= 1 x))
|
||||
round))
|
||||
(length
|
||||
(remove-if-not
|
||||
(lambda (x) (= 2 x))
|
||||
round))))))
|
||||
|
||||
|
Loading…
Reference in New Issue