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

Reduce number of required parameters for DataDep #58

Closed
femtotrader opened this issue Jul 19, 2018 · 2 comments
Closed

Reduce number of required parameters for DataDep #58

femtotrader opened this issue Jul 19, 2018 · 2 comments

Comments

@femtotrader
Copy link

Hello,

following queryverse/Queryverse.jl#6 (comment)
we should reduce number of required parameters for DataDep

using DataDeps

function __init__()
    register(DataDep(
        "https://raw.githubusercontent.com/davidanthoff/CSVFiles.jl/master/test/data.csv"
    ))
end

df = load(datadep"Queryverse Tests/data.csv") |> DataFrame

should be enough

Message (or message) could be set to "" by default

Name could be set to a default value (a default directory where files are stored)

Kind regards

@femtotrader femtotrader changed the title Reduce number of required parameter for DataDep Reduce number of required parameters for DataDep Jul 19, 2018
@oxinabox
Copy link
Owner

Thanks for your interest.
Two points, and I'll address them separately.

Message (or message) could be set to "" by default

Why? Do convince me.

My why not is that one of the core goals of this package is to help people do better science.
The message parameter exists to allow the giving of credit, the explanation of source,
listings of papers to cite, or licensing terms.

Defaulting it, thus makes it easier to neglect to include this information, without thinking about it.
Where-as forcing the user to enter "" at least means they are making a conscious choice,
to not provide it.


Name could be set to a default value (a default directory where files are stored)

It actually couldn't.
It might not be apparent, but DataDeps.jl is strongly folder orientated.
Every name must be unique (some limited scoping with the package/project private directories, but not important here).
Each datadep corresponds to a folder with that name (which is located somewhere on the system, most likely ~/.julia/datadeps/, but movable and configurable).
Even for datadeps that contain only a single file, it will have a folder with the given name.

When you say df = load(datadep"Queryverse Tests/data.csv") |> DataFrame
the Queryverse Tests part is actually saying the name of the datadep,
so that DataDeps.jl can go and search around various parts of the system looking for a folder with that name. (and then downloading if it doesn't find one).

It would be difficult to be able to default that ever, I can't think how it could be done.
Maybe for packages with only one DataDep it could be defaulted to the package name or something.
but it seems more confusing than not.

@oxinabox
Copy link
Owner

oxinabox commented Nov 8, 2018

I am tempted to close this, given no activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants