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

fix a[..] .= something #27

Merged
merged 4 commits into from
Feb 8, 2021
Merged

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Feb 8, 2021

I noticed that ab assignment of the form a[..] .= something did not work. Hence, I deleted the offending getindex overload in EllipsisNotation. The comment there referred to a still open issue that does not seem to be active right now.

If these changes are okay, it would be nice to have a new release.

# avoid copying if indexing with .. alone, see
# https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/issues/214
@inline Base.getindex(A::AbstractArray, ::Ellipsis) = A
@inline ArrayInterface.getindex(A, ::Ellipsis) = A
Copy link
Member

Choose a reason for hiding this comment

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

is the timing okay without this?

Copy link
Member Author

Choose a reason for hiding this comment

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

The issue mentioned there is still open. We discussed streamlining the interpolation codes using .., but didn't implement it (as far as I remember). The only difference will be when calling A[..]. If it's on the left-hand side, it can subtly break (as fixed in this PR). If it's on the right-hand side, it's an indexing operation anyways and should be consistent in creating a copy of the data. So I think this should be fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you have some specific tests in mind?

Copy link
Member

Choose a reason for hiding this comment

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

What does it do without these dispatches? Does it make a copy?

Copy link
Member Author

@ranocha ranocha Feb 8, 2021

Choose a reason for hiding this comment

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

Yes, without these definitions A[..] behaves as A[:].

@ChrisRackauckas ChrisRackauckas merged commit 1cc8388 into SciML:master Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants