JuliaStats / TimeSeries.jl

Time series toolkit for Julia
Other
353 stars 69 forks source link

timearray: implement `timearray[]` #335

Closed iblislin closed 7 years ago

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.03%) to 85.885% when pulling e12a26e84294df13c4b9746e15ade515c460bce2 on iblis17:getindex-first into ac8b6cb51bee0bcf84f76c76ffe315e184b98290 on JuliaStats:master.

ararslan commented 7 years ago

I'm kind of confused by this. I don't think any other array type behaves this way, does it?

iblislin commented 7 years ago

hmm, what i expect is ta[] returns the first item of ta, like Array in Base.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 85.851% when pulling 6d7f39bd4898980522b4cb315cbc36ea6cb38a9d on iblis17:getindex-first into ac8b6cb51bee0bcf84f76c76ffe315e184b98290 on JuliaStats:master.

ararslan commented 7 years ago

My understanding is that it's actually more of an accident than a feature. In fact, if you trace the calls that are being made in A[] (for A an array), it comes down to the following definition:

_to_linear_index(A::AbstractArray) = 1 # TODO: DEPRECATE FOR #14770

So hopefully that means the method will actually go away sooner or later.