mjoyceGR / MESA2HYDRO

creates a Phantom-compatible initial conditions file from a MESA stellar density profile
Other
4 stars 2 forks source link

Add newline for NR output #14

Closed cassidymwagner closed 4 years ago

cassidymwagner commented 4 years ago

I noticed a small bug when generating NR files. Although the file is generated without error, when running run_conversion.py, I get the following TypeError:

Traceback (most recent call last):
  File "./run_conversion.py", line 211, in <module>
    mn.get_IC(MESA_file, masscut, in_file, out_file, mp,\
  File ".../MESA2HYDRO-1.1.2-py3.8-linux-x86_64.egg/MESA2HYDRO/lib/mainlib.py", line 181, in get_IC
    for i in range(len(N)):
TypeError: object of type 'numpy.float64' has no len()

loadtxt in line 167 of mainlib.py expects a column for N, but only receives a single line since converge_funcs.py doesn't create a newline.

All I did was add \n and that solved the error on my end!

mjoyceGR commented 4 years ago

Thanks Cassidy, it's been accepted!