Skip to content

Commit 14241cd

Browse files
committed
Add README to flintlib about auto-generated files
1 parent 2a3dd11 commit 14241cd

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/flint/flintlib/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Cython declarations for functions exported by libflint
2+
======================================================
3+
4+
This directory contains Cython declarations for functions exported by libflint.
5+
The declarations under the `types` directory are for the types defined in
6+
libflint and are hand-written. The declarations under the `functions` directory
7+
are for the functions defined in libflint and are generated by running:
8+
```console
9+
$ bin/all_rst_to_pxd.sh /path/to/flint/doc/source
10+
```
11+
where `/path/to/flint/doc/source` is the path to the source directory of the
12+
flint documentation. This command should always be run on the FLINT docs of the
13+
version of FLINT that is used by default in python-flint's wheels which is the
14+
version shown in the `bin/build_variables.sh` script. Typically this just means
15+
the latest released version of FLINT.
16+
17+
It is important not to edit any of the files in `functions` manually because a
18+
subsequent run of `bin/all_rst_to_pxd.sh` will overwrite them. There are
19+
several reasons why manual editing may be needed but usually it is because
20+
either:
21+
22+
1. The function is not documented in the FLINT docs.
23+
2. The function is a macro and not a function.
24+
25+
In either case, we need to manually write the declaration for the function but
26+
it cannot be done in the `functions` directory. Instead, it should be added
27+
somewhere in the `types` directory.
28+
29+
Generally undocumented functions should be reported/fixed upstream in FLINT.
30+
31+
It might be better to list macros (and undocumented functions) in the
32+
`bin/rst_to_pxd.py` script so that it can add them to the generated files
33+
automatically. Then we can keep them out of the hand-written code but also keep
34+
track of them with a goal of eventually getting all of them added to the FLINT
35+
docs.

0 commit comments

Comments
 (0)