bluesky_queueserver_api.BFunc¶
- class bluesky_queueserver_api.BFunc(*args, **kwargs)[source]¶
The helper class for creating dictionary representing a function. The class functionality is similar to
BItems
, but configured for operations with items that represent functions.- Parameters:
- *args: list
The first argument is a name of a function represented as a string. The remaining arguments are optional and represent args of a function. Alternatively, an item may be instantiated from a valid dictionary of item parameters or another object that represent an item of matching type. Then the constructor receives a single argument that contains the dictionary or the item object and no keyword arguments.
- **kwargs: dict
Keyword arguments of a function.
- Raises:
- KeyError, ValueError, TypeError
Missing parameter or invalid parameter types or values
Examples
plan1 = BPlan("count", ["det1", "det2"], num=10, delay=1) inst1 = BInst("queue_stop") func1 = BFunc("custom_func", 10) plan2 = BPlan(plan1.to_dict()) # Copy of 'plan' plan2 = BPlan(plan1) # Works exactly the same # Initialization from items of another type always fails BPlan(func1.to_dict()) # Fails BPlan(inst1) # Fails plan1.from_dict(func1.to_dict()) # Fails plan1.from_dict(inst1) # Fails # BItem can be initialized from specialized item objects item = BItem(inst1.to_dict) # Works item = BItem(inst1) # Works # The following sequence works, because item type is correct item1 = BItem(plan1) # 'item1' is still a plan plan3 = BPlan(item1) # Initialize a plan object with another plan object
- __init__(*args, **kwargs)¶
Methods
__init__
(*args, **kwargs)from_dict
(item_dict)The method copies item parameters from a dictionary.
to_dict
()The method returns the copy of the dictionary with item parameters, which is ready to be passed to the server.
Attributes
args
The read-write property sets or gets the list of item args.
dict_ref
The property returns reference to iternal item dictionary.
item_type
The property for read-write access to the item type.
item_uid
The property for read-write access to the item uid.
kwargs
The read-write property sets or gets the copy of the dictionary of item kwargs.
meta
The read-write property that sets or gets the item metadata.
name
The property for read-write access to the item name.
recognized_item_types
The read-only property returns the list of item types recognized by the queue server.