def histogram1d(data, bins=None, *args, **kwargs):
    """Facade function to create one-dimensional histogram using dask.

    Parameters
    ----------
    data: dask.DaskArray or array-like

    See also
    --------
    physt.histogram
    """
    import dask
    if not hasattr(data, "dask"):
        data = dask.array.from_array(data, chunks=int(data.shape[0] / options["chunk_split"]))

    if not kwargs.get("adaptive", True):
        raise RuntimeError("Only adaptive histograms supported for dask (currently).")
    kwargs["adaptive"] = True

    def block_hist(array):
        return original_h1(array, bins, *args, **kwargs)

    return _run_dask(
        name="dask_adaptive1d",
        data=data,
        compute=kwargs.pop("compute", True),
        method=kwargs.pop("dask_method", "threaded"),
        func=block_hist)
def histogram1d ( data , bins = None , * args , ** kwargs ) : import dask if not hasattr ( data , "dask" ) : data = dask . array . from_array ( data , chunks = int ( data . shape [ 0 ] / options [ "chunk_split" ] ) ) if not kwargs . get ( "adaptive" , True ) : raise RuntimeError ( "Only adaptive histograms supported for dask (currently)." ) kwargs [ "adaptive" ] = True def block_hist ( array ) : return original_h1 ( array , bins , * args , ** kwargs ) return _run_dask ( name = "dask_adaptive1d" , data = data , compute = kwargs . pop ( "compute" , True ) , method = kwargs . pop ( "dask_method" , "threaded" ) , func = block_hist )
Facade function to create one-dimensional histogram using dask.

    Parameters
    ----------
    data: dask.DaskArray or array-like

    See also
    --------
    physt.histogram