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

deprecate writecsv in favor of writedlm #23529

Merged
merged 1 commit into from
Sep 9, 2017
Merged
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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ Deprecated or removed
* The keyword `immutable` is fully deprecated to `struct`, and
`type` is fully deprecated to `mutable struct` ([#19157], [#20418]).

* `writecsv(io, a; opts...)` has been deprecated in favor of
`writedlm(io, a, ','; opts...)` ([#23529]).

* The method `srand(rng, filename, n=4)` has been deprecated ([#21359]).

* The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated
Expand Down
9 changes: 1 addition & 8 deletions base/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DataFmt

import Base: _default_delims, tryparse_internal, show

export countlines, readdlm, readcsv, writedlm, writecsv
export countlines, readdlm, readcsv, writedlm

invalid_dlm(::Type{Char}) = reinterpret(Char, 0xfffffffe)
invalid_dlm(::Type{UInt8}) = 0xfe
Expand Down Expand Up @@ -703,13 +703,6 @@ tab-delimited text to `f` by either `writedlm(f, [x y])` or by `writedlm(f, zip(
"""
writedlm(io, a; opts...) = writedlm(io, a, '\t'; opts...)

"""
writecsv(filename, A; opts)

Equivalent to [`writedlm`](@ref) with `delim` set to comma.
"""
writecsv(io, a; opts...) = writedlm(io, a, ','; opts...)

show(io::IO, ::MIME"text/csv", a) = writedlm(io, a, ',')
show(io::IO, ::MIME"text/tab-separated-values", a) = writedlm(io, a, '\t')

Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,9 @@ export hex2num
@deprecate_binding φ MathConstants.φ
@deprecate_binding golden MathConstants.golden

# deprecate writecsv
@deprecate writecsv(io, a; opts...) writedlm(io, a, ','; opts...)

# PR #23271
function IOContext(io::IO; kws...)
depwarn("IOContext(io, k=v, ...) is deprecated, use IOContext(io, :k => v, ...) instead.", :IOContext)
Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@ export
unmark,
watch_file,
write,
writecsv,
writedlm,
TCPSocket,
UDPSocket,
Expand Down
1 change: 0 additions & 1 deletion doc/src/stdlib/io-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Base.DataFmt.readdlm(::Any, ::Type)
Base.DataFmt.readdlm(::Any)
Base.DataFmt.writedlm
Base.DataFmt.readcsv
Base.DataFmt.writecsv
Base.Base64.Base64EncodePipe
Base.Base64.Base64DecodePipe
Base.Base64.base64encode
Expand Down
2 changes: 1 addition & 1 deletion test/perf/kernel/perf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ d = randn(len)

@timeit (for n in 1:10; a = arith_vectorized(b,c,d); end) "vectorize" "Vectorized arithmetic"

writecsv("random.csv", rand(100000,4))
writedlm("random.csv", rand(100000, 4), ',')

function parsecsv()
for line in eachline("random.csv")
Expand Down