-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
In refrence solve the previous issue when i tried to run latex file it result in the following issue
Latex reader should accept tables without \begin/\end #4295
from astropy.table import Table
In [41]: dat = Table.read('sample.tex', format='latex')
InconsistentTableError Traceback (most recent call last)
in ()
----> 1 dat = Table.read('sample.tex', format='latex')
/home/dell/astropy/astropy/table/table.pyc in read(cls, _args, *_kwargs)
2291 passed through to the underlying data reader (e.g. ~astropy.io.ascii.read).
2292 """
-> 2293 return io_registry.read(cls, _args, *_kwargs)
2294
2295 def write(self, _args, *_kwargs):
/home/dell/astropy/astropy/io/registry.pyc in read(cls, _args, *_kwargs)
342
343 reader = get_reader(format, cls)
--> 344 data = reader(_args, *_kwargs)
345
346 if not isinstance(data, cls):
/home/dell/astropy/astropy/io/ascii/connect.pyc in io_read(format, filename, *_kwargs)
35 from .ui import read
36 format = re.sub(r'^ascii.', '', format)
---> 37 return read(filename, format=format, *_kwargs)
38
39
/home/dell/astropy/astropy/io/ascii/ui.pyc in read(table, guess, **kwargs)
337 ' with fast (no guessing)'})
338 else:
--> 339 dat = reader.read(table)
340 _read_trace.append({'kwargs': new_kwargs,
341 'status': 'Success with specified Reader class '
/home/dell/astropy/astropy/io/ascii/core.pyc in read(self, table)
1043
1044 # Get the table column definitions
-> 1045 self.header.get_cols(self.lines)
1046
1047 # Make sure columns are valid
/home/dell/astropy/astropy/io/ascii/core.pyc in get_cols(self, lines)
480 raise ValueError('No header line found in table')
481
--> 482 self.names = next(self.splitter([line]))
483
484 self._set_cols_from_names()
/home/dell/astropy/astropy/io/ascii/core.pyc in call(self, lines)
244 if self.process_line:
245 lines = (self.process_line(x) for x in lines)
--> 246 for line in lines:
247 vals = line.split(self.delimiter)
248 if self.process_val:
/home/dell/astropy/astropy/io/ascii/core.pyc in ((x,))
243 def call(self, lines):
244 if self.process_line:
--> 245 lines = (self.process_line(x) for x in lines)
246 for line in lines:
247 vals = line.split(self.delimiter)
/home/dell/astropy/astropy/io/ascii/latex.pyc in process_line(self, line)
88 line = line.strip(r'')
89 else:
---> 90 raise core.InconsistentTableError(r'Lines in LaTeX table have to end with ')
91 return line
92
InconsistentTableError: Lines in LaTeX table have to end with \
We must change the code in latex.py read function because its common error when tried to read a latex filr