Commits
1833 1833 | if isinstance(param, ptype): # a string or a number |
1834 1834 | if ptype is str: return param.split() |
1835 1835 | elif convert: |
1836 1836 | return [ ptype(param) ] |
1837 1837 | else: return [ param ] |
1838 1838 | if _is_sequence_or_number(param, ptype): |
1839 1839 | return list(param) |
1840 1840 | elif convert: |
1841 1841 | return [ ptype(p) for p in param] |
1842 1842 | return None |
1843 - | |
1844 - | |
1845 - | def tentative_chrono_sort(infiles): |
1846 - | assert isinstance(infiles, (list, numpy.ndarray, set)) |
1847 - | |
1848 - | sortedvis = [] |
1849 - | namestuples = [] |
1850 - | for name in infiles: |
1851 - | assert isinstance(name, str) |
1852 - | assert os.path.exists(name) |
1853 - | with tbmanager(name) as t: |
1854 - | t.open(name) |
1855 - | times = t.getcol('TIME') |
1856 - | times.sort() |
1857 - | namestuples.append((times[0], name, 0)) |
1858 - | |
1859 - | sorted_namestuples = sorted(namestuples, key=lambda msname: msname[0]) |
1860 - | |
1861 - | for i in range(len(infiles)): |
1862 - | sortedvis.append(sorted_namestuples[i][1]) |
1863 - | |
1864 - | return sortedvis |