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

Add 2-arg versions of findmax/min, argmax/min #35316

Merged
merged 29 commits into from
Dec 18, 2020

Commits on Dec 17, 2020

  1. Configuration menu
    Copy the full SHA
    a928f4a View commit details
    Browse the repository at this point in the history
  2. Add isgreater

    Defines a descending total order where unorderable values and missing are last.
    This makes defining min, argmin, etc, simpler.
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    b2f1111 View commit details
    Browse the repository at this point in the history
  3. Add 2-arg versions of findmax/min, argmax/min

    Fixes JuliaLang#27613. Related: JuliaLang#27639, JuliaLang#27612, JuliaLang#34674.
    
    Thanks to @tkf, @StefanKarpinski and @drewrobson for their assistance
    with this PR.
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    8767109 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    72c459d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1eb223b View commit details
    Browse the repository at this point in the history
  6. Clarify isgreater docstring

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    fc0dbab View commit details
    Browse the repository at this point in the history
  7. Update isgreater from review

    - Explicitly cache `x == x` to save the compiler some work.
    - Rename _is_unorderable to !_is_reflexive.
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    9231741 View commit details
    Browse the repository at this point in the history
  8. Simplify _is_reflexive and rename _is_reflexive_eq

    Co-authored-by: Jameson Nash <jameson@juliacomputing.com>
    cmcaine and Jameson Nash committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    4a85179 View commit details
    Browse the repository at this point in the history
  9. unexport isgreater

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    31a38a0 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6cc600e View commit details
    Browse the repository at this point in the history
  11. Fix doctest

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    4c6923a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7c7cfbe View commit details
    Browse the repository at this point in the history
  13. Fix more doctests

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    8356986 View commit details
    Browse the repository at this point in the history
  14. omit unnecessary let

    Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
    cmcaine and tkf committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    8061ce8 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    96433cf View commit details
    Browse the repository at this point in the history
  16. Fix doctests

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    91a825f View commit details
    Browse the repository at this point in the history
  17. typo

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    51c1d07 View commit details
    Browse the repository at this point in the history
  18. Use pairs() in findmax(a)

    It's about as fast as working on indexes for arrays, and should be
    faster for other collections.
    
    Thanks again to @tkf.
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    f3dac8c View commit details
    Browse the repository at this point in the history
  19. Make findmax(A; dims) consistent with findmax(A) again

    findmax(A; dims) and friends can handle `missing` now, too.
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    9ed02b2 View commit details
    Browse the repository at this point in the history
  20. Update docstrings

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    fae5eac View commit details
    Browse the repository at this point in the history
  21. Use convert in reducedim_init

    Thanks @nalimilan for the suggestion. This is simpler, more extensible
    and should handle larger unions.
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    3671795 View commit details
    Browse the repository at this point in the history
  22. Support missing better in minimum(A; dims)

    convert(T, Inf) fails for lots of T (e.g. Int).
    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    202edf7 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    7aa7fdb View commit details
    Browse the repository at this point in the history
  24. Add tests for isunordered

    cmcaine committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    c8f05bb View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    abf1be4 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    925a365 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    5e93247 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    b2fe843 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2020

  1. Fix minimum(A; dims) when eltype(A) doesn't define typemin, but does …

    …accept Inf
    
    This used to work, so it would be a regression to break it.
    cmcaine committed Dec 18, 2020
    Configuration menu
    Copy the full SHA
    6232810 View commit details
    Browse the repository at this point in the history