Skip to content

Decide on policy for writing and interfacing with C code #8036

@astrofrog

Description

@astrofrog

Note: there is a complementary discussion on astropy-dev from a few months ago.

At the moment, there are several different ways in which we use C code in the core package - almost as many ways as extensions.

  • astropy._erfa uses the new Numpy gufunc interface
  • astropy.convolution uses ctypes
  • astropy.cosmology and astropy.stats.lombscargle have a pure Cython extension
  • astropy.io.ascii uses Cython which also wraps some pure C code
  • astropy.io.fits and astropy.wcs use the Numpy C API
  • astropy.io.votable uses the pure Python C API

I think having so many different ways is detrimental to maintainability, because understanding how one of these interfacing mechanisms works is not trivial, so understanding all of these is very difficult for anyone.

Of course, there are different reasons why one might want to use different approaches, and that's valid, but I think we should try and figure out what a minimal set might look like, write up some guidelines about it, and then update any extensions that need updating. This is probably a topic for the december coordination meeting.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions