cf.Data.cfa_del_file_substitution

Data.cfa_del_file_substitution(base)[source]

Remove a CFA-netCDF file name substitution.

New in version 3.15.0.

Parameters
base: str

The substitution definition to be removed. May be specified with or without the ${...} syntax. For instance, the following are equivalent: 'base' and '${base}'.

Returns

dict

The removed CFA-netCDF file name substitution. If the substitution was not defined then an empty dictionary is returned.

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'))
{}