Skip to content

Commit fecc184

Browse files
authored
add compatibility with vscode tableviewer (#510)
* add compatibility with vscode tableviewer * update Project.toml with compat
1 parent 3291223 commit fecc184

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ version = "0.24.1"
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
88
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
99
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
10+
IteratorInterfaceExtensions = "82899510-4779-5014-852e-03e436cf321d"
1011
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
1112
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1213
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1314
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
15+
TableTraits = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
1416
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1517

1618
[compat]
@@ -23,6 +25,8 @@ Statistics = "1"
2325
Tables = "1"
2426
julia = "1.6"
2527
PrettyTables = "2"
28+
IteratorInterfaceExtensions = "1"
29+
TableTraits = "1"
2630

2731
[extras]
2832
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

src/tables.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module TablesIntegration
55
using ..TimeSeries
66

77
using Tables
8+
using TableTraits
9+
using IteratorInterfaceExtensions
810

911

1012
# S: the column names, including the extra column name for time index
@@ -63,6 +65,10 @@ Tables.schema(i::TableIter{T,S}) where {T,S} = Tables.Schema(S, coltypes(data(i)
6365

6466
coltypes(x::AbstractTimeSeries{T,N,D}) where {T,N,D} = (D, (T for _ 1:size(x, 2))...)
6567

68+
TableTraits.isiterabletable(x::TimeArray) = true
69+
IteratorInterfaceExtensions.getiterator(ta::TimeArray) =
70+
Tables.datavaluerows(Tables.columntable(ta))
71+
IteratorInterfaceExtensions.isiterable(ta::TimeArray) = true
6672

6773
###############################################################################
6874
# Constructors

0 commit comments

Comments
 (0)