qb :: backend :: logParser :: CmdRangeChunkLogParser :: Class CmdRangeChunkLogParser
[hide private]
[frames] | no frames]

Class CmdRangeChunkLogParser

source code


This LogParser class is expected to be used for jobs whose agenda contains frame chunks or partitions. It returns the value of currentFrame/chunkLength as a float between 0 and 1.

Instance Methods [hide private]
float
calcProgress(self, progressMatchStr, qbTokens)
Calculate the internal progress of a frame chunk or partition.
source code

Inherited from LogParser: __init__, parse

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

calcProgress(self, progressMatchStr, qbTokens)

source code 

Calculate the internal progress of a frame chunk or partition.

This particular example expects to have only a frame number in the progressMatchStr, and compare it to the frame range for the individual work item that was passed to the parse() method.

Determine the extent to which the chunk has progressed by determining the index of the current frame (QB_FRAME_NUMBER) in a list comprised of all frames for the chunk, then comparing that index against the size of the chunk.

eg: progressMatchStr = "23", and the frame range for this piece of work (as determined from the qbTokens dict) is 21-30. So the index for this frame would be 3, and 3/10 = 0.3

Parameters:
  • progressMatchStr (str) - the value used to derive the progress within the chunk. It is simply the progress percentage integer matched in the application output.
  • qbTokens (dict) - a dictionary containing all the QB_FRAME* values to aid in calculation the in-chunk progress.
Returns: float
The amount of work complete for the item, expressed as a float between 0 and 1.0, 1.0 being completely done.
Overrides: LogParser.calcProgress