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

Method substitute_parameters

dask/_expr.py:665–687  ·  view source on GitHub ↗

Substitute specific `Expr` parameters Parameters ---------- substitutions: Mapping of parameter keys to new values. Keys that are not found in ``self._parameters`` will be ignored.

(self, substitutions: dict)

Source from the content-addressed store, hash-verified

663 return self
664
665 def substitute_parameters(self, substitutions: dict) -> Expr:
666 """Substitute specific `Expr` parameters
667
668 Parameters
669 ----------
670 substitutions:
671 Mapping of parameter keys to new values. Keys that
672 are not found in ``self._parameters`` will be ignored.
673 """
674 if not substitutions:
675 return self
676
677 changed = False
678 new_operands = []
679 for i, operand in enumerate(self.operands):
680 if i < len(self._parameters) and self._parameters[i] in substitutions:
681 new_operands.append(substitutions[self._parameters[i]])
682 changed = True
683 else:
684 new_operands.append(operand)
685 if changed:
686 return type(self)(*new_operands)
687 return self
688
689 def _node_label_args(self):
690 """Operands to include in the node label by `visualize`"""

Callers 7

_tune_downMethod · 0.80
_tune_downMethod · 0.80
_simplify_upMethod · 0.80
_simplify_downMethod · 0.80
_simplify_upMethod · 0.80
_simplify_upMethod · 0.80

Calls

no outgoing calls

Tested by 1