ogd.core.registries package

Submodules

ogd.core.registries.DetectorRegistry module

class ogd.core.registries.DetectorRegistry.DetectorRegistry(mode: ExtractionMode, trigger_callback: Callable[[Event], None])[source]

Bases: GeneratorRegistry

Class for registering features to listen for events.

Returns:

[description]

Return type:

[type]

to_string(num_lines: int | None = None) str[source]

Alternate string conversion for Extractors, with limitable number of lines.

Creates a list of features in the extractor, separated by newlines. Optional num_lines param allows the function caller to limit number of lines in the string. :param num_lines: Max number of lines to include in the string. If None, then include all strings, defaults to None :type num_lines: Optional[int], optional :return: A string with line-separated stringified features. :rtype: str

ogd.core.registries.ExtractorRegistry module

class ogd.core.registries.ExtractorRegistry.ExtractorRegistry(mode: ExtractionMode, order: int = 2)[source]

Bases: GeneratorRegistry

Class for registering features to listen for events.

Returns:

[description]

Return type:

[type]

class FeatureOrders(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

FIRST_ORDER = 0[source]
SECOND_ORDER = 1[source]
property FirstOrdersRequested: List[str][source]
GetFeatureData(order: int, player_id: str | None = None, sess_id: str | None = None) List[FeatureData][source]
GetFeatureStringValues() List[str][source]
GetFeatureValues() List[Any][source]
OrderCount() int[source]

Gets the number of “orders” of features stored in the ExtractorRegistry. For now, there’s just two of them.

Returns:

_description_

Return type:

int

to_string(num_lines: int | None = None) str[source]

Alternate string conversion for Extractors, with limitable number of lines.

Creates a list of features in the extractor, separated by newlines. Optional num_lines param allows the function caller to limit number of lines in the string. :param num_lines: Max number of lines to include in the string. If None, then include all strings, defaults to None :type num_lines: Optional[int], optional :return: A string with line-separated stringified features. :rtype: str

ogd.core.registries.GeneratorRegistry module

class ogd.core.registries.GeneratorRegistry.GeneratorRegistry(mode: ExtractionMode)[source]

Bases: ABC

Class for registering features to listen for events.

Returns:

[description]

Return type:

[type]

GetGeneratorNames() List[str][source]

Function to generate a list names of all enabled features, given a GameSchema This is different from the FeatureNames property of GameSchema, which ignores the ‘enabled’ attribute and does not expand per-count features (e.g. this function would include ‘lvl0_someFeat’, ‘lvl1_someFeat’, ‘lvl2_someFeat’, etc. while FeatureNames only would include ‘someFeat’).

Parameters:

schema (GameSchema) – The schema from which feature names should be generated.

Returns:

A list of feature names.

Return type:

List[str]

class Listener(name: str, mode: IterationMode)[source]

Bases: object

LoadFromSchema(schema: GameSchema, loader: GeneratorLoader, overrides: List[str] | None)[source]
Register(extractor: Generator, iter_mode: IterationMode)[source]
UpdateFromEvent(event: Event) None[source]

Perform extraction of features from a row.

Parameters:
  • event (Event) – [description]

  • table_schema (TableSchema) – A data structure containing information on how the db table assiciated with this game is structured.

UpdateFromFeatureData(feature: FeatureData) None[source]

Perform extraction of features from a row.

Parameters:
  • event (Event) – [description]

  • table_schema (TableSchema) – A data structure containing information on how the db table assiciated with this game is structured.

Module contents