dask / dask/distributed

Show subclass example in Adaptive docs

Open
#4,816 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

It'd be helpful to have a skeleton subclass of `Adaptive` in the documentation that users can copy conveniently. Right now, there are examples for subclassing `Cluster` but not `Adaptive`: [https://docs.dask.org/en/latest/setup/adaptive.html?highlight=adaptiv#distributed.deploy.Adaptive](https://docs.dask.org/en/latest/setup/adaptive.html?highlight=adaptiv#distributed.deploy.Adaptive)

Something like:
```
from distributed import Adaptive

class MyAdaptive(Adaptive):
async def workers_to_close(self, target: int):
"""
Get list of workers to close.
"""

async def recommendations(self, target: int) -> dict:
"""
Make scale up/down recommendations based on current state and target
"""

async def target(self):
"""
Determine target number of workers that should exist.
"""
```

Happy to create a PR for this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.