Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add Convolve transformation if there are hrf_variables, fix user pred search #80

Merged
merged 2 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyns/models/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ def create_analysis(self, *, name, dataset_name, predictor_names,
set([p['name'] for p in public_preds])
if private_preds:
# Get Predictor IDs
predictors += [p['id'] for p in self._client.user.get_predictors(
run_id=run_id, name=private_preds)]
for pred in private_preds:
predictors += [p['id']
for p in self._client.user.get_predictors(
run_id=run_id, name=pred)]

if len(predictors) != len(predictor_names):
raise ValueError(
Expand Down
9 changes: 5 additions & 4 deletions pyns/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ def build_model(name, variables, task, subject, run=None, session=None,
if not set(variables) >= set(hrf_variables):
raise ValueError("HRF Variables must be a subset of all variables")

transformations.append({
"Input": hrf_variables,
"Name": "Convolve"
})
if hrf_variables:
transformations.append({
"Input": hrf_variables,
"Name": "Convolve"
})

model = {
"Steps": [
Expand Down