cf.Data.get_filenames¶
- Data.get_filenames(normalise=False, per_chunk=False)[source]¶
The names of files containing parts of the data array.
Returns the names of any files that may be required to deliver the computed data array.
See also
replace_filenames, `replace_directory- Parameters:
- normalise:
bool, optional If True then normalise to an absolute path. If False (the default) then no normalisation is done.
Added in version (cfdm): 1.12.0.0
- per_chunk:
bool, optional Return a
numpyarray that provides the file name that contributes to each Dask chunk. This array will have the same shape as the Dask chunks (as returned by thenumblocksattribute).Added in version (cfdm): 1.12.0.0
- normalise:
- Returns:
Examples
>>> d = cf.Data.empty((5, 8), 1, chunks=4) >>> d.get_filenames() set()
>>> f = cf.example_field(0) >>> cf.write(f, "file.nc") >>> d = cf.read("file.nc", dask_chunks'128 B')[0].data >>> d.get_filenames() {'file.nc'}
>>> d.numblocks (2, 2) >>> filenames = d.get_filenames(per_chunk=True) >>> filenames.shape (2, 2) >>> print(filenames) [['file.nc' 'file.nc'] ['file.nc' 'file.nc']]