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

Rename data to load_data and improve it #27

Closed
greimel opened this issue Aug 3, 2022 · 4 comments · Fixed by #30
Closed

Rename data to load_data and improve it #27

greimel opened this issue Aug 3, 2022 · 4 comments · Fixed by #30

Comments

@greimel
Copy link
Contributor

greimel commented Aug 3, 2022

... to avoid name clash with AlgebraOfGraphics.

Also, you could return a named tuple and encourage the user to use

(; apistrat) = dataset(api)

to avoid cluttering the namespace.

@ayushpatnaikgit
Copy link
Member

Thanks, @greimel

Perhaps load_dataset(api) ?

What do you think?
@harsharora21 @chiraganand @iuliadmtru

While we want to keep the API similar to survey, I think calling the function data can't work out.

@iuliadmtru
Copy link
Contributor

Also, you could return a named tuple and encourage the user to use

(; apistrat) = dataset(api)

to avoid cluttering the namespace.

I agree with this, it is much cleaner and I think it makes more sense to have data(api) as an r value instead of having it define some global datasets.

@iuliadmtru
Copy link
Contributor

Perhaps load_dataset(api) ?

Maybe load_data(api)? Since api contains actually 5 datasets (apiclus1, apiclus2, apistrat, apipop and apisrs) it would make more sense to call it load_datasets(api) in this case. But it would be better to have a more general name so I prefer load_data.

@chiraganand
Copy link
Member

IMHO, load_data() is concise yet descriptive. It follows the general "function names should be verbs" methodology which makes it more clear to the end user of the function's intentions.

@greimel greimel mentioned this issue Aug 3, 2022
@greimel greimel changed the title Rename data to dataset Rename data to load_data and improve it Aug 3, 2022
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

Successfully merging a pull request may close this issue.

4 participants