Skip to content

Commit

Permalink
Merge pull request #161 from fingolfin/mh/typos
Browse files Browse the repository at this point in the history
Fix typos founds by codespell
  • Loading branch information
oxinabox authored Nov 13, 2022
2 parents 95a95b3 + 5bd0055 commit 540118c
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/errors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct NoValidPathError <: Exception
end

"""
For when a users has selected to abourt
For when a users has selected to abort
"""
struct UserAbortError <: Exception
msg::String
Expand Down
4 changes: 2 additions & 2 deletions src/fetch_helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
Download from `remote_path` to `local_dir`, via `Base` mechanisms.
The download is performed using `Base.download`
and `Base.basename(remote_path)` is used to determine the filename.
This is very limitted in the case of HTTP as the filename is not always encoded in the URL.
This is very limited in the case of HTTP as the filename is not always encoded in the URL.
But it does work for simple paths like `"http://myserver/files/data.csv"`.
In general for those cases prefer `http_download`.
Expand All @@ -64,7 +64,7 @@ end
fetch_http(remotepath, localdir; update_period=5)
Pass in a HTTP[/S] URL and a directory to save it to,
and it downloads that file, returing the local path.
and it downloads that file, returning the local path.
This is using the HTTP protocol's method of defining filenames in headers,
if that information is present.
Returns the localpath that it was downloaded to.
Expand Down
4 changes: 2 additions & 2 deletions src/locations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkpath(first(standard_loadpath))


########################################################################################################################
## Package reletive path determining
## Package relative path determining

"""
try_determine_package_datadeps_dir(filepath)
Expand Down Expand Up @@ -126,7 +126,7 @@ end
"""
try_determine_load_path(name)
Trys to find a local path to the datadep with the given name.
Tries to find a local path to the datadep with the given name.
If it fails then it returns nothing.
"""
function try_determine_load_path(name::String, rel)
Expand Down
4 changes: 2 additions & 2 deletions src/preupload.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Similarly, if the `post_fetch_method` throws an exception, a warning will be dis
Returns: true or false, depending on if the checks were all good, or not.
Arguements:
Arguments:
- `datadep`: Either an instance of a DataDep type, or the name of a registered DataDep as a AbstractString
- `local_filepath`: a filepath or (recursive) list of filepaths.
Expand All @@ -40,7 +40,7 @@ end
postfetch_check(post_fetch_method, local_path)
Executes the post_fetch_method on the given local path,
in a temportary directory.
in a temporary directory.
Returns true if there are no exceptions.
Performs in (async) parallel if multiple paths are given
"""
Expand Down
4 changes: 2 additions & 2 deletions src/resolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end
resolve(datadep, inner_filepath, calling_filepath)
Returns a path to the folder containing the datadep.
Even if that means downloading the dependancy and putting it in there.
Even if that means downloading the dependency and putting it in there.
- `inner_filepath` is the path to the file within the data dir
- `calling_filepath` is a path to the file where this is being invoked from
Expand Down Expand Up @@ -58,7 +58,7 @@ end
resolve("name/path", @__FILE__)
Is the function that lives directly behind the `datadep"name/path"` macro.
If you are working the the names of the datadeps programatically,
If you are working the the names of the datadeps programmatically,
and don't want to download them by mistake;
it can be easier to work with this function.
Expand Down
10 changes: 5 additions & 5 deletions src/resolution_automatic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Otherwise will do nothing.
"""
function ensure_download_permitted()
if env_bool("DATADEPS_DISABLE_DOWNLOAD")
throw(DisabledError("DATADEPS_DISABLE_DOWNLOAD enviroment variable set."))
throw(DisabledError("DATADEPS_DISABLE_DOWNLOAD environment variable set."))
end
if env_bool("CI") && !haskey(ENV, "DATADEPS_ALWAYS_ACCEPT")
throw(DisabledError("DataDeps download disabled, as we appear to be in a CI environment, " *
Expand All @@ -42,18 +42,18 @@ end
i_accept_the_terms_of_use=nothing)
A method to download a datadep.
Normally, you do not have to download a data dependancy manually.
Normally, you do not have to download a data dependency manually.
If you simply cause the string macro `datadep"DepName"`,
to be exectuted it will be downloaded if not already present.
to be executed it will be downloaded if not already present.
Invoking this `download` method manually is normally for purposes of debugging,
As such it include a number of parameters that most people will not want to use.
- `localdir`: this is the local directory to save to.
- `remotepath`: the remote path to fetch the data from, use this e.g. if you can't access the normal path where the data should be, but have an alternative.
- `skip_checksum`: setting this to true causes the checksum to not be checked. Use this if the data has changed since the checksum was set in the registry, or for some reason you want to download different data.
- `i_accept_the_terms_of_use`: use this to bypass the I agree to terms screen. Useful if you are scripting the whole process, or using annother system to get confirmation of acceptance.
- For automation perposes you can set the enviroment variable `DATADEPS_ALWAYS_ACCEPT`
- `i_accept_the_terms_of_use`: use this to bypass the I agree to terms screen. Useful if you are scripting the whole process, or using another system to get confirmation of acceptance.
- For automation perposes you can set the environment variable `DATADEPS_ALWAYS_ACCEPT`
- If not set, and if `DATADEPS_ALWAYS_ACCEPT` is not set, then the user will be prompted.
- Strictly speaking these are not always terms of use, it just refers to the message and permission to download.
Expand Down
6 changes: 3 additions & 3 deletions src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ function splitpath(path::AbstractString)
end

########################################
# Enviroment variable stuff
# Environment variable stuff

"""
env_bool(key)
Checks for an enviroment variable and fuzzy converts it to a bool
Checks for an environment variable and fuzzy converts it to a bool
"""
env_bool(key, default=false) = haskey(ENV, key) ? lowercase(ENV[key]) ["0","","false", "no"] : default

"""
env_list(key)
Checks for an enviroment variable and converts it to a list of strings, sperated with a colon
Checks for an environment variable and converts it to a list of strings, sperated with a colon
"""
env_list(key, default=String[]) = haskey(ENV, key) ? split(ENV[key], ":") : default

Expand Down
4 changes: 2 additions & 2 deletions src/verification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
run_checksum(checksum, path)
THis runs the checksum on the files at the fetched_path.
And returns true or false base on if the checksum matchs.
And returns true or false base on if the checksum matches.
(always true if no target sum given)
It is kinda flexible and accepts different kinds of behavour
It is kinda flexible and accepts different kinds of behaviour
to give different kinds of results.
If path (the second parameter) is a Vector,
Expand Down
6 changes: 3 additions & 3 deletions test/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true
end

@testset "TrumpTweets" begin
# This tests demostrates how the `post_fetch_method` can be used to synthesize new files
# This tests demonstrates how the `post_fetch_method` can be used to synthesize new files

register(DataDep("TrumpTweets",
"""
Expand Down Expand Up @@ -72,7 +72,7 @@ end
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner.
"Gradient-based learning applied to document recognition."
Proceedings of the IEEE, 86(11):2278-2324, November 1998
The files are available for download at the offical
The files are available for download at the official
website linked above. We can download these files for you
if you wish, but that doesn't free you from the burden of
using the data responsibly and respect copyright. The
Expand All @@ -96,7 +96,7 @@ end
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner.
"Gradient-based learning applied to document recognition."
Proceedings of the IEEE, 86(11):2278-2324, November 1998
The files are available for download at the offical
The files are available for download at the official
website linked above. We can download these files for you
if you wish, but that doesn't free you from the burden of
using the data responsibly and respect copyright. The
Expand Down
2 changes: 1 addition & 1 deletion test/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ withenv("DATADEPS_ALWAYS_ACCEPT"=>"true") do

@testset "sanity check the macro's behaviour with variables" begin
var = "foo/bar"
macroexpand(@__MODULE__, :(@datadep_str var)) # this line would throw an error if the varibles were being handle wrong
macroexpand(@__MODULE__, :(@datadep_str var)) # this line would throw an error if the variables were being handle wrong
@test true
end

Expand Down

0 comments on commit 540118c

Please sign in to comment.