#NEWLINE# def s_single_NDregion( p , shape , ls_classes ) : #NEWLINE# #INDENT# '\n    Simulate an N-dimensional region with a single peak.\n\n    This function is called repeatly by s_NDregion to build up a full\n    simulated region.\n\n    Parameters\n    ----------\n    p : list\n        List of parameters, must be a list.\n    shape : tuple\n        Shape of region.\n    ls_classes : list\n        List of lineshape classes.\n\n    Returns\n    -------\n    r : ndarray\n        Simulated region.\n\n    ' #NEWLINE# A = p . pop ( 0 ) #NEWLINE# r = np . array ( A , dtype = 'float' ) #NEWLINE# for ( length , ls_class ) in zip ( shape , ls_classes ) : #NEWLINE# #INDENT# s_p = [ p . pop ( 0 ) for i in range ( ls_class . nparam ( length ) ) ] #NEWLINE# ls = ls_class . sim ( length , s_p ) #NEWLINE# r = np . kron ( r , ls ) #NEWLINE# #UNINDENT# return r . reshape ( shape )