Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RF: os.path.abspath(x) -> os.path.join(runtime.cwd, x)#249

Merged
oesteban merged 3 commits intonipreps:masterfrom
effigies:rf/runtime_cwd
Jul 6, 2018
Merged

RF: os.path.abspath(x) -> os.path.join(runtime.cwd, x)#249
oesteban merged 3 commits intonipreps:masterfrom
effigies:rf/runtime_cwd

Conversation

@effigies
Copy link
Member

@effigies effigies commented Jul 6, 2018

When runtime is available, and we're creating a file in the working directory, the best practice is to use os.path.join(runtime.cwd, fname) over os.path.abspath(fname). This was established in nipy/nipype#2380, as some interfaces can fail on OSX due to whatever is going on with /var and /private/var.

Ran into this with EstimateReferenceImage while working on nipreps/fmriprep#1074.

Not urgent, as I need ANTs anyway, and so have switched to working in Docker. There may be some other cases that can be moved; these were just the obvious ones.

Also removed a couple redundant calls to os.path.abspath(fname) when fname was defined with runtime.cwd already.

@oesteban oesteban merged commit e9502e0 into nipreps:master Jul 6, 2018
@effigies effigies deleted the rf/runtime_cwd branch July 9, 2018 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants