Skip to content
Snippets Groups Projects
Commit 9453f7b5 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

feat(aliby): add basic CLI

parent 95124de5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env jupyter
import argparse
from aliby.pipeline import Pipeline, PipelineParameters
parser = argparse.ArgumentParser(
prog="aliby-run", description="Run a default microscopy analysis pipeline"
)
param_values = {
"expt_id": None,
"distributed": 2,
"tps": 2,
"directory": "./data",
"filter": 0,
"host": None,
"username": None,
"password": None
# "overwrite": True,
# "earlystop": {
# "min_tp": 100,
# "thresh_pos_clogged": 0.4,
# "thresh_trap_ncells": 8,
# "thresh_trap_area": 0.9,
# "ntps_to_eval": 5,
# },
# "logfile_level": "INFO",
# "use_explog": True,
# "use_logfile": False,
}
def _cast_str(x: str or None):
"""
Cast string as int if possible. If Nonetype return None.
"""
if x:
try:
return int(x)
except:
return x
for k in param_values:
parser.add_argument(f"--{k}", action="store")
args = parser.parse_args()
for k in param_values:
if passed_value := _cast_str(getattr(args, k)):
param_values[k] = passed_value
params = PipelineParameters.default(general=param_values)
p = Pipeline(params)
p.run()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment