Skip to content

Cannot open LOGS dir containing exactly one profile #9

@jschwab

Description

@jschwab

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions