amuse
amuse copied to clipboard
the "txt" format file I/O cannot round trip
Describe the bug I wrote a conversion script (for NEMO) for snapshots, but it fails for the "txt" format. It's ok for "csv", "dyn" and "tsf"
To Reproduce From the commandline
fmt=txt
amuse_convert.py -o junk1 -O $fmt -n 100
amuse_convert.py -i junk1 -I $fmt -o junk2 -O $fmt
amuse.io.base.IoException: IO exception: Number of values on line
'0.01 0.0 -0.319149817818 0.911387278048 0.00131274766207 -1.22528821614 -0.310636170602 0.0257190619401' is 8, expected 0
Expected behavior I'd expect the junk1 and junk2 files here to be identical, as they do for other formats
Logs
Environment (please complete the following information):
- kubuntu 24.04
Additional context
Although the script isn't quite finished yet (the -w flag does not work), the code is here and should work within AMUSE:
https://github.com/teuben/nemo/blob/master/src/scripts/python/amuse_convert.py