labscript.utils.set_passed_properties

set_passed_properties(property_names=None)[source]

Decorator for device __init__ methods that saves the listed arguments/keyword arguments as properties.

Argument values as passed to __init__ will be saved, with the exception that if an instance attribute exists after __init__ has run that has the same name as an argument, the instance attribute will be saved instead of the argument value. This allows code within __init__ to process default arguments before they are saved.

Internally, all properties are accessed by calling self.get_property().

Parameters:

property_names (dict) – A dictionary {key:val}, where each val is a list [var1, var2, …] of instance attribute names and/or method call arguments (of the decorated method). Values of the instance attributes/method call arguments will be saved to the location specified by key.