MCPcopy Create free account
hub / github.com/dask/dask / optimize

Function optimize

dask/_expr.py:913–935  ·  view source on GitHub ↗

High level query optimization This leverages three optimization passes: 1. Class based simplification using the ``_simplify`` function and methods 2. Blockwise fusion Parameters ---------- expr: Input expression to optimize fuse: whether or not to tur

(expr: Expr, fuse: bool = True)

Source from the content-addressed store, hash-verified

911
912
913def optimize(expr: Expr, fuse: bool = True) -> Expr:
914 """High level query optimization
915
916 This leverages three optimization passes:
917
918 1. Class based simplification using the ``_simplify`` function and methods
919 2. Blockwise fusion
920
921 Parameters
922 ----------
923 expr:
924 Input expression to optimize
925 fuse:
926 whether or not to turn on blockwise fusion
927
928 See Also
929 --------
930 simplify
931 optimize_blockwise_fusion
932 """
933 stage: OptimizerStage = "fused" if fuse else "simplified-physical"
934
935 return optimize_until(expr, stage)
936
937
938def optimize_until(expr: Expr, stage: OptimizerStage) -> Expr:

Callers

nothing calls this directly

Calls 1

optimize_untilFunction · 0.85

Tested by

no test coverage detected