Show subclass example in Adaptive docs

Open Beginner friendly
#4,816 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Start with the linked Adaptive documentation page and compare its presentation with the existing Cluster subclass examples. Add a copyable skeleton subclass showing the requested methods, and consider the work done when users can find a clear Adaptive subclass example alongside the other subclassing guidance.

Written by the indexing model from the issue text.

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

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.

Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dask/distributed

All issues in dask/distributed

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.