The data_write function in data.py uses repr to serialize data in the data objects currently. While this often produces the same output as str (str depends on repr) it does not always produce what needs to be output and read in by Fortran code. This was found while trying to switch some paths to the newer pathlib library
from pathlib import Path
my_path = Path() / "my_data.txt"
so that repr(my_path) produces
"PosixPath('my_data.txt')"
where as str(my_path) or f"{my_path}" produces
Note that this is the correct behavior of repr and str, we have just been using them incorrectly.
The
data_writefunction indata.pyusesreprto serialize data in the data objects currently. While this often produces the same output asstr(strdepends onrepr) it does not always produce what needs to be output and read in by Fortran code. This was found while trying to switch some paths to the newerpathliblibraryso that
repr(my_path)produceswhere as
str(my_path)orf"{my_path}"producesNote that this is the correct behavior of
reprandstr, we have just been using them incorrectly.