sigvaldm / metaplot

Metadata-based plotting from CSV and similar files
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Output reasonable error for incomplete lines in files #41

Open sigvaldm opened 5 years ago

sigvaldm commented 5 years ago

Now it looks like this if a line is incomplete:

$ mpl history.dat ne ni
Traceback (most recent call last):
  File "/usr/bin/mpl", line 11, in <module>
    load_entry_point('metaplot', 'console_scripts', 'mpl')()
  File "/home/sigvald/Codes/metaplot/metaplot/cli.py", line 107, in mpl
    df = DataFrame(f)
  File "/home/sigvald/Codes/metaplot/metaplot/core.py", line 134, in __init__
    self._init_from_filename(arg)
  File "/home/sigvald/Codes/metaplot/metaplot/core.py", line 142, in _init_from_filename
    self._init_from_file(file)
  File "/home/sigvald/Codes/metaplot/metaplot/core.py", line 147, in _init_from_file
    self._init_from_reader(reader)
  File "/home/sigvald/Codes/metaplot/metaplot/core.py", line 189, in _init_from_reader
    self[name] = Series(raw_data[i], units=units, **meta)
IndexError: list index out of range