dysonance / Temporal.jl

Time series implementation for the Julia language focused on efficiency and flexibility
Other
100 stars 25 forks source link

Last row of TS is not displayed #34

Closed scls19fr closed 5 years ago

scls19fr commented 5 years ago

Hello,

Last row of TS is not displayed.

Here is an example inspired from README to show issue (fixing also some depreciation warnings)

using Test
using Temporal
using Dates
using Random

N, K = (2, 4);

Random.seed!(1);

v = rand(N, K);

t = today()-Day(N-1):Day(1):today();

f = [:A, :B, :C, :D];

X = TS(v, t, f)

println(X)

@test size(X) == (N, K)

Here is output:

2x4 TS{Float64,Date}: 2018-11-20 to 2018-11-21

Index       A       B       C       D
2018-11-20  0.236   0.3127  0.4886  0.9519

Kind regards

dysonance commented 5 years ago

@scls19fr Thanks for raising this, sorry it took a little while to get around to it. Just pushed a fix to the master branch so if you checkout that branch this should be taken care of. This had to do with an issue in the iterator protocol stopping one row too soon and should resolve some other issues as well.

Going to close for now, let me know if you continue to see issues with the fix. Will open a request to have this pushed to Julia METADATA for the wider public as well. Cheers and thanks again!

scls19fr commented 5 years ago

Thanks @dysonance for this fix. Maybe you should add a test for this with the previous code and something like

@test string(X) == """2x4 TS{Float64,Date}: 2018-12-03 to 2018-12-04

Index       A       B       C       D       
2018-12-03  0.236   0.3127  0.4886  0.9519  
...
"""