Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc_enhancement #36

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 6 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Documenter
using InMemoryDatasets

# DocMeta.setdocmeta!(InMemoryDatasets, :DocTestSetup, :(using InMemoryDatasets); recursive=true)
DocMeta.setdocmeta!(InMemoryDatasets, :DocTestSetup, :(using InMemoryDatasets); recursive=true)

# Build documentation.
# ====================

makedocs(
# options
# modules = [InMemoryDatasets],
doctest = false,
doctest = false, # this needs more work
clean = false,
sitename = "InMemoryDatasets",
# format = Documenter.HTML(
Expand All @@ -34,10 +34,10 @@ makedocs(
"Joins" => "man/joins.md"
],
"Gallery" => "man/gallery.md",
"Performance tips" => "man/performance.md"
# "API" => Any[
# "Functions" => "lib/functions.md"
# ]
"Performance tips" => "man/performance.md",
"API" => Any[
"Functions" => "lib/functions.md"
]
],
strict = true
)
Expand Down
11 changes: 11 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
```
53 changes: 17 additions & 36 deletions docs/src/lib/functions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- ```@meta
```@meta
CurrentModule = InMemoryDatasets
```

Expand All @@ -11,6 +11,7 @@ Pages = ["functions.md"]
## Constructing data set
```@docs
copy
repeat!
similar
```

Expand All @@ -23,6 +24,7 @@ setformat!
## Summary information
```@docs
content
getinfo
ncol
ndims
nrow
Expand All @@ -38,38 +40,29 @@ rename
rename!
```

## Mutating and transforming data sets
## Modifying data sets
```@docs
append!
combine
flatten
hcat
flatten!
insertcols!
map
map!
modify
modify!
mapcols
push!
repeat
repeat!
select
select!
update
update!
```

## Transposing and reshaping data sets
```@docs
flatten
flatten!
transpose
```

## Sorting
```@docs
sort
sort!
sortperm
```

## Joining
```@docs
antijoin
Expand All @@ -82,23 +75,19 @@ leftjoin!
outerjoin
semijoin
semijoin!
```

## Grouping
```@docs
groupby
groupby!
ungroup!
update
update!
```

## Filtering rows
```@docs
byrow
compare
contains
deleteat!
empty
empty!
duplicates
first
filter
filter!
last
mask
unique
Expand All @@ -107,7 +96,6 @@ unique!

## Working with missing values
```@docs
byrow
completecases
dropmissing
dropmissing!
Expand All @@ -118,17 +106,10 @@ map!
## Statistics
```@docs
lag
lag!
lead
maximum
mean
median
minimum
lead!
rescale
stdze
sum
topk
var
std
wmean
wsum
``` -->
```
84 changes: 10 additions & 74 deletions src/abstractdataset/abstractdataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -399,7 +408,6 @@ julia> rename!(uppercase, ds)
1 │ 1 2 3
```
"""

function rename!(ds::AbstractDataset, vals::AbstractVector{Symbol};
makeunique::Bool=false)
# Modify Dataset
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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
Expand Down