Module tf.search.stitch

Search result finding

Functions

def setStrategy(searchExe, strategy, keep=False)
Expand source code Browse git
def setStrategy(searchExe, strategy, keep=False):
    error = searchExe.api.TF.error
    _msgCache = searchExe._msgCache
    if strategy is None:
        if keep:
            return
        strategy = STRATEGY[0]
    if strategy not in STRATEGY:
        error(f'Strategy not defined: "{strategy}"', cache=_msgCache)
        error(
            "Allowed strategies:\n{}".format("\n".join(f"    {s}" for s in STRATEGY)),
            tm=False,
            cache=_msgCache,
        )
        searchExe.good = False

    func = globals().get(f"_{strategy}", None)
    if not func:
        error(f'Strategy is defined, but not implemented: "{strategy}"', cache=_msgCache)
        searchExe.good = False
    searchExe.strategy = types.MethodType(func, searchExe)
    searchExe.strategyName = strategy
def stitch(searchExe)
Expand source code Browse git
def stitch(searchExe):
    estimateSpreads(searchExe, both=True)
    _stitchPlan(searchExe)
    if searchExe.good:
        _stitchResults(searchExe)