Tuesday, December 2, 2014

Sphinx + Cython

It's pretty awesome that Sphinx will work with Cython code files (.pyx) but there are currently a few wrinkles:
  1. You need to rerun the cython compiler before the documentation changes take since sphinx reads this off the compiled library
  2. Function signatures are omitted in the documentation and the compiler directive # cython: embedsignature=True does not work either. The workaround is to repeat the signature as the first line of the docstring
def merge_variants(c1, c2):
  merge_variants(c1, c2)
  ... rest of docstring ...

No comments:

Post a Comment