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

Mapping time series does not work #459

Open
juliohm opened this issue Jun 10, 2020 · 6 comments
Open

Mapping time series does not work #459

juliohm opened this issue Jun 10, 2020 · 6 comments

Comments

@juliohm
Copy link

juliohm commented Jun 10, 2020

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
@simeonschaub
Copy link

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

@juliohm
Copy link
Author

juliohm commented Jun 13, 2020

Is there anyone maintaining TimeSeries.jl?

@iblislin
Copy link
Collaborator

iblislin commented Jun 22, 2020

Hi @juliohm

please try this

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

@juliohm
Copy link
Author

juliohm commented Jun 22, 2020 via email

@iblislin
Copy link
Collaborator

iblislin commented Jun 22, 2020

@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:

@testset "map works correctly" begin

@juliohm
Copy link
Author

juliohm commented Jun 22, 2020 via email

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

No branches or pull requests

3 participants