Io
get_files(datasets_spec, ext='.nc')
Get a list of filenames based on the provided datasets specification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
datasets_spec |
DictConfig
|
The datasets specification containing the path and extension. |
required |
ext |
str
|
The file extension to filter the search. Defaults to ".nc". |
'.nc'
|
Returns:
Type | Description |
---|---|
List[str]: A list of filenames. |
Source code in rs_tools/_src/utils/io.py
get_list_filenames(data_path='./', ext='*')
Loads a list of file names within a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_path |
str
|
The directory path to search for files. Defaults to "./". |
'./'
|
ext |
str
|
The file extension to filter the search. Defaults to "*". |
'*'
|
Returns:
Type | Description |
---|---|
List[str]: A sorted list of file names matching the given extension within the directory. |