Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor g2clib Cython #156

Open
EricEngle-NOAA opened this issue Aug 9, 2024 · 0 comments
Open

Refactor g2clib Cython #156

EricEngle-NOAA opened this issue Aug 9, 2024 · 0 comments
Assignees
Labels
clean up Code and Documentation Clean Up

Comments

@EricEngle-NOAA
Copy link
Collaborator

The majority of g2clib.pyx has remained untouched from the time of pygrib/ncepgrib2 which then Cython was at version 0.2x. Since then, Cython is now at 3.0. When building grib2io, Cython produces the following dialog.

Just a snippet...

src/ext/g2clib.c:3224:10: warning: 'PyObject_AsWriteBuffer' is deprecated [-Wdeprecated-declarations]
  (void)(PyObject_AsWriteBuffer(__pyx_v_a, (&__pyx_v_abuf), (&__pyx_v_buflen)));
         ^
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/abstract.h:353:1: note: 'PyObject_AsWriteBuffer' has been explicitly marked deprecated here
Py_DEPRECATED(3.0)
^
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/pyport.h:336:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
src/ext/g2clib.c:5601:10: warning: 'PyObject_AsReadBuffer' is deprecated [-Wdeprecated-declarations]
  (void)(PyObject_AsReadBuffer(__pyx_v_drtmpl, (&__pyx_v_drtmpldat), (&__pyx_v_buflen)));
         ^
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/abstract.h:342:1: note: 'PyObject_AsReadBuffer' has been explicitly marked deprecated here
Py_DEPRECATED(3.0)
^
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/pyport.h:336:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
src/ext/g2clib.c:5601:48: warning: passing 'void **' to parameter of type 'const void **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
  (void)(PyObject_AsReadBuffer(__pyx_v_drtmpl, (&__pyx_v_drtmpldat), (&__pyx_v_buflen)));
                                               ^~~~~~~~~~~~~~~~~~~~
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/abstract.h:344:52: note: passing argument to parameter 'buffer' here
                                      const void **buffer,
                                                   ^
src/ext/g2clib.c:5610:10: warning: 'PyObject_AsReadBuffer' is deprecated [-Wdeprecated-declarations]
  (void)(PyObject_AsReadBuffer(__pyx_v_gdtmpl, (&__pyx_v_gdtmpldat), (&__pyx_v_buflen)));
         ^
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/abstract.h:342:1: note: 'PyObject_AsReadBuffer' has been explicitly marked deprecated here
Py_DEPRECATED(3.0)
^
/Users/ericengle/.pyenv/versions/3.11.9/include/python3.11/pyport.h:336:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))

There is a lot of syntax that has been mark a deprecated.

So we need to clean this up. I'd like to think we could possibly see a performance boost too.

@EricEngle-NOAA EricEngle-NOAA added the clean up Code and Documentation Clean Up label Aug 9, 2024
@EricEngle-NOAA EricEngle-NOAA added this to the grib2io v2.4.0 milestone Aug 9, 2024
@EricEngle-NOAA EricEngle-NOAA self-assigned this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up Code and Documentation Clean Up
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant