Closed graingert closed 2 years ago
( if Cluster.__init__ is not called before Cluster.name.__set__ )
Cluster.__init__
Cluster.name.__set__
import sys from distributed.deploy import Cluster class ExampleCluster(Cluster): def __init__(self, name, *args, **kwargs): self.name = f"example-cluster-{name}" super().__init__(*args, **kwargs) def main(): print( Cluster() ) # Cluster(e174b1b2, '<Not Connected>', workers=0, threads=0, memory=0 B) print( ExampleCluster("demo") ) # ExampleCluster(example-cluster-demo, '<Not Connected>', workers=0, threads=0, memory=0 B) print( Cluster() ) # Cluster(example-cluster-demo, '<Not Connected>', workers=0, threads=0, memory=0 B) return 0 if __name__ == "__main__": sys.exit(main())
see also https://github.com/dask/dask-kubernetes/issues/516 see also https://github.com/dask/distributed/pull/5305#discussion_r886822632
@jacobtomlinson
I'm curious, what was the context here? Where did this come up?
( if
Cluster.__init__
is not called beforeCluster.name.__set__
)see also https://github.com/dask/dask-kubernetes/issues/516 see also https://github.com/dask/distributed/pull/5305#discussion_r886822632