cf.Data.cfa_clear_file_substitutions

Data.cfa_clear_file_substitutions()[source]

Remove all of the CFA-netCDF file name substitutions.

New in version 3.15.0.

Returns
dict

The removed CFA-netCDF file name substitutions in a dictionary whose key/value pairs are the file name parts to be substituted and their corresponding substitution text.

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