BIDS/datarray

datarray_to_string chokes on str dtype

kwgoodman opened this issue · 3 comments

>> DataArray(['a'])
DataArray(['a'], 
      dtype='|S1')
(None,)

>> print datarray_to_string(DataArray(['a']))
<snip>
TypeError: unbound method max_width() must be called with StrFormatter instance as first argument (got nothing instead)

As a workaround perhaps enclose in a try...except and fallback to datarray.str if it fails.

seems like the bug is get_formatter in print_grid returning StrFormatter(the type) instead of an instance, I'm goign to update the bugfix tests and do submit a pull request

Fixed in d304a73