def get_tiles_height_width(n_tiles, desired_width=None):
 if (desired_width == None):
  width = int(np.ceil(np.sqrt(n_tiles)))
  height = width
 else:
  assert isinstance(desired_width, int)
  width = desired_width
  height = int(np.ceil((float(n_tiles) / width)))
 return (height, width)

def get_tiles_height_width ( n_tiles , desired_width = None ) : if ( desired_width == None ) : width = int ( np . ceil ( np . sqrt ( n_tiles ) ) ) height = width else : assert isinstance ( desired_width , int ) width = desired_width height = int ( np . ceil ( ( float ( n_tiles ) / width ) ) ) return ( height , width )
get a height x width size that will fit n_tiles tiles .