Skip to content

da.repeat with repeats as list NotImplemented #2946

Open

Description

@jamesstidard

Hi,

I was looking to use da.repeat as in the documentation np.repeat(x, [1, 2], axis=0), though I get a NotImplementedError.

I looked in the Checklist which has repeat as checked - not sure if this takes into account the problem above.

Any suggestions of a neat was of reproducing this function in dask currently?

Thanks

Activity

  1. jakirkham commented on Dec 1, 2017

    @jakirkham
    Member

    Thanks for the report.

    We often borrow NumPy's documentation for these functions. This is certainly one of the downsides of doing that.

    So that checklist is basically something I threw together last night. Wouldn't give it too much credence yet. It definitely does not take into account full functionality being supported. Just whether the function is there and works on some basic inputs. If you have some suggestions on how the checklist could be clarified for issues like this, would be open to hearing them.

    Hmm... A naive solution would be to slice out sections of the array and repeat them independently. Though that could result in a lot of overhead for large arrays. A better solution would probably be to wrap up this call to repeat with apply_along_axis. However we would need to make some tweaks to apply_along_axis for this to work. Also this assumes that a 1-D array with length equal to the dimension being repeated in question can comfortably fit in memory.

  2. jamesstidard commented on Dec 1, 2017

    @jamesstidard
    Author

    Hi @jakirkham Thanks for the quick response.

    The check list is not a problem - just ran across it when I searched repeat in the open tickets list to make sure a ticket similar to this was already open. It's a shame that markdown does't half the half checked status [-] that might have been a nice way to indicate some missing functionality well keeping the list concise as it is now.

    We've actually found a way round this for now that just removes some accuracy in favour of getting it to fit into memory. So it's not as hard requirement for us at the moment as I thought it was going to be on opening the ticket - so don't feel any obligation to go out your way to prioritise this over anything else you are working on.

    Thanks for your work on dask.

  3. jakirkham commented on Dec 1, 2017

    @jakirkham
    Member

    Sure that is a good idea. Would like to move that list to the docs where half checks might be an option. Plus it would avoid some issues I've learned about large checks lists in GitHub issues. :)

    I see. Well I expect the fix to apply_along_axis will be a one liner TBH. So definitely doable. Can point you to the line if you would like to do a simple PR. ;) Sounds like the data regime you are working in would be sufficiently satisfied with using apply_along_axis for many things (including this case).

  4. jakirkham commented on Feb 22, 2018

    @jakirkham
    Member

    @Erstwild, after our discussion in issue ( #3175 ), cc-ing you here as this appears relevant to your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions