Skip to content

Deprecate cumsum, cumprod, cumsum_kbn, and accumulate when dim isn't specified#24684

Merged
andreasnoack merged 5 commits intomasterfrom
anj/accumulate
Nov 24, 2017
Merged

Deprecate cumsum, cumprod, cumsum_kbn, and accumulate when dim isn't specified#24684
andreasnoack merged 5 commits intomasterfrom
anj/accumulate

Conversation

@andreasnoack
Copy link
Copy Markdown
Member

...and dimension is larger than one

Fixes #19451

@ararslan ararslan added deprecation This change introduces or involves a deprecation maths Mathematical functions labels Nov 21, 2017
@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Nov 21, 2017

Rebase?

Comment thread base/multidimensional.jl Outdated

"""
cumsum(A, dim=1)
cumsum(A, dim)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AFAICT there should be a separate docstring for AbstractVector, right? Also, ::Integer would be useful since there's no longer any indication of the expected type in the signature.

@andreasnoack andreasnoack force-pushed the anj/accumulate branch 2 times, most recently from e8d02ea to 5ff1bad Compare November 22, 2017 14:13
Comment thread base/multidimensional.jl Outdated

"""
cumsum(A, dim)
cumsum(A, axis::Integer)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather keep dim or use region, which are the two terms that appear to be common in similar functions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is what the method uses. They used to be out of sync. However, since we have reducedim, it is probably better to use dim here as well. I'll update.

Comment thread base/multidimensional.jl Outdated
accumulate!(op, B, A, dim::Integer)

Cumulative operation `op` on `A` along the axis `axis`, storing the result in `B`.
Cumulative operation `op` on `A` along the dimensions `dim`, storing the result in `B`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Singular "dimension".

Copy link
Copy Markdown
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

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

LGTM apart from the singular/plural issue with "dimensions" in several places.

@andreasnoack
Copy link
Copy Markdown
Member Author

singular/plural issue with "dimensions" in several places.

Should be fixed now.

Fix bug in accumulate when initial value is provided since the implementation
doesn't support multidimentional arrays.

Move the accumulate methods with initial values to the end
@andreasnoack andreasnoack merged commit 999a4ff into master Nov 24, 2017
@andreasnoack andreasnoack deleted the anj/accumulate branch November 24, 2017 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecation This change introduces or involves a deprecation maths Mathematical functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants