Skip to content

Commit 2b3461c

Browse files
committed
Set default name of Compose column to lowercase "coda"
1 parent c2ab404 commit 2b3461c

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/transforms/compose.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@
33
# ------------------------------------------------------------------
44

55
"""
6-
Compose(; as=:CODA)
6+
Compose(; as=:coda)
77
88
Converts all columns of the table into parts of a composition
99
in a new column named `as`, using the `CoDa.compose` function.
1010
11-
Compose(col₁, col₂, ..., colₙ; as=:CODA)
12-
Compose([col₁, col₂, ..., colₙ]; as=:CODA)
13-
Compose((col₁, col₂, ..., colₙ); as=:CODA)
11+
Compose(col₁, col₂, ..., colₙ; as=:coda)
12+
Compose([col₁, col₂, ..., colₙ]; as=:coda)
13+
Compose((col₁, col₂, ..., colₙ); as=:coda)
1414
1515
Converts the selected columns `col₁`, `col₂`, ..., `colₙ` into parts of a composition.
1616
17-
Compose(regex; as=:CODA)
17+
Compose(regex; as=:coda)
1818
1919
Converts the columns that match with `regex` into parts of a composition.
2020
2121
# Examples
2222
2323
```julia
24-
Compose(as=:comp)
24+
Compose(as=:composition)
2525
Compose([2, 3, 5])
2626
Compose([:b, :c, :e])
2727
Compose(("b", "c", "e"))
28-
Compose(r"[bce]", as="COMP")
28+
Compose(r"[bce]", as="composition")
2929
```
3030
"""
3131
struct Compose{S<:ColumnSelector} <: StatelessFeatureTransform
3232
selector::S
3333
as::Symbol
3434
end
3535

36-
Compose(selector::ColumnSelector; as=:CODA) = Compose(selector, Symbol(as))
36+
Compose(selector::ColumnSelector; as=:coda) = Compose(selector, Symbol(as))
3737

3838
Compose(; kwargs...) = Compose(AllSelector(); kwargs...)
3939
Compose(cols; kwargs...) = Compose(selector(cols); kwargs...)

test/shows.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@
501501

502502
# compact mode
503503
iostr = sprint(show, T)
504-
@test iostr == "Compose(selector: [:a, :b, :c], as: :CODA)"
504+
@test iostr == "Compose(selector: [:a, :b, :c], as: :coda)"
505505

506506
# full mode
507507
iostr = sprint(show, MIME("text/plain"), T)
508508
@test iostr == """
509509
Compose transform
510510
├─ selector: [:a, :b, :c]
511-
└─ as: :CODA"""
511+
└─ as: :coda"""
512512
end
513513

514514
@testset "RowTable" begin

test/transforms/compose.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
T = Compose()
1010
n, c = apply(T, t)
11-
@test Tables.schema(n).names == (:CODA,)
12-
@test n.CODA isa CoDaArray
13-
@test n.CODA == CoDaArray(t)
11+
@test Tables.schema(n).names == (:coda,)
12+
@test n.coda isa CoDaArray
13+
@test n.coda == CoDaArray(t)
1414
tₒ = revert(T, n, c)
1515
@test tₒ == t
1616

@@ -24,25 +24,25 @@
2424

2525
T = Compose(1, 2)
2626
n, c = apply(T, t)
27-
@test Tables.schema(n).names == (:c, :CODA)
28-
@test n.CODA isa CoDaArray
29-
@test n.CODA == CoDaArray((a=t.a, b=t.b))
27+
@test Tables.schema(n).names == (:c, :coda)
28+
@test n.coda isa CoDaArray
29+
@test n.coda == CoDaArray((a=t.a, b=t.b))
3030
tₒ = revert(T, n, c)
3131
@test tₒ == t
3232

3333
T = Compose([:a, :c])
3434
n, c = apply(T, t)
35-
@test Tables.schema(n).names == (:b, :CODA)
36-
@test n.CODA isa CoDaArray
37-
@test n.CODA == CoDaArray((a=t.a, c=t.c))
35+
@test Tables.schema(n).names == (:b, :coda)
36+
@test n.coda isa CoDaArray
37+
@test n.coda == CoDaArray((a=t.a, c=t.c))
3838
tₒ = revert(T, n, c)
3939
@test tₒ == t
4040

4141
T = Compose(("b", "c"))
4242
n, c = apply(T, t)
43-
@test Tables.schema(n).names == (:a, :CODA)
44-
@test n.CODA isa CoDaArray
45-
@test n.CODA == CoDaArray((b=t.b, c=t.c))
43+
@test Tables.schema(n).names == (:a, :coda)
44+
@test n.coda isa CoDaArray
45+
@test n.coda == CoDaArray((b=t.b, c=t.c))
4646
tₒ = revert(T, n, c)
4747
@test tₒ == t
4848

0 commit comments

Comments
 (0)