namespace.py¶
This module provides utilities for grouping objects into namespaces.
- hutch_python.namespace.class_namespace(cls, scope=None)¶
- Create a - namespacethat contains objects of a specific type.- Parameters
- cls ( - typeor- str) –
- scope ( - module,- namespace, or- listof these) – Every object attached to the given modules will be considered for the- class_namespace. If- scopeis omitted, we’ll check all objects loaded by- hutch-pythonand everything in the caller’s global frame. If anything is an instance of- ophyd.Device, we’ll also include the object’s components as part of the scope, using the- nameattribute to identify them rather than the attribute name on the device. This will continue recursively, skipping lazy and dynamic components.
 
- Returns
- namespace 
- Return type
 
- hutch_python.namespace.tree_namespace(scope=None)¶
- Create a - namespacethat accumulates objects and creates a tree.- This tree is a nested set of - IterableNamespaceobjects based on the object names as defined in scope. We will split on underscores and use the splits to create the tree.- Parameters
- scope ( - module,- namespace, or- listof these) – Every object attached to the given modules will be considered for the- tree_namespace. If- scopeis omitted, we’ll check all objects loaded by- hutch-pythonand everything in the caller’s global frame.
- Returns
- namespace 
- Return type