python-blosc icon indicating copy to clipboard operation
python-blosc copied to clipboard

Question about API design

Open esc opened this issue 6 years ago • 4 comments

With c-blosc v1.16.0 three new functions arrived:

blosc_decompress_unsafe()                                                                                                                                                                               
blosc_decompress_ctx_unsafe()                                                                                                                                                                           
blosc_getitem_unsafe() 
blosc_cbuffer_validate()

I would like to build support for the unsafe versions of the decompress and getitem functions and I was wondering what the community might prefer in terms of API. Currently I see two options:

  • Adding aptly named functions to the Python API, like decompress_unsafe and decompress_ptr_unsafe.
  • Adding a keyword argument unsafe=False

What would you prefer? @FrancescAlted

esc avatar Feb 02 '19 22:02 esc

After some more thought, it seems like, adding a keyword might be easier to implement than adding new functions.

esc avatar Feb 07 '19 21:02 esc

Yes, I agree that the keyword approach sounds sensible. What about safe=True instead of unsafe=False? (double negation always takes a few more brain cycles to process ;)

FrancescAlted avatar Feb 08 '19 08:02 FrancescAlted

O.K. for the time being, only unsafe decompression will be supported. It seems like python-blosc doesn't yet have support for getitem so that would have to be implemented first.

esc avatar Feb 09 '19 11:02 esc

cbuffer_validate was merged with #186 and the unsafe decompression is implemented in #191

esc avatar Feb 16 '19 14:02 esc

I think this has been done long time ago, so closing.

FrancescAlted avatar Dec 07 '22 17:12 FrancescAlted