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

[URGENT] Degenerate derivatives #1075

Closed
oesteban opened this issue Apr 27, 2018 · 5 comments · Fixed by #1095
Closed

[URGENT] Degenerate derivatives #1075

oesteban opened this issue Apr 27, 2018 · 5 comments · Fixed by #1095
Labels

Comments

@oesteban
Copy link
Member

Since #1001 was merged in, the bold derivatives (at least the space-MNI... ones) are broken.

My intuition is that these changes on the Datasink introduced some problem 744de95...677c556#diff-7bf7d3ca48aa501c95ee753280fb3ee1

If I track back the files to the node that feeds the datasink, they look okay.

@oesteban oesteban added the bug label Apr 27, 2018
@effigies
Copy link
Member

It's this bit:

https://github.com/poldracklab/fmriprep/blob/c76acd4efb89918fce517b3845688068705b3aa5/fmriprep/interfaces/bids.py#L252-L255

It assumes that the input is uncompressed.

@oesteban
Copy link
Member Author

@mgxd can you/would you like to submit a fix?

@effigies
Copy link
Member

I think if we do ext.endswith('.gz') and not fname.endswith('.gz'), that would work, but I guess we should actually make a smarter copy, like:

def copy_any(src, dst):
    src_gz = src.endswith('.gz')
    dst_gz = dst.endswith('.gz')
    if src_gz == dst_gz:
        copy(src, dst)
    src_open = gzip.open if src_gz else open
    dst_open = gzip.open if dst_gz else open
    with src_open(src, 'rb') as f_in:
        with dst_open(dst, 'wb') as f_out:
            copyfileobj(f_in, f_out)

And if we want to permit hardlinks, nipype's utils.filemanip.copyfile would be a good alternative to shutil.copy.

@oesteban
Copy link
Member Author

Closed via #1077

@oesteban oesteban reopened this May 1, 2018
@oesteban
Copy link
Member Author

oesteban commented May 1, 2018

Some of the reportlets are broken since we merged #1077:

https://2844-53175327-gh.circle-artifacts.com/0/tmp/ds000210/derivatives/fmriprep/sub-02.html

oesteban added a commit to oesteban/fmriprep that referenced this issue May 2, 2018
This PR tries to fix nipreps#1075 for good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants