[docs]defread_dense_array(path:str,metadata:Dict[str,Any],**kwargs)->ReloadedArray:""" Read a dense array from its on-disk representation. In general, this function should not be called directly but instead be dispatched via :py:meth:`~dolomite_base.read_object.read_object`. Args: path: Path to the directory containing the object. metadata: Metadata for this object. kwargs: Further arguments, ignored. Returns: A :py:class:`~dolomite_matrix.ReloadedArray.ReloadedArray` containing a HDF5-backed dense array as a seed. """fpath=os.path.join(path,"array.h5")name="dense_array"withh5py.File(fpath,"r")ashandle:ghandle=handle[name]dhandle=ghandle["data"]tt=ghandle.attrs["type"]dtype=Noneiftt=="boolean":dtype=numpy.dtype("bool")eliftt=="string":dtype_name="U"+str(dhandle.dtype.itemsize)dtype=numpy.dtype(dtype_name)eliftt=="float":ifnotnumpy.issubdtype(dhandle.dtype,numpy.floating):dtype=numpy.dtype("float64")transposed=Falseif"transposed"inghandle.attrs:transposed=(ghandle.attrs["transposed"]!=0)placeholder=Noneif"missing-value-placeholder"indhandle.attrs:placeholder=dhandle.attrs["missing-value-placeholder"]dname=name+"/data"is_native=nottransposedifplaceholderisNone:seed=Hdf5DenseArraySeed(fpath,dname,dtype=dtype,native_order=is_native)else:core=Hdf5DenseArraySeed(fpath,dname,native_order=is_native)seed=DelayedMask(core,placeholder=placeholder,dtype=dtype)returnReloadedArray(seed,path)