def get_tdms_files(directory):
    path = pathlib.Path(directory).resolve()
    tdmslist = [r for r in path.rglob("*.tdms") if r.is_file()]
    tdmslist = [r for r in tdmslist if not r.name.endswith("_traces.tdms")]
    return sorted(tdmslist)