noahbenson / neuropythy

A neuroscience library for Python, intended to complement the existing nibabel library.
GNU Affero General Public License v3.0
115 stars 21 forks source link

AttributeError on copy() #5

Closed MaxvandenBoom closed 6 years ago

MaxvandenBoom commented 6 years ago

I tried to use neuropythy by first installing pip install neuropythy and then importing import neuropythy as ny

Here I encountered an issue, stating:

  File "/home/max/.local/lib/python2.7/site-packages/neuropythy/freesurfer/core.py", line 73, in add_subject_path
    fsp0 = fsp.copy()
AttributeError: 'list' object has no attribute 'copy'

Upon inspection of 'core.py' I found the line mentioned: fsp0 = fsp.copy(). The variable that was created on this line is not used anywhere. I commented out this line, after which the import works, including the 'benson14_retinotopy' functionality which broke before on the import.

There is another occurance of the copy attribute in the core.py file: sd = fsp.copy() but in my scenario it does not seem to reach that line.

Although it is working for me, others might encounter this issue.

noahbenson commented 6 years ago

Hi there, thanks for the bug report. Huh--apparently Python lists don't have a copy method prior to 3.3. I just pushed a bug fix to github and once the tests pass I'll push it to PyPI. It's possible that a similar error will come up other places in the code (though I can't recall any, and I couldn't find any in a quick search). Please file another report if so!