Giter Club home page Giter Club logo

Comments (4)

sam-goodwin avatar sam-goodwin commented on May 24, 2024 1

Hi @benrutter, I agree that we don't need to take on the whole repo and there is plenty of low hanging fruit. The errors I am running into are:

  • da.from_array - chunks is inferred as a str
  • array.rechunk - chunks is inferred as a str
  • dd.from_delayed returns DataFrame | Series and will always require a cast. Not sure how to fix that other than adding helpers.
  • map_blocks seems to not behave properly as a method in the eyes of pyright:
da.from_zarr(core.core_img).map_blocks(
    segment_tissue,
    dtype=np.uint8,
    drop_axis=0,
    downsample_factor=tissue_masks_params.downsample_factor,
)

Error:

Argument missing for parameter "func"

If you add explicit func=segment_tissue, then get an error about self:

Argument missing for parameter "self"

Perhaps something wacky with @wraps:

    @wraps(map_blocks)
    def map_blocks(self, func, *args, **kwargs):
        return map_blocks(func, self, *args, **kwargs)

map_blocks is of the following type. Looks like it is no longer recognized as a method or something.

map_blocks: _Wrapped[(func: Unknown, *args: Unknown, name: Unknown | None = None, token: Unknown | None = None, dtype: Unknown | None = None, chunks: Unknown | None = None, drop_axis: Unknown | None = None, new_axis: Unknown | None = None, enforce_ndim: bool = False, meta: Unknown | None = None, **kwargs: Unknown), Unknown, (self: Array, func: Unknown, *args: Unknown, **kwargs: Unknown), Unknown] | Any

from dask.

phofl avatar phofl commented on May 24, 2024

We are aware of the issue but there is currently no plan on addressing this from within the currently active contributors. We currently have other (higher) priorities to focus our effort on. Contributions are welcome though if you are interested in helping out.

from dask.

fjetter avatar fjetter commented on May 24, 2024

We've been adding type annotations continuously over the past 1-2 years but the code base is very large and ensuring that everything is typed is very difficult. This is rather an incremental process. As was already mentioned, contributions are welcome and I guess this is a comparatively easy topic for a first couple of contributions.

We're using mypy for type checking and the modules that are already fully typed are listed here (not many yet)

dask/pyproject.toml

Lines 180 to 184 in b2ec1e1

# Recent or recently overhauled modules featuring stricter validation
module = [
"dask.order",
]
allow_untyped_defs = false

FWIW we're already much further along for dask/distributed https://github.com/dask/distributed/blob/66ced13b33aeafe0d684b4424364c69f0b5a0d43/pyproject.toml#L201-L212

from dask.

benrutter avatar benrutter commented on May 24, 2024

@sam-goodwin (or anyone else having issues with type hinting) - are there any specific functions causing problems for you aside from array.rechunk? I'd be up for spending a little time working through some type annotations at some point - this issues currently labelled 'Add static type annotations' implying for the whole project, which is a great goal, but would be awesome to have a couple priority areas to target.

from dask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.