question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Providing Public Cython API within NumPy

See original GitHub issue

Would it make sense for NumPy to provide numpy.pxd and numpy/math.pxd (currently included in Cython)?

Given NumPy already ships SWIG bindings, providing Cython bindings seems reasonable and is not too different in concept. Plus there are already internal consumers of Cython bindings, which would likely benefit from having access to a single public API. Would add that other projects like SciPy have been adding a fair number of things in *.pxd files included in their public API making this a bit of a trend. This would certainly help build a framework for NumPy to expose other things in the public API. Finally would note that having the Cython bindings live in Cython complicates the process of keeping them up-to-date as they must provide support for various versions of NumPy, which should hopefully be less of a problem if Cython bindings were included in NumPy’s public API.

Thoughts on this would be welcome. 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rgommerscommented, Aug 23, 2018

Makes sense I think. The Cython wrappers in SciPy have been popular and unproblematic.

0reactions
jakirkhamcommented, Oct 16, 2018

This came up again recently in regards to whether certain NumPy functions require the GIL and whether that is reflected correctly in the Cython API. ( https://github.com/cython/cython/issues/2663 )

Side note: Some questions were raised regarding documentation of GIL use in NumPy’s C API as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Public Cython APIs — SciPy v1.9.3 Manual
This uses Cython's declaration sharing features, where shared cdef items are declared in *.pxd files that are distributed together with the corresponding DLL/SO ......
Read more >
Array of pointers from C++ to NumPy through Cython
I have a library in c++ and I'm trying to wrap it for python using Cython. One function returns an array of 3D...
Read more >
Extension Types — Cython 3.0.0a11 documentation
An extern extension type allows you to gain access to the internals of Python objects defined in the Python core or in a...
Read more >
Cython: Speed up Python and NumPy, Pythonize C ... - YouTube
Have programmed in at least one of C, C++, or Fortran. Some familiarity with the Python or NumPy C- API a plus. Familiarity...
Read more >
Array API — NumPy v1.25.dev0 Manual
For a successful technology, reality must take precedence over public ... These functions and macros provide easy access to elements of the ndarray...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found