IntentController Class

class ds_discovery.intent.controller_intent.ControllerIntentModel(property_manager: ~ds_discovery.managers.controller_property_manager.ControllerPropertyManager, default_save_intent: bool = None, default_intent_level: [<class 'str'>, <class 'int'>, <class 'float'>] = None, order_next_available: bool = None, default_replace_intent: bool = None)

This component provides a set of actions that focuses on the Controller. The Controller is a unique component that independently orchestrates the components registered to it. It executes the components Domain Contract and not its code. The Controller orchestrates how those components should run with the components being independent in their actions and therefore a separation of concerns.

models_builder(canonical: ~typing.Any, task_name: str, columns: [<class 'str'>, <class 'list'>] = None, run_book: list = None, seed: int = None, uri_pm_repo: str = None, run_task: bool = None, models_intent: [<class 'int'>, <class 'str'>, <class 'list'>] = None, persist_result: bool = None, save_intent: bool = None, intent_order: int = None, intent_level: [<class 'int'>, <class 'str'>] = None, replace_intent: bool = None, remove_duplicates: bool = None)

register a ModelsBuilder component task pipeline

Parameters:
  • canonical – the canonical to run through the component pipeline

  • task_name – the task_name reference for this component

  • columns – (optional) a single or list of intent_level to run, if list, run in order given

  • run_book – (optional) a runbook to execute. If None and there is a default runbook this will be used

  • seed – (optional) a seed for the run

  • uri_pm_repo – (optional) A repository URI to initially load the property manager but not save to.

  • run_task – (optional) if when adding the task it should also be run returning the canonical outcome

  • models_intent – (optional) an single or list of models levels to run, if list, run in order given

  • persist_result – (optional) if the resulting canonical should be persisted.

  • save_intent – (optional) if the intent contract should be saved to the property manager

  • intent_level – (optional) the level name that groups intent by a reference name

  • intent_order – (optional) the order in which each intent should run. If None: default’s to -1 if -1: added to a level above any current instance of the intent section, level 0 if not found if int: added to the level specified, overwriting any that already exist

  • replace_intent – (optional) if the intent method exists at the level, or default level True - replaces the current intent method with the new False - leaves it untouched, disregarding the new intent

  • remove_duplicates – (optional) removes any duplicate intent in any level that is identical

run_intent_pipeline(canonical: ~typing.Any, intent_level: [<class 'int'>, <class 'str'>] = None, controller_repo: str = None, persist_result: bool = None, **kwargs)

Collectively runs all parameterised intent taken from the property manager against the code base as defined by the intent_contract.

It is expected that all intent methods have the ‘canonical’ as the first parameter of the method signature and will contain ‘save_intent’ as parameters.

Parameters:
  • canonical – A pandas dataframe or int if passing to the SyntheticBuilder

  • intent_level – (optional) The intent_level to run. if none then assume pm constant DEFAULT_INTENT_LEVEL

  • controller_repo – (optional) the controller repo to use if no uri_pm_repo is within the intent parameters

  • persist_result – (optional) if the intent results should be persisted as well as returned in memory

  • kwargs – additional kwargs to add to the parameterised intent, these will replace any that already exist

Returns:

Canonical with parameterised intent applied

synthetic_builder(canonical: ~typing.Any, task_name: str, columns: [<class 'str'>, <class 'int'>, <class 'list'>] = None, run_book: list = None, seed: int = None, uri_pm_repo: str = None, run_task: bool = None, persist_result: bool = None, size: int = None, save_intent: bool = None, intent_order: int = None, intent_level: [<class 'int'>, <class 'str'>] = None, replace_intent: bool = None, remove_duplicates: bool = None)

register a synthetic component task pipeline

