Commit 63e6aeb0 authored by Philippe Veber's avatar Philippe Veber
Browse files

introduced validation mode

parent a020ddd7
......@@ -3,6 +3,8 @@ open Reviewphiltrans
let () =
Command.group ~summary:"Reviewphiltrans" [
"pipeline", Pipeline.command ;
"simulation", Pipeline.simulation_command ;
"detection", Pipeline.detection_command ;
"validation", Pipeline.validation_command ;
]
|> Command.run
......@@ -223,30 +223,38 @@ let derive_det ~dataset_l ~preview ~no_diffsel =
List.map dataset_l ~f:(fun dataset ->
derive_from_dataset ~preview ~dataset ~no_diffsel)
let logger =
Logger.tee [
Console_logger.create () ;
Dot_output.create "dag.dot" ; (*dot -Tpdf example/dag.dot -o dag.pdf*)
Bistro_utils.Html_logger.create "report.html" ;
]
let detection_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~no_diffsel () =
let logger =
Logger.tee [
Console_logger.create () ;
Dot_output.create "dag.dot" ; (*dot -Tpdf example/dag.dot -o dag.pdf*)
Bistro_utils.Html_logger.create "report.html" ;
] in
let dataset_l = parse_input_data indir in
let dataset_results_l = derive_det ~dataset_l ~preview ~no_diffsel in
let repo = repo_of_dataset_results_l ~dataset_results_l in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let simulation_main ~outdir ?(np = 2) ?(mem = 2) ~tree_dir ~profile_fn ~preview () =
let logger =
Logger.tee [
Console_logger.create () ;
Dot_output.create "dag.dot" ; (*dot -Tpdf example/dag.dot -o dag.pdf*)
Bistro_utils.Html_logger.create "report.html" ;
] in
let trees = Array.to_list @@ Sys.readdir tree_dir in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview in
let repo = Dataset.repo dataset_l ~preview in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let validation_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~no_diffsel ~tree_dir ~profile_fn () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let dataset_l =
derive_sim ~tree_dir ~trees ~profile_fn ~preview
@ parse_input_data indir in
let dataset_results_l = derive_det ~dataset_l ~preview ~no_diffsel in
let repo = [
Dataset.repo dataset_l ~preview ;
repo_of_dataset_results_l ~dataset_results_l ;
] |> List.concat
in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let simulation_command =
let open Command.Let_syntax in
Command.basic
......@@ -289,10 +297,27 @@ let detection_command =
detection_main ~outdir ~indir ?np ?mem ~preview ~no_diffsel
]
let command =
Command.group
~summary:"Demo pipelines for bistro"
[
"simulation", simulation_command ;
"detection", detection_command ;
let validation_command =
let open Command.Let_syntax in
Command.basic
~summary:"Run simulation pipeline"
[%map_open
let outdir =
flag "--outdir" (required string) ~doc:"PATH Output directory"
and indir =
flag "--indir" (required string) ~doc:"PATH Input directory"
and preview =
flag "--preview-mode" no_arg ~doc:" Preview mode"
and no_diffsel =
flag "--no-diffsel" no_arg ~doc:" No diffsel mode"
and np =
flag "--np" (optional int) ~doc:"INT Number of available processors"
and mem =
flag "--mem" (optional int) ~doc:"INT Available memory (in GB)"
and tree_dir =
flag "--tree-dir" (required string) ~doc:"PATH Path to tree directory"
and profile_fn =
flag "--profile-fn" (required string) ~doc:"PATH Path to profile file"
in
validation_main ~outdir ~indir ?np ?mem ~preview ~no_diffsel ~tree_dir ~profile_fn
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment