From caea1e96094b606af3acba0b0b11092191fcd988 Mon Sep 17 00:00:00 2001 From: PharmCat <13901158+PharmCat@users.noreply.github.com> Date: Thu, 30 Mar 2023 18:12:00 +0300 Subject: [PATCH] dev 0.11.1 --- Project.toml | 2 +- src/MetidaBase.jl | 2 +- src/dataset.jl | 24 ++++++++++++++---------- src/typedtables.jl | 1 + src/types.jl | 1 + 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Project.toml b/Project.toml index 0d157cc..589bd47 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MetidaBase" uuid = "075456b7-4006-432f-9324-2f8453996c49" authors = ["PharmCat and contributors"] -version = "0.11.0" +version = "0.11.1" [deps] CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" diff --git a/src/MetidaBase.jl b/src/MetidaBase.jl index 726efda..3f39574 100644 --- a/src/MetidaBase.jl +++ b/src/MetidaBase.jl @@ -9,7 +9,7 @@ module MetidaBase import Tables: istable, columnaccess, columns, getcolumn, columnnames, schema, rowaccess, rows import CPUSummary: num_cores - import Base: getindex, length, ht_keyindex, show, pushfirst!, iterate, size, findfirst + import Base: getindex, length, ht_keyindex, show, pushfirst!, iterate, size, findfirst, push!, append! include("abstracttype.jl") include("m_tables.jl") diff --git a/src/dataset.jl b/src/dataset.jl index 81d6c9c..deda968 100644 --- a/src/dataset.jl +++ b/src/dataset.jl @@ -64,6 +64,19 @@ function Base.map(f, d::DataSet) DataSet(map(f, getdata(d))) end +function Base.push!(d::DataSet, el) + push!(getdata(d), el) +end + +function Base.append!(d::DataSet, d2::DataSet) + append!(getdata(d), getdata(d2)) +end + +function Base.append!(d::DataSet, el) + append!(getdata(d), el) +end + + ################################################################################ # BASE ################################################################################ @@ -169,16 +182,7 @@ function uniqueidlist(d::DataSet{T}, list::Symbol) where T <: AbstractIdData end dl end -#= -function uniqueidlist(d::DataSet{T}) where T <: AbstractIdData - dl = Vector{Dict}(undef, 0) - for i in d - id = getid(i) - if id ∉ dl push!(dl, id) end - end - dl -end -=# + function uniqueidlist(::DataSet{T}, ::Nothing) where T <: AbstractIdData nothing end diff --git a/src/typedtables.jl b/src/typedtables.jl index 7845b26..6ce0df6 100644 --- a/src/typedtables.jl +++ b/src/typedtables.jl @@ -1,4 +1,5 @@ # TypedTables.jl interface + function TypedTables.Table(obj::AbstractDataSet; kwargs...) TypedTables.Table(metida_table_(obj; kwargs...)) end diff --git a/src/types.jl b/src/types.jl index 812d42c..da3187e 100644 --- a/src/types.jl +++ b/src/types.jl @@ -1,4 +1,5 @@ # MetidaFreq.jl + struct Proportion <: AbstractData x::Int n::Int