cf.Data.cfa_has_file_substitutions

Data.cfa_has_file_substitutions()[source]

Whether any CFA-netCDF file name substitutions have been set.

New in version 3.15.0.

Returns
bool

True if any CFA-netCDF file name substitutions have been set, otherwise False.

Examples

>>> f.cfa_update_file_substitutions({'base': 'file:///data/'})
>>> f.cfa_has_file_substitutions()
True
>>> f.cfa_file_substitutions()
{'${base}': 'file:///data/'}
>>> f.cfa_update_file_substitutions({'${base2}': '/home/data/'})
>>> f.cfa_file_substitutions()
{'${base}': 'file:///data/', '${base2}': '/home/data/'}
>>> f.cfa_update_file_substitutions({'${base}': '/new/location/'})
>>> f.cfa_file_substitutions()
{'${base}': '/new/location/', '${base2}': '/home/data/'}
>>> f.cfa_del_file_substitution('${base}')
{'${base}': '/new/location/'}
>>> f.cfa_clear_file_substitutions()
{'${base2}': '/home/data/'}
>>> f.cfa_has_file_substitutions()
False
>>> f.cfa_file_substitutions()
{}
>>> f.cfa_clear_file_substitutions()
{}
>>> print(f.cfa_del_file_substitution('base', None))
None