gemseo / core

Show inherited members

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.

Parameters:

names (Iterable[str]) – The names that may contain namespaces.

Returns:

The names without prefixes in its keys.

Return type:

list[str]

gemseo.core.namespaces.remove_prefix_from_name(name)[source]

Remove namespace prefix from the name.

Parameters:

name (str) – The container of data names, or a single data name.

Returns:

The data names without prefixes.

Return type:

str

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, returns data_name.

In case data_name contains the namespace separator but empty name, or empty namespace, returns the (namespace, name) pair, containing eventually empty strings.

Parameters:

name (str) – The data name containing the namespace name.

Returns:

The namespace name and the data name.

Return type:

list[str, str]

gemseo.core.namespaces.update_namespaces(namespaces, other_namespaces)[source]

Update namespaces with the key/value pairs from other, overwriting existing keys.

Parameters:
Return type:

None