Jishnu Bhattacharya

Results 225 comments of Jishnu Bhattacharya

Seems related to https://github.com/JuliaArrays/OffsetArrays.jl/blob/a094f04a6e75da1e67c6060fa2f4498d9a29c320/src/OffsetArrays.jl#L283-L287

Many of the `reshape` methods are defined in [reshapedarray.jl](https://github.com/JuliaLang/julia/blob/master/base/reshapedarray.jl), where curiously `Int32` arguments are permitted if all the sizes are specified, but disallowed if one of them is specified implicitly...

I think such type-piracy, where an error becomes a valid operation, isn't considered too serious. After all, `Base` cannot return the correct result here, since in general, this will have...

Since this changes the axes of the reshaped array, this should perhaps be treated as a breaking change?

This works currently on master: ```julia julia> A = zeros(1:2, 3:4) 2×2 OffsetArray(::Matrix{Float64}, 1:2, 3:4) with eltype Float64 with indices 1:2×3:4: 0.0 0.0 0.0 0.0 julia> reshape(A, 2:3, :) 2×2...

Perhaps some of the other methods need to be altered too to get this to be consistent: ```julia julia> reshape(OffsetArray(3:4, 2), :) # preserves offset 3:4 with indices 3:4 julia>...

The [devdocs](https://docs.julialang.org/en/v1/devdocs/offset-arrays/) advise against exporting such ranges to avoid conflicts with other packages that may define their own types (although I wonder if you wrote that yourself?). Perhaps it'll be...

That's an interesting idea, and I can see something like this being useful. ```julia julia> zerobasedinds = offset((-1,-1)); julia> A = zerobasedinds(zeros(3,3)); julia> A = zeros(3,3); B = zerobasedinds(A); julia>...

On a related note, something like this seems like a useful pattern to temporarily change the axes of an array: ```julia julia> struct WithOrigin{T WithOrigin(t::Union{Integer, Tuple{Integer, Vararg{Integer}}}) = WithOrigin(OffsetArrays.Origin(t)) WithOrigin...

Could you add this to `Base`? That'll be great! I'm a bit caught up at the moment.