TimeSeries.jl icon indicating copy to clipboard operation
TimeSeries.jl copied to clipboard

Mapping time series does not work

Open juliohm opened this issue 5 years ago • 6 comments

MWE:

using TimeSeries

ts = Date(2000):Day(1):Date(2001)
vs = zeros(size(ts))

ta = TimeArray(ts, vs)

map(ta) do (t, v)
  # does not work
end

ERROR: MethodError: no method matching (::var"#13#14")(::Date, ::Float64)
Closest candidates are:
  #13(::Any) at REPL[18]:3
Stacktrace:
 [1] macro expansion at /home/juliohm/.julia/packages/TimeSeries/49cHd/src/combine.jl:184 [inlined]
 [2] map(::var"#13#14", ::TimeArray{Float64,1,Date,Array{Float64,1}}) at /home/juliohm/.julia/packages/TimeSeries/49cHd/src/combine.jl:174

juliohm avatar Jun 10 '20 21:06 juliohm

Is this type piracy by overloading Base.map really a good idea?

simeonschaub avatar Jun 10 '20 21:06 simeonschaub

Is there anyone maintaining TimeSeries.jl?

juliohm avatar Jun 13 '20 14:06 juliohm

Hi @juliohm

please try this

map(ta) do t, v
  t, v         
end

iblislin avatar Jun 22 '20 05:06 iblislin

It shows the same error.

On Mon, Jun 22, 2020, 02:26 Iblis Lin [email protected] wrote:

Hi @juliohm https://github.com/juliohm

please try this

map(ta) do t, v t, v end

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JuliaStats/TimeSeries.jl/issues/459#issuecomment-647286761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQW3OYL5DKSH2G73MOCY3RX3TP3ANCNFSM4N2Y662Q .

juliohm avatar Jun 22 '20 09:06 juliohm

@juliohm which version of Julia do you have?

I tested them on Julia v1.4 and Julia v1.3. You can consult the case cases of map as well: https://github.com/JuliaStats/TimeSeries.jl/blob/ed0cd207d379fe7959a00e5772034fcaec4b5eb5/test/combine.jl#L246

iblislin avatar Jun 22 '20 11:06 iblislin

We tested it on Julia v1.4. I can try reproduce the issue some other time when I am back to that environment.

On Mon, Jun 22, 2020, 08:22 Iblis Lin [email protected] wrote:

@juliohm https://github.com/juliohm which version of Julia do you have?

This tested them on Julia v1.4 and Julia v1.3. You can consult the case cases of map as well: https://github.com/JuliaStats/TimeSeries.jl/blob/ed0cd207d379fe7959a00e5772034fcaec4b5eb5/test/combine.jl#L246

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JuliaStats/TimeSeries.jl/issues/459#issuecomment-647455028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQW3M6TW3CIWP6LSCVYO3RX45HVANCNFSM4N2Y662Q .

juliohm avatar Jun 22 '20 11:06 juliohm