def fincre(oldname):
    """Increment the synphot version number from a filename"""
    x=re.search('_(?P<version>[0-9][0-9][0-9])_syn',oldname)
    version=x.group('version')
    newversion="%03d"%(int(version)+1)
    ans=oldname.replace(version,newversion)
    return ans
def fincre ( oldname ) : x = re . search ( '_(?P<version>[0-9][0-9][0-9])_syn' , oldname ) version = x . group ( 'version' ) newversion = "%03d" % ( int ( version ) + 1 ) ans = oldname . replace ( version , newversion ) return ans
Increment the synphot version number from a filename