agatha.ml.abstract_generator.misc_util module

class agatha.ml.abstract_generator.misc_util.HashedIndex(max_index)

Bases: object

This class acts as a dict that maps items to a fixed range of values. Items must be convertible to strings. Value -> Idx idx -> Set of values

add(elem)
Return type

None

get_elements(idx)
Return type

Set[Any]

get_index(elem)
Return type

int

has_element(elem)
Return type

bool

has_index(idx)
Return type

bool

class agatha.ml.abstract_generator.misc_util.OrderedIndex

Bases: object

Same exact interface as hashed index, without the hashing

add(elem)
Return type

None

get_elements(idx)
Return type

Set[Any]

get_index(elem)
Return type

int

has_element(elem)
Return type

bool

has_index(idx)
Return type

bool

agatha.ml.abstract_generator.misc_util.items_to_hashed_index(collection, max_index)
Return type

HashedIndex

agatha.ml.abstract_generator.misc_util.items_to_ordered_index(collection)
Return type

OrderedIndex