SIMEXP / Data2Bids

Reorganize fmri files to make them BIDS compliant.
MIT License
11 stars 2 forks source link

File system does not display at the end #16

Closed Aaronearlerichardson closed 5 years ago

Aaronearlerichardson commented 5 years ago

program was not fully executing and gave me errors:

Traceback (most recent call last): 
  File "/home/aaron/.local/bin/data2bids", line 62, in <module> 
    main() 
  File "/home/aaron/.local/bin/data2bids", line 59, in main
    data2bids.run()
  File "/home/aaron/.local/lib/python3.6/site-packages/data2bids/data2bids.py", line 295, in run
    utils.tree(self._bids_dir)
  File "/home/aaron/.local/lib/python3.6/site-packages/data2bids/utils.py", line 84, in tree
    for path_to_display in paths:
  File "/home/aaron/.local/lib/python3.6/site-packages/data2bids/utils.py", line 43, in make_tree
    for path in root.iterdir()
  File "/home/aaron/.local/lib/python3.6/site-packages/data2bids/utils.py", line 44, in <genexpr>
    if criteria(path)),
TypeError: _default_criteria() takes 1 positional argument but 2 were given

I changed the _default_criteria to look like below and it worked:

@classmethod
    def _default_criteria(cls, infile):
        import os
        if os.path.isdir(infile):
            return True
        else:
            return False
ltetrel commented 5 years ago

Thanks for your feedback @Aaronearlerichardson, I tested it and it works, I will merge your change and push the newest version on pip.