julienbt / netcdf3

A pure Rust library for reading and writing NetCDF-3 files
Apache License 2.0
1 stars 1 forks source link

Seek/Read/Write traits for reading/writing data #2

Open devrosch opened 9 months ago

devrosch commented 9 months ago

Hi @julienbt,

This is a very neat library! Thanks to being pure Rust it could potentially work for many different environments/targets. I see one caveat though: FileReader and FileWriter currently expect to receive a path as argument. This limits the targets to those that have a filesystem, excluding e.g. wasm32-unknown-unknown. It also does not allow users of the library to introduce buffering, e.g. with a BufReader.

Would you consider reviewing a PR for accepting Seek/Read/Write traits for reading/writing data? There is a PoC for reading at https://github.com/devrosch/netcdf3. This could also help with issue https://github.com/julienbt/netcdf3/issues/1. I would be willing to spend a bit more time on this if it has a chance of getting merged here.

julienbt commented 9 months ago

Hello @devrosch,

Thank you for your interest in the library.

Indeed, it could be very interesting to use the library on platforms such as wasm32-unknown-unknown, which is one of my potential future projects.

I think that your for reading is a good start.

Apologies for my lack of responsiveness. I will have more time in the coming weeks (during the Christmas holidays) to work on the various issues.

devrosch commented 7 months ago

Hi @julienbt,

Sorry, it's taken me a while to pick this up again. Just opened a PR. It'd be great if you could take a look and let me know if this is something you would want to include.

devrosch commented 4 months ago

@julienbt, any thoughts on this?