Automatically generate fmpz_*
pxds from FLINT headers
#215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a start towards having fully automatic updating of the flintlib .pxd files.
I have made a few improvements to the
bin/rst_to_pxd.py
script so that it can generate the files fully without editing by commenting out functions with unrecognised types.I also added a script
bin/all_rst_to_pxd.sh
like:The idea would be for that
modules
list to end up having all of the FLINT modules and generating all of the .pxd files.The script only extracts functions from the docs but not structs or macros. I moved one macro to
flint.pxd
but otherwise I factored out the structs from these files into aflint_types.pxd
. The structs still need to be edited manually but we should organise them according to the way they are in the flint headers:I checked the structs against the FLINT code and updating some things like
long -> slong
ormp_limb -> ulong
.There was one function missing from the docs
fmpz_factor_expand
which I manually added toflint_types.pxd
.Running the script like this has also update the types and names in a bunch of function definitions.
We should do this for all of the auto-generated files so that they can be kept up to date in a single command and then we can just add the entire lot in one go.
See also #54 which discusses auto-generating cython bindings for every Flint function.