Skip to content

Commit

Permalink
Merge pull request #17 from Arkoniak/arrays
Browse files Browse the repository at this point in the history
fixed small timetables bugs
  • Loading branch information
Arkoniak committed Apr 8, 2021
2 parents 6f5e4db + f5a8426 commit 715fdc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Timestamps"
uuid = "0123453a-27b6-4e80-93fe-c2c00e33fefb"
authors = ["Andrey Oskin and contributors <https://github.com/JuliaQuant/Timestamps.jl/graphs/contributors>"]
version = "0.1.1"
version = "0.1.2"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
9 changes: 6 additions & 3 deletions src/tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Tables.getcolumn(mci::TimestampArrayTableColsIterator, nm::Symbol) = Tables.getc
# Ok, this one is experimental and probably should be moved to a different package
istimetable(::T) where T = istimetable(T)
istimetable(::Type{T}) where T = false
timeaxis(::T) where T = timeaxis(T)
timeaxis(::Type{T}) where T = :timestamp

istimetable(::Type{<:TimestampArray}) = true
timeaxis(x::TimestampArray) = :timestamp

Expand All @@ -66,9 +69,9 @@ function TimestampArray(x; timestamp = :timestamp)
end
rows = Tables.rows(x)
tsps = map(rows) do row
rt = ntuple(i -> row[indx[i]], length(row) - 1)
Timestamp(getproperty(row, tscol), rt)
rt = ntuple(i -> Tables.getcolumn(row, indx[i]), length(row) - 1)
Timestamp(Tables.getcolumn(row, tscol), rt)
end

return TimestampArray(tsps, names[indx])
return TimestampArray(tsps, collect(names[indx]))
end

2 comments on commit 715fdc6

@Arkoniak
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/33837

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.2 -m "<description of version>" 715fdc6ff2458bcb3f76518cde90484a0563d67d
git push origin v0.1.2

Please sign in to comment.