data_loader

Functions

class_to_instance_name(class_name, typ[, avr_type, ...])

create_device_instance(class_name, instance_name, typ)

Ensures an instance with a specific name exists in globals().

read(file, typ)

Read the contents from .txt files

Module Contents

data_loader.class_to_instance_name(class_name, typ, avr_type=None, governor_type=None, pss_type=None, shaft_type=None, filter_type=None, angle_type=None, voltage_type=None, inner_type=None, pll_type=None)
data_loader.create_device_instance(class_name, instance_name, typ, avr_type=None, governor_type=None, pss_type=None, shaft_type=None, filter_type=None, angle_type=None, voltage_type=None, inner_type=None, pll_type=None)

Ensures an instance with a specific name exists in globals(). If not, searches through all scripts in the specified subpackage to find and load the class.

Parameters:
  • class_name – Name of the class as a string.

  • instance_name – Desired instance name in snake_case.

  • typ – Desired type ‘sim’ or ‘est’.

  • avr_type – Optional AVR type string for synchronous machines.

Returns:

The instance, or raises an ImportError if not found.

data_loader.read(file, typ: str)

Read the contents from .txt files

Parameters:

typ (str)