pyrats/utils.py
def _get_extension(hnum=None, timestep=None, Galaxy=False, bhid=None, radius=None):
    '''
    when centering around BH/Halo/Gal w/ w/o a given radius
    output is the extension to keep track of the informations
    '''
    if hnum != None:
        if Galaxy:
            name = 'Galaxy{}'.format(hnum)
        else:
            name = 'Halo{}'.format(hnum)
        if timestep != None:
            name += '_output{:05}'.format(timestep)

    if bhid != None:
        name = 'BH{}'.format(bhid)

    if ((type(radius) is int) | (type(radius) is float)):
        name += '_{}dx'.format(radius)
    elif (type(radius) is tuple):
        if ((type(radius[0]) is int) | (type(radius) is float)) & (type(radius[1]) is str):
            name += '_{}{}'.format(radius[0],radius[1])
        else:
            raise TypeError('Please give the radius with the form (10,\'pc\')')
    else:
        raise TypeError('Please give an int or a tuple like (10, \'pc\') for the radius')


    return name

    when centering around BH/Halo/Gal w/ w/o a given radius
    output is the extension to keep track of the informations
    
when centering around BH/Halo/Gal w/ w/o a given radius
output is the extension to keep track of the informations
when centering around BH / Halo / Gal w / w / o a given radius output is the extension to keep track of the informations
def _get_extension(hnum=None, timestep=None, Galaxy=False, bhid=None, radius=None):
    if hnum != None:
        if Galaxy:
            name = 'Galaxy{}'.format(hnum)
        else:
            name = 'Halo{}'.format(hnum)
        if timestep != None:
            name += '_output{:05}'.format(timestep)
    if bhid != None:
        name = 'BH{}'.format(bhid)
    if ((type(radius) is int) | (type(radius) is float)):
        name += '_{}dx'.format(radius)
    elif (type(radius) is tuple):
        if ((type(radius[0]) is int) | (type(radius) is float)) & (type(radius[1]) is str):
            name += '_{}{}'.format(radius[0],radius[1])
        else:
            raise TypeError('Please give the radius with the form (10,\'pc\')')
    else:
        raise TypeError('Please give an int or a tuple like (10, \'pc\') for the radius')
    return name
def _get_extension ( hnum = None , timestep = None , Galaxy = False , bhid = None , radius = None ) : if hnum != None : if Galaxy : name = 'Galaxy{}' . format ( hnum ) else : name = 'Halo{}' . format ( hnum ) if timestep != None : name += '_output{:05}' . format ( timestep ) if bhid != None : name = 'BH{}' . format ( bhid ) if ( ( type ( radius ) is int ) | ( type ( radius ) is float ) ) : name += '_{}dx' . format ( radius ) elif ( type ( radius ) is tuple ) : if ( ( type ( radius [ 0 ] ) is int ) | ( type ( radius ) is float ) ) & ( type ( radius [ 1 ] ) is str ) : name += '_{}{}' . format ( radius [ 0 ] , radius [ 1 ] ) else : raise TypeError ( 'Please give the radius with the form (10,\'pc\')' ) else : raise TypeError ( 'Please give an int or a tuple like (10, \'pc\') for the radius' ) return name
when centering around BH/Halo/Gal w/ w/o a given radius
output is the extension to keep track of the informations
when centering around BH / Halo / Gal w / w / o a given radius output is the extension to keep track of the informations
'''
    when centering around BH/Halo/Gal w/ w/o a given radius
    output is the extension to keep track of the informations
    '''
hnum
timestep
Galaxy
bhid
radius