cfdm.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.
New in version (cfdm): 1.12.0.0
- per_chunk:
bool
, optional Return a
numpy
array 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 thenumblocks
attribute).New in version (cfdm): 1.12.0.0
- normalise:
- Returns
Examples
>>> d = cfdm.Data.empty((5, 8), 1, chunks=4) >>> d.get_filenames() set()
>>> f = cfdm.example_field(0) >>> cfdm.write(f, "file.nc") >>> d = cfdm.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']]