NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
44 stars 19 forks source link

Added CmpMsg to python interface #565

Closed rmclaren closed 7 months ago

rmclaren commented 7 months ago

Expose the cmpmsg function via the python interface so you can cause written data to be compressed.

Fixes https://github.com/NOAA-EMC/NCEPLIBS-bufr/issues/562

jbathegit commented 7 months ago

@rmclaren did you test this out and confirm it works like you expected?

The reason I'm asking is b/c of your line return _bufrlib.cmpmsg(cmp) Specifically, cmpmsg is a subroutine, not a function. Therefore, it has no return value, so what exactly would you be "returning" from within the corresponding python binding?

jbathegit commented 7 months ago

@rmclaren do you still want this hook into cmpmsg() added to the Python interface? If so, it has no return value, so it needs to be called as a subroutine instead of as a function.

Let me know if you still want this feature, and I can push up another commit to get this detail fixed and then merge it.

rmclaren commented 7 months ago

@jbathegit I don't really "need" it, it was just a nice to have for a one-off script I was writing... I made the change you requested, but it doesn't really change anything. Any python function will implicitly return None (void) whether explicitly call return or not.