From 2f0491a2a266869bcb34c71d26ca3b9aec2996cc Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 22:44:41 +1300 Subject: [PATCH 1/7] doc_enhancement --- docs/make.jl | 10 ++++---- docs/src/index.md | 11 +++++++++ docs/src/lib/functions.md | 48 ++++++++++++++++++++++++++------------- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 6d882b18..e2ff5b9f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,8 +8,8 @@ using InMemoryDatasets makedocs( # options - # modules = [InMemoryDatasets], - doctest = false, + modules = [InMemoryDatasets], + doctest = true, clean = false, sitename = "InMemoryDatasets", # format = Documenter.HTML( @@ -35,9 +35,9 @@ makedocs( ], "Gallery" => "man/gallery.md", "Performance tips" => "man/performance.md" - # "API" => Any[ - # "Functions" => "lib/functions.md" - # ] + "API" => Any[ + "Functions" => "lib/functions.md" + ] ], strict = true ) diff --git a/docs/src/index.md b/docs/src/index.md index a57e27c0..3617b7db 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -45,3 +45,14 @@ InMemoryDatasets.jl. In particular it is not safe to directly access fields of t that are a part of public API of the InMemoryDatasets.jl package using e.g. the `getfield` function. Whenever some operation on fields of defined types is considered allowed an appropriate exported function should be used instead. + +```@contents +Pages = ["lib/functions.md"] +Depth = 2 +``` + +## Index + +```@index +Pages = ["lib/functions.md"] +``` diff --git a/docs/src/lib/functions.md b/docs/src/lib/functions.md index 079ad13f..3372ff33 100644 --- a/docs/src/lib/functions.md +++ b/docs/src/lib/functions.md @@ -1,4 +1,4 @@ - ## Joining ```@docs @@ -82,23 +90,38 @@ leftjoin! outerjoin semijoin semijoin! +update +update! ``` -## Grouping + ## Filtering rows ```@docs byrow +byrow(all) +byrow(any) +byrow(count) +byrow(in) +byrow(isequal) +byrow(isless) +byrow(mean) +byrow(prod) +byrow(sum) +compare contains deleteat! +duplicates empty empty! first +filter +filter! last mask unique @@ -118,17 +141,10 @@ map! ## Statistics ```@docs lag +lag! lead -maximum -mean -median -minimum +lead! rescale stdze -sum topk -var -std -wmean -wsum -``` --> +``` From 20506f798d6eae49c53b8bfa0a103d581d0d212d Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 22:46:49 +1300 Subject: [PATCH 2/7] Update make.jl --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index e2ff5b9f..34ecd73a 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -34,7 +34,7 @@ makedocs( "Joins" => "man/joins.md" ], "Gallery" => "man/gallery.md", - "Performance tips" => "man/performance.md" + "Performance tips" => "man/performance.md", "API" => Any[ "Functions" => "lib/functions.md" ] From 147622c4c1134c9dade977699dc885e1948272fc Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 22:51:11 +1300 Subject: [PATCH 3/7] Update make.jl --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 34ecd73a..d99c5bbe 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,7 @@ using Documenter using InMemoryDatasets -# DocMeta.setdocmeta!(InMemoryDatasets, :DocTestSetup, :(using InMemoryDatasets); recursive=true) +DocMeta.setdocmeta!(InMemoryDatasets, :DocTestSetup, :(using InMemoryDatasets); recursive=true) # Build documentation. # ==================== From ef7f4afcec0cffc0afede42d51cfae7a159db2a0 Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 23:00:29 +1300 Subject: [PATCH 4/7] Update Project.toml --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 3489f56b..c79be15d 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,6 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +InMemoryDatasets = "5c01b14b-ab03-46ff-b164-14c663efdd9f" [compat] Documenter = "0.27" From 53ea4598cc143ede49ad0e05fe519dc3d9bdc198 Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 23:04:09 +1300 Subject: [PATCH 5/7] Update make.jl --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index d99c5bbe..a45980f6 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -9,7 +9,7 @@ DocMeta.setdocmeta!(InMemoryDatasets, :DocTestSetup, :(using InMemoryDatasets); makedocs( # options modules = [InMemoryDatasets], - doctest = true, + doctest = false, # this needs more work clean = false, sitename = "InMemoryDatasets", # format = Documenter.HTML( From 53ca3026ffbda93446afea4f39db513eec7de85f Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 23:14:37 +1300 Subject: [PATCH 6/7] update docs --- docs/src/lib/functions.md | 37 +----------- src/abstractdataset/abstractdataset.jl | 84 +++----------------------- 2 files changed, 11 insertions(+), 110 deletions(-) diff --git a/docs/src/lib/functions.md b/docs/src/lib/functions.md index 3372ff33..450f0151 100644 --- a/docs/src/lib/functions.md +++ b/docs/src/lib/functions.md @@ -11,7 +11,6 @@ Pages = ["functions.md"] ## Constructing data set ```@docs copy -repeat repeat! similar ``` @@ -44,20 +43,15 @@ rename! ## Modifying data sets ```@docs append! -combine flatten -hcat +flatten! insertcols! map map! mapcols -modify -modify! push! repeat repeat! -select -select! update update! ``` @@ -69,15 +63,6 @@ flatten! transpose ``` - - ## Joining ```@docs antijoin @@ -94,31 +79,12 @@ update update! ``` - - ## Filtering rows ```@docs -byrow -byrow(all) -byrow(any) -byrow(count) -byrow(in) -byrow(isequal) -byrow(isless) -byrow(mean) -byrow(prod) -byrow(sum) compare contains deleteat! duplicates -empty -empty! first filter filter! @@ -130,7 +96,6 @@ unique! ## Working with missing values ```@docs -byrow completecases dropmissing dropmissing! diff --git a/src/abstractdataset/abstractdataset.jl b/src/abstractdataset/abstractdataset.jl index 068cd303..e73b5310 100644 --- a/src/abstractdataset/abstractdataset.jl +++ b/src/abstractdataset/abstractdataset.jl @@ -276,13 +276,22 @@ end """ setinfo!(ds::AbstractDataset, s::String) -sets `s` as the value for the `info` meta data of `ds`. +Set `s` as the value for the `info` meta data of `ds`. + +See [`getinfo`](@ref) """ function setinfo!(ds::AbstractDataset, s::String) _attributes(ds).meta.info[] = s _modified(_attributes(ds)) s end +""" + getinfo(ds::AbstractDataset) + +Get information set by `setinfo!`. + +See [`setinfo!`](@ref) +""" function getinfo(ds::AbstractDataset) _attributes(ds).meta.info[] end @@ -399,7 +408,6 @@ julia> rename!(uppercase, ds) 1 │ 1 2 3 ``` """ - function rename!(ds::AbstractDataset, vals::AbstractVector{Symbol}; makeunique::Bool=false) # Modify Dataset @@ -543,7 +551,6 @@ julia> rename(uppercase, ds) 1 │ 1 2 3 ``` """ - rename(ds::AbstractDataset, vals::AbstractVector{Symbol}; makeunique::Bool=false) = rename!(copy(ds), vals, makeunique=makeunique) rename(ds::AbstractDataset, vals::AbstractVector{<:AbstractString}; @@ -1441,77 +1448,6 @@ function _vcat(dss::AbstractVector{AbstractDataset}; return Dataset(all_cols, header, copycols=false) end -""" - repeat(ds::AbstractDataset; inner::Integer = 1, outer::Integer = 1) - -Construct a data set by repeating rows in `ds`. `inner` specifies how many -times each row is repeated, and `outer` specifies how many times the full set -of rows is repeated. - -# Example -```jldoctest -julia> ds = Dataset(a = 1:2, b = 3:4) -2×2 Dataset - Row │ a b - │ identity identity - │ Int64? Int64? -─────┼──────────────────── - 1 │ 1 3 - 2 │ 2 4 - -julia> repeat(ds, inner = 2, outer = 3) -12×2 Dataset - Row │ a b - │ identity identity - │ Int64? Int64? -─────┼──────────────────── - 1 │ 1 3 - 2 │ 1 3 - 3 │ 2 4 - 4 │ 2 4 - 5 │ 1 3 - 6 │ 1 3 - 7 │ 2 4 - 8 │ 2 4 - 9 │ 1 3 - 10 │ 1 3 - 11 │ 2 4 - 12 │ 2 4 -``` -""" - -""" - repeat(ds::AbstractDataset, count::Integer) - -Construct a data set by repeating each row in `ds` the number of times -specified by `count`. - -# Example -```jldoctest -julia> ds = Dataset(a = 1:2, b = 3:4) -2×2 Dataset - Row │ a b - │ Int64 Int64 -─────┼────────────── - 1 │ 1 3 - 2 │ 2 4 - -julia> repeat(ds, 2) -4×2 Dataset - Row │ a b - │ Int64 Int64 -─────┼────────────── - 1 │ 1 3 - 2 │ 2 4 - 3 │ 1 3 - 4 │ 2 4 -``` -""" -# function Base.repeat(ds::AbstractDataset, count::Integer) -# count < 0 && throw(ArgumentError("count must be non-negative")) -# return mapcols(x -> repeat(x, Int(count)), ds) -# end - ############################################################################## ## ## Hashing From 9e3064a8efc73e64ed5b437ff387be21f75265c4 Mon Sep 17 00:00:00 2001 From: sl-solution Date: Sun, 16 Jan 2022 23:19:22 +1300 Subject: [PATCH 7/7] Update make.jl --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index a45980f6..71823a5b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,7 +8,7 @@ DocMeta.setdocmeta!(InMemoryDatasets, :DocTestSetup, :(using InMemoryDatasets); makedocs( # options - modules = [InMemoryDatasets], + # modules = [InMemoryDatasets], doctest = false, # this needs more work clean = false, sitename = "InMemoryDatasets",