splitext

ndmapper.libutils.splitext(path)[source] [edit on github]

A version of splitext that splits at the first separator rather than the last one (so ‘file.fits.gz’ gives ‘file’ & ‘fits.gz’). It also returns None for the extension value where there isn’t one (instead of ‘’), just to avoid incorrect reconstruction of ‘file.’ as ‘file’ or vice versa.