Skip to content

Commit

Permalink
Replace tabs with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Dec 16, 2020
1 parent e284aca commit fe64211
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/fetch_helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""
progress_update_period()
Returns the period between updated being logged on the progress.
This is used by the default `fetch_method` and is generally a good idea
to use it in any custom fetch method, if possible
Expand Down
6 changes: 3 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ DataDep(
- If not provided, then a warning message with the SHA256 sum is displayed. This is to help package devs work out the sum for their files without using an external tool.
- If you want to use a different hashing algorithm, then you can provide a tuple `(hashfun, targethex)`
- `hashfun` should be a function which takes an IOStream, and returns a `Vector{UInt8}`.
- Such as any of the functions from [SHA.jl](https://github.com/staticfloat/SHA.jl), eg `sha3_384`, `sha1_512`
- or `md5` from [MD5.jl](https://github.com/oxinabox/MD5.jl)
- Such as any of the functions from [SHA.jl](https://github.com/staticfloat/SHA.jl), eg `sha3_384`, `sha1_512`
- or `md5` from [MD5.jl](https://github.com/oxinabox/MD5.jl)
- If you want to use a different hashing algorithm, but don't know the sum, you can provide just the `hashfun` and a warning message will be displayed, giving the correct tuple of `(hashfun, targethex)` that should be added to the registration block.
- If you don't want to provide a checksum, because your data can change pass in the type `Any` which will suppress the warning messages. (But see above warnings about "what if my data is dynamic")
- If you don't want to provide a checksum, because your data can change pass in the type `Any` which will suppress the warning messages. (But see above warnings about "what if my data is dynamic")
- Can take a vector of checksums, being one for each file, or a single checksum in which case the per file hashes are `xor`ed to get the target hash. (See [Recursive Structure](Recursive Structure) below)
Expand Down
2 changes: 1 addition & 1 deletion src/verification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ the result is the xor of the all the file checksums.
"""
function run_checksum((hasher, expected_hash)::Tuple{<:Any, <:AbstractString}, path)
actual_hash = hexchecksum(hasher, path)

if actual_hash != expected_hash
@warn "Checksum did not match" expected_hash actual_hash path
return false
Expand Down
24 changes: 12 additions & 12 deletions test/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ end
register(DataDep(
"UCI Adult",
"""
Dataset: Adult Data Set UCI ML Repository
Website: https://archive.ics.uci.edu/ml/datasets/Adult
Abstract : Predict whether income exceeds \$50K/yr based on census data. Also known as "Census Income" dataset.
Dataset: Adult Data Set UCI ML Repository
Website: https://archive.ics.uci.edu/ml/datasets/Adult
Abstract : Predict whether income exceeds \$50K/yr based on census data. Also known as "Census Income" dataset.
If you make use of this data it is requested that you cite:
- Lichman, M. (2013). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.
""",
If you make use of this data it is requested that you cite:
- Lichman, M. (2013). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.
""",
[
[
"https://archive.ics.uci.edu/ml/datasets/../machine-learning-databases/adult/adult.data",
Expand Down Expand Up @@ -188,14 +188,14 @@ end


@testset "gzipped source code" begin
register(DataDep("DataDeps Source v0.5.0",
"""
This is the source code of DataDeps.jl v0.5.0
register(DataDep("DataDeps Source v0.5.0",
"""
This is the source code of DataDeps.jl v0.5.0
This test checked we can unpack gzipped tarballs.
""",
"https://github.com/oxinabox/DataDeps.jl/archive/v0.5.0.tar.gz",
"cd1fc3e58b4272ec559d1c5bcda5e4f0339647dab709baa2d507a73f3a89168d";
"https://github.com/oxinabox/DataDeps.jl/archive/v0.5.0.tar.gz",
"cd1fc3e58b4272ec559d1c5bcda5e4f0339647dab709baa2d507a73f3a89168d";
post_fetch_method=DataDeps.unpack
));
));
@test length(readdir(datadep"DataDeps Source v0.5.0")) == 2
end
4 changes: 2 additions & 2 deletions test/preupload.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using ExpectationStubs
@testset "fail" begin
@stub dummyhash
@expect(dummyhash(::Any) = [0x12, 0x34])

register(
DataDep(
"TestFailChecksumPreupload",
Expand Down Expand Up @@ -77,4 +77,4 @@ end
@test !(@used dummy_postfetch(@__FILE__)) # should not run on file given, but on a copy.
@test @used dummy_postfetch(::Any) # should run on some file
end
end
end

0 comments on commit fe64211

Please sign in to comment.