diff --git a/src/errors.jl b/src/errors.jl index 0bac064..83211fe 100644 --- a/src/errors.jl +++ b/src/errors.jl @@ -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 diff --git a/src/fetch_helpers.jl b/src/fetch_helpers.jl index 0e2fe0e..cc33e47 100644 --- a/src/fetch_helpers.jl +++ b/src/fetch_helpers.jl @@ -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`. @@ -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. diff --git a/src/locations.jl b/src/locations.jl index 297e3d4..5a010ec 100644 --- a/src/locations.jl +++ b/src/locations.jl @@ -20,7 +20,7 @@ mkpath(first(standard_loadpath)) ######################################################################################################################## -## Package reletive path determining +## Package relative path determining """ try_determine_package_datadeps_dir(filepath) @@ -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) diff --git a/src/preupload.jl b/src/preupload.jl index 803a894..18ec4c5 100644 --- a/src/preupload.jl +++ b/src/preupload.jl @@ -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. @@ -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 """ diff --git a/src/resolution.jl b/src/resolution.jl index c7e6258..0d625e9 100644 --- a/src/resolution.jl +++ b/src/resolution.jl @@ -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 @@ -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. diff --git a/src/resolution_automatic.jl b/src/resolution_automatic.jl index 61b8a9e..699cd13 100644 --- a/src/resolution_automatic.jl +++ b/src/resolution_automatic.jl @@ -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, " * @@ -42,9 +42,9 @@ 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. @@ -52,8 +52,8 @@ 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. diff --git a/src/util.jl b/src/util.jl index aa04716..b0adec4 100644 --- a/src/util.jl +++ b/src/util.jl @@ -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 diff --git a/src/verification.jl b/src/verification.jl index e189d0c..e12a7c6 100644 --- a/src/verification.jl +++ b/src/verification.jl @@ -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, diff --git a/test/examples.jl b/test/examples.jl index cca6c25..8eef457 100644 --- a/test/examples.jl +++ b/test/examples.jl @@ -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", """ @@ -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 @@ -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 diff --git a/test/main.jl b/test/main.jl index 2469baa..22f60fb 100644 --- a/test/main.jl +++ b/test/main.jl @@ -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