Advertisement
SVXX

Astropy Tables Bug

May 18th, 2014
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.93 KB | None | 0 0
  1. In [39]: from astropy.table import Table
  2.  
  3. In [40]: a = [1, 4, 5]
  4.  
  5. In [41]: b = [2.0, 5.0, 8.2]
  6.  
  7. In [42]: c = ['x', 'y', 'z']
  8.  
  9. In [44]: t = Table([a, b, c], names=('First', 'Second', 'Third'), meta={'name': 'First Table'})
  10.  
  11. In [45]: t
  12. Out[45]:
  13. <Table rows=3 names=('First','Second','Third')>
  14. array([(1, 2.0, 'x'), (4, 5.0, 'y'), (5, 8.2, 'z')],
  15.       dtype=[('First', '<i4'), ('Second', '<f8'), ('Third', 'S1')])
  16.  
  17. In [46]: print(t)
  18. ---------------------------------------------------------------------------
  19. IndexError                                Traceback (most recent call last)
  20. <ipython-input-46-d6c4f5caf31e> in <module>()
  21. ----> 1 print(t)
  22.  
  23. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/table/table.py in __bytes__(self)
  24.     660
  25.     661     def __bytes__(self):
  26. --> 662         return six.text_type(self).encode('utf-8')
  27.     663     if six.PY2:
  28.     664         __str__ = __bytes__
  29.  
  30. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/table/table.py in __unicode__(self)
  31.     654
  32.     655     def __unicode__(self):
  33. --> 656         lines, n_header = self.formatter._pformat_table(self)
  34.     657         return '\n'.join(lines)
  35.     658     if six.PY3:
  36.  
  37. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/table/pprint.py in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, html, tableid)
  38.     282         # "Print" all the values into temporary lists by column for subsequent
  39.     283         # use and to determine the width
  40. --> 284         max_lines, max_width = self._get_pprint_size(max_lines, max_width)
  41.     285         cols = []
  42.     286
  43.  
  44. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/table/pprint.py in _get_pprint_size(max_lines, max_width)
  45.      97         """
  46.     98         if max_lines is None or max_width is None:
  47. ---> 99             lines, width = terminal_size()
  48.    100
  49.    101         if max_lines is None:
  50.  
  51. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/utils/console.pyc in terminal_size(file)
  52.    128         except TypeError:
  53.    129             # fall back on configuration variables
  54. --> 130             return conf.max_lines, conf.max_width
  55.    131
  56.    132
  57.  
  58. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/config/configuration.pyc in __get__(self, obj, objtype)
  59.    274         if obj is None:
  60.    275             return self
  61. --> 276         return self()
  62.    277
  63.    278     def set(self, value):
  64.  
  65. /home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/config/configuration.pyc in __call__(self)
  66.    401                     "is deprecated. Use '{3}' in section [{4}] instead.".format(
  67.    402                         name, module, get_config_filename(filename),
  68. --> 403                         self.name, self.module.split('.', 1)[1]),
  69.    404                     AstropyDeprecationWarning)
  70.    405                 options.append((sec[name], module, name))
  71.  
  72. IndexError: list index out of range
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement