From 697e804d4a289c934d4310db440bb5b28bb37ca8 Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Tue, 5 Sep 2023 22:16:28 -0500 Subject: [PATCH 1/2] add `validation` argument to dandi upload --- element_interface/dandi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/element_interface/dandi.py b/element_interface/dandi.py index 078e58a..22486b3 100644 --- a/element_interface/dandi.py +++ b/element_interface/dandi.py @@ -12,6 +12,7 @@ def upload_to_dandi( api_key: str = None, sync: bool = False, existing: str = "refresh", + validation: str = "required", shell=True, # without this param, subprocess interprets first arg as file/dir ): """Upload NWB files to DANDI Archive @@ -27,6 +28,7 @@ def upload_to_dandi( sync (str, optional): If True, delete all files in archive that are not present in the local directory. existing (str, optional): see full description from `dandi upload --help` + validation (str, optional): [require|skip|ignore] see full description from `dandi upload --help` """ working_directory = working_directory or os.path.curdir @@ -84,4 +86,5 @@ def upload_to_dandi( dandi_instance="dandi-staging" if staging else "dandi", existing=existing, sync=sync, + validation=validation, ) From b374a41c5029af32e3d1dda1f89460324ef881e9 Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Thu, 12 Oct 2023 15:48:15 -0500 Subject: [PATCH 2/2] passing as argument to `fit_file` --- element_interface/run_caiman.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/element_interface/run_caiman.py b/element_interface/run_caiman.py index 6cb1559..91913c4 100644 --- a/element_interface/run_caiman.py +++ b/element_interface/run_caiman.py @@ -35,6 +35,13 @@ def run_caiman( parameters["fnames"] = file_paths parameters["fr"] = sampling_rate + if "indicies" in parameters: + indices = params.pop("indicies") + indicies = slice(*indices[0]), slice(*indices[1]) + parameters['motion'] = {**parameters.get('motion', {}), "indicies": indicies} + else: + indicies = None + opts = params.CNMFParams(params_dict=parameters) c, dview, n_processes = cm.cluster.setup_cluster( @@ -45,6 +52,7 @@ def run_caiman( cnm = CNMF(n_processes, params=opts, dview=dview) cnmf_output, mc_output = cnm.fit_file( motion_correct=True, + indices=indicies, include_eval=True, output_dir=output_dir, return_mc=True,