|
|
@@ -20,10 +20,10 @@ |
|
|
|
|
|
|
|
(s/def ::corr_vars |
|
|
|
(st/spec |
|
|
|
{:spec vector? |
|
|
|
:type :vector |
|
|
|
{:spec (s/coll-of string?) |
|
|
|
:type :array |
|
|
|
:description "Variables." |
|
|
|
:swagger/default [] |
|
|
|
:swagger/default nil |
|
|
|
:reason "The corr_vars must be a vector."})) |
|
|
|
|
|
|
|
(s/def ::method |
|
|
@@ -54,7 +54,7 @@ |
|
|
|
(s/def ::hc_order |
|
|
|
(st/spec |
|
|
|
{:spec #{true false} |
|
|
|
:type :boolean |
|
|
|
:type :bool |
|
|
|
:description "Logical value. If TRUE, correlation matrix will be hc.ordered using hclust function." |
|
|
|
:swagger/default true |
|
|
|
:reason "The hc_order must be one of true, false."})) |
|
|
@@ -63,9 +63,9 @@ |
|
|
|
(st/spec |
|
|
|
{:spec #(and (>= % 0) (<= % 1)) |
|
|
|
:type :float |
|
|
|
:description "Logical value. If TRUE, correlation matrix will be hc.ordered using hclust function." |
|
|
|
:description "Significant level, greater than 0 and less than 1." |
|
|
|
:swagger/default 0.05 |
|
|
|
:reason "The hc_order must be one of true, false."})) |
|
|
|
:reason "The sig_level must be a float."})) |
|
|
|
|
|
|
|
(def corrplot-params-body |
|
|
|
"A spec for the body parameters." |
|
|
@@ -128,13 +128,16 @@ |
|
|
|
args-template (fs-lib/join-paths template-dir "args.json.template") |
|
|
|
output-file (fs-lib/join-paths dest-dir "plotly.json")] |
|
|
|
(corrplot/make-args-json! args-template context args-json) |
|
|
|
(log/info "Make an argument json file: %s" args-json) |
|
|
|
(log/info "Make an argument json file: " args-json) |
|
|
|
(update-process! task-id 30) |
|
|
|
(let [result (corrplot/call-corrplot! args-json output-file env-dir) |
|
|
|
status (:status result)] |
|
|
|
status (:status result) |
|
|
|
process (if (= status "Success") 100 -1)] |
|
|
|
(spit log-path (json/write-str result)) |
|
|
|
(log/info "The task is finished, result file is %s" output-file) |
|
|
|
(update-process! task-id (if (= status "Success") 100 -1))))) |
|
|
|
(update-process! task-id process) |
|
|
|
(if (= status "Success") |
|
|
|
(log/info "The task is finished, result file is " output-file) |
|
|
|
(log/error "The task is failed, error msg is located in " log-path))))) |
|
|
|
|
|
|
|
;;; --------------------------------------------------- Lifecycle ---------------------------------------------------- |
|
|
|
(def events-init |