creators

creators assists with initializing all modules.

Class

ConfigHandler

class gedml.launcher.creators.config_handler.ConfigHandler(convert_dict={}, link_path=None, assert_path=None, params_path=None, wrapper_path=None, is_confirm_first=True)[source]

Bases: object

This class takes charge of reading yaml files, combining config parameters, modifying local parameters and initializing modules.

ConfigHandler will call CreatorManager to use corresponding sub-creator to do the initialization respectly.

Parameters
  • link_path (str) – Path where the link.yaml is stored.

  • params_path (str) – Path where the params configs are stored.

  • assert_path (str) – Path where the assert.yaml is stored. (To be done!)

  • is_confirm_first (bool) – Whether to confirm before starting initialization. default: True.

Example

>>> config_handler = ConfigHandler()
>>> config_handler.get_params_dict()
>>> objects_dict = config_handler.create_all()
create_all(change_dict={})[source]

Initialize all modules according to params dictionary.

Parameters

change_dict (dict) – Dictionary that overwrites certain parameters. (optional)

Returns

initialized objects dictionary.

Return type

dict

get_params_dict(link_config=None, modify_link_dict=None)[source]

Read and combine config parameters.

Parameters
  • link_config (dict) – Link dictionary.

  • modify_link_dict (dict) – Modify link config. (Default = None)

Returns

params’ dictionary.

Return type

dict

register_packages(module_name, extra_package)[source]

Register new packages into the specific module-creator.

Parameters
  • module_name (str) – The specific module-creator.

  • extra_package (list or module) – Extra packages to be added.