nmatrix
nmatrix copied to clipboard
Fast CSV interface for nmatrix
We could use something like fastest-csv and load data directly from the C interface, no ruby involved. That should be real fast.
Or maybe even use libcsv.
I think that'd be awesome.
@v0dro What do we want in this issue ? Means should I try to write a wrapper for libcsv to work with nmatrix or, should I implement a CSV reader for nmatrix itself.
I'd prefer libcsv. No point in reinventing the wheel.
Keep in mind that there should be no conversion to Ruby data types after the CSV has been read. Everything should stay in C and be accessible from Ruby once it has been loaded into nmatrix.
You might want to consider making a plugin nmatrix-csv so that a libcsv dependency is not imposed on nmatrix. @mohawkjohn thoughts?
I agree. It'd be better not to introduce an additional dependency. Perhaps there could be a pure Ruby csv reader as well for it to fall back on.
Here's where such a thing would go: https://github.com/SciRuby/nmatrix/tree/master/lib/nmatrix/io
Is this being worked upon ? I'd like to write a ruby wrapper.
I don't believe so.
Have a look at this: https://github.com/wiseio/paratext
I think its the fastest CSV reader around and having a wrapper over that would be awesome :dancing_women: