Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mask selection in compress #4548

Merged
merged 7 commits into from Mar 6, 2019
Merged

Commits on Mar 5, 2019

  1. Trim Dask Array that extends past condition

    If the `condition` is shorter than the Dask Array, treat it as if it is
    filled with `False` values at the end. In other words, trim the Dask
    Array down to the length of the `condition`. This works just as well
    when the `condition` is a Dask Array as when it is a NumPy array.
    jakirkham committed Mar 5, 2019
    Copy the full SHA
    b1c67e6 View commit details
    Browse the repository at this point in the history
  2. Use masked selection to implement compress

    As masked selection is supported by Dask Arrays, NumPy arrays, and other
    array types, go ahead and change the `compress` code to use masked
    selection in all cases. Should make it easier for other array types to
    benefit from this code. Simplifies our code and removes a branch as
    well.
    jakirkham committed Mar 5, 2019
    Copy the full SHA
    f9ddf70 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    81811df View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    73d6c82 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2019

  1. Copy the full SHA
    1e9f445 View commit details
    Browse the repository at this point in the history
  2. Drop condition length check

    If the length of `condition` is shorter, the array will be shortened
    with or without this check. Otherwise if the length of `condition` is
    the same, then this will be a no-op (and we already test for this). In
    the rare event `condition` is longer than our array, this will do
    nothing, but we will generate an error later.
    jakirkham committed Mar 6, 2019
    Copy the full SHA
    8efe964 View commit details
    Browse the repository at this point in the history
  3. Simplify slicing with condition

    Uses the same comprehension trick for truncating the Dask Array above
    when slicing with the mask.
    jakirkham committed Mar 6, 2019
    Copy the full SHA
    97ab94f View commit details
    Browse the repository at this point in the history