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

Better distinction between method arguments in Importers #53

Open
athityakumar opened this issue Aug 31, 2017 · 0 comments
Open

Better distinction between method arguments in Importers #53

athityakumar opened this issue Aug 31, 2017 · 0 comments

Comments

@athityakumar
Copy link
Member

Suggested by @zverok in PR #52

Currently, owing to the restriction due to automatic monkey-patching of daru-io modules into daru, the Importers are designed like this.

#! Usage from daru
df = Daru::DataFrame.read_csv(path, col_sep: ' ', other_opts)

#! is linked to daru-io like
inst = Daru::IO::Importers::CSV.read(path)
df = inst.call(col_sep: ' ', other_opts)

But, daru-io could use better set of arguments for methods, to ensure that a file is read only ONCE, and then called for dataframe with other options.

df = Daru::DataFrame.read_csv(path, col_sep: ' ', other_opts)

#! should rather be linked to daru-io like
inst = Daru::IO::Importers::CSV.read(path, col_sep: ' ')
df = inst.call(other_opts)

In general, all file parsing arguments and path should be provided in the read method, while post-reading arguments can be provided in call method.

@athityakumar athityakumar changed the title Better distinction between methods in Importers Better distinction between method arguments in Importers Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant