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

Deprecate squeeze(A, dims) to use keyword arguments #26660

Merged
merged 2 commits into from
Apr 3, 2018
Merged

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Mar 29, 2018

This is a follow-up to issue #25501 and seems to make sense in that same vein. This also adds NEWS for squeeze and all the other related functions (#25501 was missing NEWS).

This is a follow-up to issue #25501 and seems to make sense in that same vein.  This also adds NEWS for squeeze and all the other related functions (#25501 was missing NEWS).
@mbauman mbauman added arrays [a, r, r, a, y, s] deprecation This change introduces or involves a deprecation labels Mar 29, 2018
2×2×1 Array{Int64,3}:
[:, :, 1] =
1 3
2 4
```
"""
function squeeze(A::AbstractArray, dims::Dims)
squeeze(A; dims=throw(ArgumentError("the dimensions to squeeze must be specified with a `dims` keyword argument"))) = _squeeze(A, dims)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to get by with a required keyword argument here:

squeeze(A; dims) = _squeeze(A, dims)

That will throw an UndefKeywordError when dims is not provided.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right, I forgot we do this automatically now. Thanks!

@ararslan
Copy link
Member

64-bit Windows failure is a timeout.

@staticfloat
Copy link
Member

Wow, apparently kwarg codegen has significantly improved since 0.6. Nice!

@mbauman mbauman merged commit 266d82a into master Apr 3, 2018
@mbauman mbauman deleted the mb/squeezekwdim branch April 3, 2018 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] deprecation This change introduces or involves a deprecation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants