Skip to content

Commit 44eec32

Browse files
committed
remove old definition of byrow(ds, isequal, cols))
1 parent 0eed815 commit 44eec32

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

src/byrow/byrow.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ function byrow(ds::AbstractDataset, ::typeof(all), cols::MultiColumnIndex = :; b
4444
end
4545
byrow(ds::AbstractDataset, ::typeof(all), col::ColumnIndex; by = x->isequal(true, x), threads = nrow(ds)>1000) = byrow(ds, all, [col]; by = by, threads = threads)
4646

47-
byrow(ds::AbstractDataset, ::typeof(isequal), cols::MultiColumnIndex; threads = nrow(ds)>1000) = row_isequal(ds, cols, threads = threads)
47+
byrow(ds::AbstractDataset, ::typeof(isequal), cols::MultiColumnIndex; threads = nrow(ds)>1000) = row_isequal(ds, cols, threads = threads)
4848
byrow(ds::AbstractDataset, ::typeof(findfirst), cols::MultiColumnIndex; by = identity, threads = nrow(ds)> 1000) = row_findfirst(ds, by, cols; threads = threads)
4949
byrow(ds::AbstractDataset, ::typeof(findlast), cols::MultiColumnIndex; by = identity, threads = nrow(ds)> 1000) = row_findlast(ds, by, cols; threads = threads)
5050

5151

5252
byrow(ds::AbstractDataset, ::typeof(coalesce), cols::MultiColumnIndex; threads = nrow(ds)>1000) = threads ? hp_row_coalesce(ds, cols) : row_coalesce(ds, cols)
5353

54-
byrow(ds::AbstractDataset, ::typeof(isequal), cols::MultiColumnIndex; threads = nrow(ds)>1000) = threads ? hp_row_isequal(ds, cols) : row_isequal(ds, cols)
55-
5654
byrow(ds::AbstractDataset, ::typeof(mean), cols::MultiColumnIndex = names(ds, Union{Missing, Number}); by = identity, threads = nrow(ds)>1000) = threads ? hp_row_mean(ds, by, cols) : row_mean(ds, by, cols)
5755
byrow(ds::AbstractDataset, ::typeof(mean), col::ColumnIndex; by = identity, threads = nrow(ds)>1000) = byrow(ds, mean, [col]; by = by, threads = threads)
5856

src/byrow/hp_row_functions.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,6 @@ function hp_row_coalesce(ds::AbstractDataset, cols = names(ds, Union{Missing, Nu
111111
mapreduce(identity, hp_op_coalesce!, view(_columns(ds),colsidx), init = init0)
112112
end
113113

114-
function hp_op_isequal!(x,y,x1)
115-
Threads.@threads for i in 1:length(x)
116-
@inbounds x[i] &= isequal(x1[i], y[i])
117-
end
118-
x
119-
end
120-
function hp_row_isequal(ds::AbstractDataset, cols)
121-
colsidx = index(ds)[cols]
122-
init0 = ones(Bool, nrow(ds))
123-
length(colsidx) == 1 && return init0
124-
x1 = _columns(ds)[colsidx[1]]
125-
mapreduce(identity, (x, y)->hp_op_isequal!(x, y, x1), view(_columns(ds),view(colsidx, 2:length(colsidx))), init = init0)
126-
end
127-
128-
129114
function hp_row_mean(ds::AbstractDataset, f::Function, cols = names(ds, Union{Missing, Number}))
130115
hp_row_sum(ds, f, cols) ./ hp_row_count(ds, x -> !ismissing(x), cols)
131116
end

src/byrow/row_functions.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,6 @@ function row_coalesce(ds::AbstractDataset, cols = names(ds, Union{Missing, Numbe
175175
mapreduce(identity, _op_for_coalesce!, view(_columns(ds),colsidx), init = init0)
176176
end
177177

178-
function row_isequal(ds::AbstractDataset, cols)
179-
colsidx = index(ds)[cols]
180-
init0 = ones(Bool, nrow(ds))
181-
_op_for_isequal!(x, y, x1) = x .&= isequal.(x1, y)
182-
length(colsidx) == 1 && return init0
183-
x1 = _columns(ds)[colsidx[1]]
184-
mapreduce(identity, (x, y)->_op_for_isequal!(x, y, x1), view(_columns(ds),view(colsidx, 2:length(colsidx))), init = init0)
185-
end
186-
187178
function row_mean(ds::AbstractDataset, f::Function, cols = names(ds, Union{Missing, Number}))
188179
row_sum(ds, f, cols) ./ row_count(ds, x -> !ismissing(x), cols)
189180
end

0 commit comments

Comments
 (0)