Skip to content

[MAINT] DeprecationWarning: use HasTraits.trait_set instead #2792

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

Merged
merged 2 commits into from
Nov 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions nipype/pipeline/engine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,15 @@ def save_resultfile(result, cwd, name):
tosave = _uncollapse(outputs.copy(), collapsed)
except AttributeError:
tosave = outputs = result.outputs.dictcopy() # outputs was a bunch
result.outputs.set(**modify_paths(tosave, relative=True, basedir=cwd))
for k, v in list(modify_paths(tosave, relative=True, basedir=cwd).items()):
setattr(result.outputs, k, v)

savepkl(resultsfile, result)
logger.debug('saved results in %s', resultsfile)

if result.outputs:
result.outputs.set(**outputs)
for k, v in list(outputs.items()):
setattr(result.outputs, k, v)


def load_resultfile(path, name):
Expand Down Expand Up @@ -360,8 +362,9 @@ def load_resultfile(path, name):
except AttributeError:
outputs = result.outputs.dictcopy() # outputs == Bunch
try:
result.outputs.set(
**modify_paths(outputs, relative=False, basedir=path))
for k, v in list(modify_paths(outputs, relative=False,
basedir=path).items()):
setattr(result.outputs, k, v)
except FileNotFoundError:
logger.debug('conversion to full path results in '
'non existent file')
Expand Down