Exploring the remaining files
Apart from the isax.py
file, the isax
Python package is constructed of more source code files, mainly because it is based on the sax
package. We will begin with the tools.py
file.
The tools.py file
There are some additions to the tools.py
source code file compared to the version we first saw in Chapter 2, which mainly have to do with the promotion strategy. As said before, we support two promotion strategies: Round Robin and from left to right.
The Round Robin strategy is implemented here:
def round_robin_promotion(nSegs): # Check if there is a promotion overflow n = power_of_two(variables.maximumCardinality) t = 0 while len(nSegs[variables.promote]) == n: # Go to the next SAX word and promote it Variables.promote = (variables.promote + 1) % ...