namespaces module¶
Utility functions and classes to handle namespaces.
The namespaces implementation itself is mainly in grammars
and
discipline
- gemseo.core.namespaces.remove_prefix_from_list(names)[source]
Remove namespaces prefixes from names, if any.
- gemseo.core.namespaces.remove_prefix_from_name(name)[source]
Remove namespace prefix from the name.
- gemseo.core.namespaces.split_namespace(name)[source]
Return the (namespace, name) pair from a data name.
For instance if data_name =
my:namespace:a
and the separator is:
, returns (my:namespace
,``a``).If there is no namespace prefix in
data_name
, returnsdata_name
.In case data_name contains the namespace separator but empty name, or empty namespace, returns the (namespace, name) pair, containing eventually empty strings.
- gemseo.core.namespaces.update_namespaces(namespaces, other_namespaces)[source]
Update namespaces with the key/value pairs from other, overwriting existing keys.
- Parameters:
namespaces (MutableMapping[str, str | list[str]]) – The namespaces to update.
other_namespaces (MutableMapping[str, str | list[str]]) – The namespaces to update from.
- Return type:
None