simonrw / rust-fitsio

FFI wrapper around cfitsio in Rust
Apache License 2.0
36 stars 13 forks source link

Added `write_key_cmt` method to include comments with keys. #307

Closed sunipkm closed 2 months ago

sunipkm commented 5 months ago

I have added a function write_key_cmt to allow the addition of comments along with the key.

sunipkm commented 2 months ago

The only issue I see with 1 or 2 is that it’s going to be API breaking, which is something I wanted to avoid. I do agree that my implementation is very C-like. I do like the idea of a generic trait, that’s more Rust-like. I will give this a bit more thought.

I agree that we should be able to read the comments as well.

Will you ever consider a pure Rust implementation of FITSIO?

simonrw commented 2 months ago

The only issue I see with 1 or 2 is that it’s going to be API breaking, which is something I wanted to avoid. I do agree that my implementation is very C-like. I do like the idea of a generic trait, that’s more Rust-like. I will give this a bit more thought.

I will have a bit of an experiment as well and get back to you.

I agree that we should be able to read the comments as well.

👍

Will you ever consider a pure Rust implementation of FITSIO?

I think there are a few already, e.g. https://github.com/cds-astro/fitsrs, https://docs.rs/fits-rs/latest/fits_rs/, https://github.com/malikolivier/fitrs. I also had the thought myself, as the file format has a reasonable spec, however never got particularly far with the implementation.

simonrw commented 2 months ago

I've drafted my new API design in https://github.com/simonrw/rust-fitsio/pull/332, let me know what you think. Particularly the updates to the full example, which show how to use this new API.

simonrw commented 2 months ago

Thanks for this contribution, but as discussed We are going with the implementation from #332