dask 2021.10.0

Parameters
globalmethod(default=None, key=None, falsey=None)

This modifies a method so that occurrences of it may be taken over by functions registered in the global options. Can be used as a decorator or a function.

Parameters

default : callable

The default callable to use.

key : str

Key under which we register this function in the global parameters

falsey : callable, None, optional

A function to use if the option is falsey. If not provided, the default is used instead.

Allow function to be taken over by globals

Examples

This example is valid syntax, but we were not able to check execution
>>> import dask
... class Foo:
...  @globalmethod(key='bar', falsey=lambda: 3)
...  def bar():
...  return 1
... f = Foo()
... f.bar() 1
This example is valid syntax, but we were not able to check execution
>>> with dask.config.set(bar=lambda: 2):
...  print(f.bar()) 2
This example is valid syntax, but we were not able to check execution
>>> with dask.config.set(bar=False):
...  print(f.bar()) 3
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/context.py#15
type: <class 'function'>
Commit: