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

WIP: New CSV parser #1287

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

marty1885
Copy link
Contributor

See #1280.

@SylvainCorlay
Copy link
Member

Thanks for this work @marty1885! We will be reviewing this tomorrow!

@@ -31,6 +33,9 @@ namespace xt
template <class T, class A = std::allocator<T>>
xcsv_tensor<T, A> load_csv(std::istream& stream);

template <class T, class A = std::allocator<T>>
xcsv_tensor<T, A> read_csv(std::istream& stream);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the same method name and dispatch according to a TAG or enum, something like:

enum class csv_mode
{
    fast,
    strict
};
template <class T, class A = std::allocator<T>>
xcsv_tensor<T, A> load_csv(std::istream& stream, csv_mode mode = csv_mode::fast)
{
    // Calls the implementation method accoriding to the value of csv_mode
}

@JohanMabille
Copy link
Member

Hi @marty1885 ,

Sorry for the late review. The implementation of the parser itself looks good to me (maybe we could simplify it with std::regex but I'm not sure and this is something I don't master yet), my only remark is about the API.

@marty1885
Copy link
Contributor Author

@JohanMabille Thanks. I'll change that. My main concern is in my latest comment #1280 . May you check it out?

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

Successfully merging this pull request may close these issues.

4 participants