Giter Club home page Giter Club logo

Comments (5)

mrocklin avatar mrocklin commented on May 12, 2024

Yes, we should probably guard these as we guard nanprod

from dask.

jakirkham avatar jakirkham commented on May 12, 2024

That seems perfectly reasonable. I started doing that, but I think they were being imported dask/array/init.py#3f5e6e69137be3b4ffffc7cc3390d19d6c6b73e5. Is it ok if this is eliminated?

I noticed that you were just using nansum. So, I figured it would be fine to have your functions and skip the wrappings, which I did here ( https://github.com/jakirkham/dask/tree/numpy_1_7_support ).

However, I ran into another surprise, which is nansum does not supply the keepdims argument. So, whatever solution is settled upon should probably have a workaround for keepdims, as well.

from dask.

mrocklin avatar mrocklin commented on May 12, 2024

They should probably be imported in __init__.py if they are available. Not sure on the least ugly way to do this (maybe __all__ in reductions.py?).

Skipping just the wrappings sounds great.

Arg, not supporting keepdims is a pain. At the moment I don't see a clear way around this other than by fundamentally changing how we do reductions. This might require some cleverness but is probably possible. Thoughts?

from dask.

jakirkham avatar jakirkham commented on May 12, 2024

Using __all__ seems reasonable.

Good to hear.

As for the last bit, I think this should be doable. I tried adding a wrapper function called keepdims_wrapper, which appears to work ( jakirkham@89b9395 ). It could be applied at the reduction stage (as done in the commit), which guarantees that all functions used have keepdims of some sort. Alternatively, it could be applied earlier when wrapping all the numpy functions, which would reduce the performance hit of doing the actual wrapping and inspection.

from dask.

jakirkham avatar jakirkham commented on May 12, 2024

Nevermind, it appears following the last case is required.

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.