secop_ophyd.GenNodeCode#

Module Contents#

Classes#

Method

GenNodeCode

Generates A Python Class for a given SECoP_Node_Device instance. This allows autocompletiion and type hinting in IDEs, this is needed since the attributes of the generated Ophyd devices are only known at runtime.

API#

class secop_ophyd.GenNodeCode.Method(cmd_name: str, description: str, cmd_sign: inspect.Signature)[source]#

Initialization

class secop_ophyd.GenNodeCode.GenNodeCode(path: str | None = None, log=None)[source]#

Generates A Python Class for a given SECoP_Node_Device instance. This allows autocompletiion and type hinting in IDEs, this is needed since the attributes of the generated Ophyd devices are only known at runtime.

Initialization

Instantiates GenNodeCode, internally all atrribues on a node and module level are collected. Additionally all the needed imports are collected in a dict

ModName: str = 'genNodeClass'#
node_mod = None#
module_folder_path: pathlib.Path | None = None#
add_import(module: str, class_str: str)[source]#

adds an Import to the import dict

Parameters:
  • module (str) – Python Module of the dict

  • class_str (str) – Class that is to be imported

add_mod_class(module_cls: str, bases: list[str], attrs: list[tuple[str, str]], cmd_plans: list[secop_ophyd.GenNodeCode.Method])[source]#

adds module class to the module dict

Parameters:
  • module_cls (str) – name of the new Module class

  • bases (list[str]) – bases the new class is derived from

  • attrs (tuple[str, str]) – list of attributes of the class

add_node_class(node_cls: str, bases: list[str], attrs: list[tuple[str, str]])[source]#
write_gen_node_class_file()[source]#