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

Function optimize

dask/_expr.py:903–925  ·  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

901
902
903def optimize(expr: Expr, fuse: bool = True) -> Expr:
904 """High level query optimization
905
906 This leverages three optimization passes:
907
908 1. Class based simplification using the ``_simplify`` function and methods
909 2. Blockwise fusion
910
911 Parameters
912 ----------
913 expr:
914 Input expression to optimize
915 fuse:
916 whether or not to turn on blockwise fusion
917
918 See Also
919 --------
920 simplify
921 optimize_blockwise_fusion
922 """
923 stage: OptimizerStage = "fused" if fuse else "simplified-physical"
924
925 return optimize_until(expr, stage)
926
927
928def optimize_until(expr: Expr, stage: OptimizerStage) -> Expr:

Callers

nothing calls this directly

Calls 1

optimize_untilFunction · 0.85

Tested by

no test coverage detected