#NEWLINE# def linspace( start , stop , num = 50 , chunks = None , dtype = None ) : #NEWLINE# #INDENT# '\n    Return `num` evenly spaced values over the closed interval [`start`,\n    `stop`].\n\n    TODO: implement the `endpoint`, `restep`, and `dtype` keyword args\n\n    Parameters\n    ----------\n    start : scalar\n        The starting value of the sequence.\n    stop : scalar\n        The last value of the sequence.\n    chunks :  int\n        The number of samples on each block. Note that the last block will have\n        fewer samples if `num % blocksize != 0`\n    num : int, optional\n        Number of samples to in the returned dask array, including the\n        endpoints.\n\n    Returns\n    -------\n    samples : dask array\n\n    ' #NEWLINE# num = int ( num ) #NEWLINE# if ( chunks is None ) : #NEWLINE# #INDENT# raise ValueError ( 'Must supply a chunks= keyword argument' ) #NEWLINE# #UNINDENT# chunks = normalize_chunks ( chunks , ( num , ) ) #NEWLINE# range_ = ( stop - start ) #NEWLINE# space = ( float ( range_ ) / ( num - 1 ) ) #NEWLINE# name = ( 'linspace-' + tokenize ( ( start , stop , num , chunks , dtype ) ) ) #NEWLINE# dsk = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# blockstart = start #NEWLINE# for ( i , bs ) in enumerate ( chunks [ 0 ] ) : #NEWLINE# #INDENT# blockstop = ( blockstart + ( ( bs - 1 ) * space ) ) #NEWLINE# task = ( partial ( np . linspace , dtype = dsk ) , blockstart , blockstop , bs ) #NEWLINE# blockstart = ( blockstart + ( space * bs ) ) #NEWLINE# dsk [ ( name , i ) ] = task #NEWLINE# #UNINDENT# return Array ( dsk , name , chunks , dtype = dtype )