From 5078af948c6a9154e274a57ebeef5f06c8454d56 Mon Sep 17 00:00:00 2001 From: Alejandro de la Vega Date: Tue, 12 Oct 2021 12:44:51 -0500 Subject: [PATCH 1/2] Upload cli_args to neuroscout --- pyns/models/analysis.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyns/models/analysis.py b/pyns/models/analysis.py index 4e9c272..3ceb12c 100644 --- a/pyns/models/analysis.py +++ b/pyns/models/analysis.py @@ -330,7 +330,7 @@ def plot_report(self, id, run_id=None, plot_type='design_matrix_plot', def upload_neurovault(self, id, validation_hash, subject_paths=None, group_paths=None, collection_id=None, force=False, cli_version=None, fmriprep_version=None, - estimator=None, n_subjects=None): + estimator=None, n_subjects=None, cli_args=None): """ Submit analysis for report generation :param str id: Analysis hash_id. :param str validation_hash: Validation hash string. @@ -341,7 +341,8 @@ def upload_neurovault(self, id, validation_hash, subject_paths=None, :param str: fmriprep version at runtime :param str: estimator used in fitlins (anfi/nilearn) :param int n_subjects: Number of subjects in analysis. - :return: client response object + :param dict runtime_options + :return: dict cli_args Arguments specified to CLI at runtime """ def _ts_first(paths): @@ -361,7 +362,7 @@ def _ts_first(paths): id=id, sub_route='upload', files=files, level='GROUP', validation_hash=validation_hash, force=force, fmriprep_version=fmriprep_version, estimator=estimator, - cli_version=cli_version, n_subjects=n_subjects, + cli_version=cli_version, n_subjects=n_subjects, cli_args=cli_args, collection_id=collection_id) if collection_id is None: collection_id = req['collection_id'] From e9902732ab5269eb6cff2f947095ddc722091a14 Mon Sep 17 00:00:00 2001 From: Alejandro de la Vega Date: Wed, 13 Oct 2021 14:50:23 -0500 Subject: [PATCH 2/2] Jsonify before pushing dict' --- pyns/models/analysis.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyns/models/analysis.py b/pyns/models/analysis.py index 3ceb12c..4f81324 100644 --- a/pyns/models/analysis.py +++ b/pyns/models/analysis.py @@ -9,6 +9,7 @@ import tqdm import time import re +import json altair = attempt_to_import('altair') nib = attempt_to_import('nibabel') @@ -362,8 +363,8 @@ def _ts_first(paths): id=id, sub_route='upload', files=files, level='GROUP', validation_hash=validation_hash, force=force, fmriprep_version=fmriprep_version, estimator=estimator, - cli_version=cli_version, n_subjects=n_subjects, cli_args=cli_args, - collection_id=collection_id) + cli_version=cli_version, n_subjects=n_subjects, + cli_args=json.dumps(cli_args), collection_id=collection_id) if collection_id is None: collection_id = req['collection_id']