Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open LOGS dir containing exactly one profile #9

Open
jschwab opened this issue Jan 4, 2018 · 1 comment
Open

Cannot open LOGS dir containing exactly one profile #9

jschwab opened this issue Jan 4, 2018 · 1 comment
Assignees
Labels

Comments

@jschwab
Copy link
Collaborator

jschwab commented Jan 4, 2018

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
@wmwolf
Copy link
Owner

wmwolf commented May 27, 2020

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

@wmwolf wmwolf self-assigned this May 27, 2020
@wmwolf wmwolf added the bug label May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants