Skip to content

Commit b4e6332

Browse files
committed
bug fix in showing latex + improve docstring
1 parent 4220d4b commit b4e6332

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/abstractdataset/io.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Dataset.getmaxwidths(ds::AbstractDataset,
2+
IMD.getmaxwidths(ds::AbstractDataset,
33
io::IO,
44
rowindices1::AbstractVector{Int},
55
rowindices2::AbstractVector{Int},
@@ -89,24 +89,24 @@ end
8989
"""
9090
show(io::IO, mime::MIME, ds::AbstractDataset)
9191
92-
Render a data frame to an I/O stream in MIME type `mime`.
92+
Render a data set to an I/O stream in MIME type `mime`.
9393
9494
# Arguments
9595
- `io::IO`: The I/O stream to which `ds` will be printed.
9696
- `mime::MIME`: supported MIME types are: `"text/plain"`, `"text/html"`, `"text/latex"`,
9797
`"text/csv"`, `"text/tab-separated-values"` (the last two MIME types do not support
9898
showing `#undef` values)
99-
- `ds::AbstractDataset`: The data frame to print.
99+
- `ds::AbstractDataset`: The data set to print.
100100
101101
Additionally selected MIME types support passing the following keyword arguments:
102102
- MIME type `"text/plain"` accepts all listed keyword arguments and therir behavior
103103
is identical as for `show(::IO, ::AbstractDataset)`
104104
- MIME type `"text/html"` accepts `summary` keyword argument which
105-
allows to choose whether to print a brief string summary of the data frame.
105+
allows to choose whether to print a brief string summary of the data set.
106106
107107
# Examples
108108
```jldoctest
109-
julia> show(stdout, MIME("text/latex"), DataFrame(A = 1:3, B = ["x", "y", "z"]))
109+
julia> show(stdout, MIME("text/latex"), Dataset(A = 1:3, B = ["x", "y", "z"]))
110110
\\begin{tabular}{r|cc}
111111
\t& A & B\\\\
112112
\t\\hline
@@ -118,7 +118,7 @@ julia> show(stdout, MIME("text/latex"), DataFrame(A = 1:3, B = ["x", "y", "z"]))
118118
\\end{tabular}
119119
14
120120
121-
julia> show(stdout, MIME("text/csv"), DataFrame(A = 1:3, B = ["x", "y", "z"]))
121+
julia> show(stdout, MIME("text/csv"), Dataset(A = 1:3, B = ["x", "y", "z"]))
122122
"A","B"
123123
1,"x"
124124
2,"y"
@@ -454,6 +454,7 @@ function _show(io::IO, ::MIME"text/latex", ds::AbstractDataset;
454454
write(io, " \\\\\n")
455455
end
456456
write(io, "\\end{tabular}\n")
457+
nothing
457458
end
458459

459460
# function Base.show(io::IO, mime::MIME"text/latex", dsr::DataFrameRow; eltypes::Bool=true)

src/abstractdataset/show.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Base.summary(ds::SubDataset) =
1212

1313

1414
"""
15-
DataFrames.ourstrwidth(io::IO, x::Any, buffer::IOBuffer, truncstring::Int)
15+
IMD.ourstrwidth(io::IO, x::Any, buffer::IOBuffer, truncstring::Int)
1616
1717
Determine the number of characters that would be used to print a value.
1818
"""
@@ -35,7 +35,7 @@ function truncatestring(s::AbstractString, truncstring::Int)
3535
end
3636

3737
"""
38-
DataFrames.ourshow(io::IO, x::Any, truncstring::Int)
38+
IMD.ourshow(io::IO, x::Any, truncstring::Int)
3939
4040
Render a value to an `IO` object compactly using print.
4141
`truncstring` indicates the approximate number of text characters width to truncate
@@ -354,8 +354,6 @@ and `allrows`, `allcols` and `allgroups` default to `false`.
354354
If `truncate` is 0 or less, no truncation is applied.
355355
- `kwargs...`: Any keyword argument supported by the function `pretty_table` of
356356
PrettyTables.jl can be passed here to customize the output.
357-
358-
```
359357
"""
360358
function Base.show(io::IO,
361359
ds::AbstractDataset;

0 commit comments

Comments
 (0)