Parameters:
  • canonical – this can be a size integer or a starting canonical size is based upon

  • task_name – the task_name reference for this component

  • columns – (optional) a single or list of intent_level to run, if list, run in order given

  • run_book – (optional) a runbook to execute. If None and there is a default runbook this will be used

  • seed – (optional) a seed for the run

  • uri_pm_repo – (optional) A repository URI to initially load the property manager but not save to.

  • run_task – (optional) if when adding the task it should also be run returning the canonical outcome

  • persist_result – (optional) if the resulting canonical should be persisted.

  • size – (optional) legacy size parameter now replaced by passing an int as the canonical

  • save_intent – (optional) if the intent contract should be saved to the property manager

  • intent_level – (optional) the level name that groups intent by a reference name

  • intent_order – (optional) the order in which each intent should run. If None: default’s to -1 if -1: added to a level above any current instance of the intent section, level 0 if not found if int: added to the level specified, overwriting any that already exist

  • replace_intent – (optional) if the intent method exists at the level, or default level True - replaces the current intent method with the new False - leaves it untouched, disregarding the new intent

  • remove_duplicates – (optional) removes any duplicate intent in any level that is identical

transition(canonical: ~typing.Any, task_name: str, columns: [<class 'str'>, <class 'list'>] = None, run_book: list = None, uri_pm_repo: str = None, run_task: bool = None, transition_intent: [<class 'int'>, <class 'str'>, <class 'list'>] = None, persist_result: bool = None, save_intent: bool = None, intent_order: int = None, intent_level: [<class 'int'>, <class 'str'>] = None, replace_intent: bool = None, remove_duplicates: bool = None)

register a Transition component task pipeline

Parameters:
  • canonical – the canonical to run through the component pipeline

  • task_name – the task_name reference for this component

  • columns – (optional) a single or list of intent_level to run, if list, run in order given

  • run_book – (optional) a runbook to execute. If None and there is a default runbook this will be used

  • uri_pm_repo – (optional) A repository URI to initially load the property manager but not save to.

  • run_task – (optional) if when adding the task it should also be run returning the canonical outcome

  • transition_intent – (optional) a single or list of components levels to run, if list, run in order given

  • persist_result – (optional) if the resulting canonical should be persisted.

  • save_intent – (optional) if the intent contract should be saved to the property manager

  • intent_level – (optional) the level name that groups intent by a reference name

  • intent_order – (optional) the order in which each intent should run. If None: default’s to -1 if -1: added to a level above any current instance of the intent section, level 0 if not found if int: added to the level specified, overwriting any that already exist

  • replace_intent – (optional) if the intent method exists at the level, or default level True - replaces the current intent method with the new False - leaves it untouched, disregarding the new intent

  • remove_duplicates – (optional) removes any duplicate intent in any level that is identical

wrangle(canonical: ~typing.Any, task_name: str, columns: [<class 'str'>, <class 'list'>] = None, run_book: list = None, seed: int = None, uri_pm_repo: str = None, run_task: bool = None, wrangled_intent: [<class 'int'>, <class 'str'>, <class 'list'>] = None, persist_result: bool = None, save_intent: bool = None, intent_order: int = None, intent_level: [<class 'int'>, <class 'str'>] = None, replace_intent: bool = None, remove_duplicates: bool = None)

register a Transition component task pipeline

Parameters:
  • canonical – the canonical to run through the component pipeline

  • task_name – the task_name reference for this component

  • columns – (optional) a single or list of intent_level to run, if list, run in order given

  • run_book – (optional) a runbook to execute. If None and there is a default runbook this will be used

  • seed – (optional) a seed for the run

  • uri_pm_repo – (optional) A repository URI to initially load the property manager but not save to.

  • run_task – (optional) if when adding the task it should also be run returning the canonical outcome

  • wrangled_intent – (optional) an single or list of wrangled levels to run, if list, run in order given

  • persist_result – (optional) if the resulting canonical should be persisted.

  • save_intent – (optional) if the intent contract should be saved to the property manager

  • intent_level – (optional) the level name that groups intent by a reference name

  • intent_order – (optional) the order in which each intent should run. If None: default’s to -1 if -1: added to a level above any current instance of the intent section, level 0 if not found if int: added to the level specified, overwriting any that already exist

  • replace_intent – (optional) if the intent method exists at the level, or default level True - replaces the current intent method with the new False - leaves it untouched, disregarding the new intent

  • remove_duplicates – (optional) removes any duplicate intent in any level that is identical