MOAL.data_structures.linear.array package

Submodules

MOAL.data_structures.linear.array.circular_buffer module

class MOAL.data_structures.linear.array.circular_buffer.CircularBuffer(items, **kwargs)[source]

Bases: list

__delitem__(key)
__getitem__(key)
__init__(items, **kwargs)
__setitem__(index, value)
__str__()
append(value)
exception MOAL.data_structures.linear.array.circular_buffer.InvalidBufferLength[source]

Bases: exceptions.Exception

MOAL.data_structures.linear.array.control_table module

class MOAL.data_structures.linear.array.control_table.ControlTableNaive(table1, table2)[source]

A control table is effectively any number of lists/arrays that allow mapping one set of items to another. In this way, their lengths must be the same.

A dictionary would be more appropriate in many cases, except when you want to decouple the input from the output, by using separate data structures to store each column of information.

__init__(table1, table2)
process(key)

MOAL.data_structures.linear.array.gap_buffer module

class MOAL.data_structures.linear.array.gap_buffer.GapBuffer(string, gap_size=8)[source]

Bases: list

__init__(string, gap_size=8)
__str__()
move(count)

MOAL.data_structures.linear.array.hashed_array_tree module

class MOAL.data_structures.linear.array.hashed_array_tree.HashedArrayTree[source]
__init__()
__str__()
add(leaf, items)
add_leaf(leaves)

MOAL.data_structures.linear.array.image_array module

class MOAL.data_structures.linear.array.image_array.ImageArray[source]

Bases: list

Using an array as a means to represent an image - a nested array of RGBA values.

__setitem__(key, pixel_data)
MOAL.data_structures.linear.array.image_array.random() → x in the interval [0, 1).
MOAL.data_structures.linear.array.image_array.random_pixel()[source]

MOAL.data_structures.linear.array.linear_trees module

class MOAL.data_structures.linear.array.linear_trees.NTree(npg)[source]
__init__(npg)
__setitem__(key, value)
__str__()

MOAL.data_structures.linear.array.sparse module

MOAL.data_structures.linear.array.suffix_arrays module

class MOAL.data_structures.linear.array.suffix_arrays.InfixArray(strings=None)[source]

Bases: MOAL.data_structures.linear.array.suffix_arrays.SuffixArray

This is a weird experiment, not totally relevant.

classmethod make_substring(string, bisector=2)[source]

Returns something like [[ca], [t], [do], [g], [bi], [rd]] where the first list is the bisector slice from the left, and the second from the right

class MOAL.data_structures.linear.array.suffix_arrays.PrefixArray(strings=None)[source]

Bases: MOAL.data_structures.linear.array.suffix_arrays.SuffixArray

classmethod make_substring(string)
class MOAL.data_structures.linear.array.suffix_arrays.SuffixArray(strings=None)[source]
__delitem__(string)
__getitem__(string)
__init__(strings=None)
__setitem__(string, val)
__str__()
classmethod make_substring(string)
make_superstring(strings=None)
class MOAL.data_structures.linear.array.suffix_arrays.SuperSuffixArray(strings=None)[source]

Bases: MOAL.data_structures.linear.array.suffix_arrays.SuffixArray

__repr__()
_view(suffixes)
sort()