diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index cfe598cfd..f387492a4 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -727,18 +727,31 @@ def clean_string_values(param, ds): Returns ------- ds : xarray dataset with the strings cleaned up - """ + """ + + def xstrip(a): + func = lambda x: np.char.strip(x) + return xr.apply_ufunc(func, a.str.decode(encoding='utf-8')) + + def string_converter(da): + if da.dtype == np.dtype(object): + da = da.astype('