py_mesa_reader icon indicating copy to clipboard operation
py_mesa_reader copied to clipboard

Cannot open LOGS dir containing exactly one profile

Open jschwab opened this issue 7 years ago • 1 comments

In this example, LOGS is a MESA log dir with only one profile. The root cause is that when numpy.genfromtxt reads only one line from profiles.index, it returns an array of shape (3,) not (3,1).

I looked for a flag to genfromtxt that would force it to return a 2D array, but didn't see one.

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    mr.MesaLogDir('LOGS')
  File "/home/jschwab/Software/py_mesa_reader/mesa_reader/__init__.py", line 973, in __init__
    self.read_logs()
  File "/home/jschwab/Software/py_mesa_reader/mesa_reader/__init__.py", line 996, in read_logs
    self.profiles = MesaProfileIndex(self.index_path)
  File "/home/jschwab/Software/py_mesa_reader/mesa_reader/__init__.py", line 725, in __init__
    self.read_index()
  File "/home/jschwab/Software/py_mesa_reader/mesa_reader/__init__.py", line 745, in read_index
    self.index_data = temp_index_data[np.argsort(temp_index_data[:, 0])]
IndexError: too many indices for array

jschwab avatar Jan 04 '18 18:01 jschwab

I hope to get this edge case figured out some time this summer (finally).

wmwolf avatar May 27 '20 20:05 wmwolf