-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mod experiment #65
Mod experiment #65
Conversation
Made fmpz into its own module (which depends on the other code which depends on it). Hopefully this tedious approach works.
Also got rid of the pyflint/_flint twist. I'm not sure how it worked, but Things should be straightforward from now on.
This was straightforward. (The acb doctests are hosed though)
slowly but surely we are advancing
For unknown reasons fmpz_mat and fmpq_mat were not being imported into the doctest environment.
Added fmpq.pxd and rerouted imports
All the tests work. The doctests run are diminishing for now
nmod_series is just a stub
The light at the end of the tunnel appears
Although this change sounds trivial, and mostly is, it involves changing the module names so that they do not conflict with the names or the enclosed classes, thereby managing to touch almost everything. The other minor change is importing newly separated modules into the doctests that need them.
getting close
This took a lot of adding showgood into to doctests. Not sure how to do it better.
Also changed FMPZ_ENUM etc to be an enum, and deleted bunches of commented dead code.
This should have gone in the last commit.
About 1/3 done
Going to commit after each include because cython is getting weird (or I'm going insane).
All that is left are the structures, but moving them makes things strange
Is this also a more complete listing of the C functions exposed by the FLINT headers? |
So the src layout here is: $ tree -v --filesfirst src
src
└── flint
├── __init__.py
├── _flint.pxd
├── functions.pyx
├── pyflint.pxd
├── pyflint.pyx
├── flint_base
│ ├── __init__.py
│ ├── flint_base.pxd
│ ├── flint_base.pyx
│ ├── flint_context.pxd
│ └── flint_context.pyx
├── flintlib
│ ├── __init__.pxd
│ ├── __init__.py
│ ├── acb.pxd
│ ├── acb_calc.pxd
│ ├── acb_dft.pxd
│ ├── acb_dirichlet.pxd
│ ├── acb_elliptic.pxd
│ ├── acb_hypgeom.pxd
│ ├── acb_mat.pxd
│ ├── acb_modular.pxd
│ ├── acb_poly.pxd
│ ├── arb.pxd
│ ├── arb_fmpz_poly.pxd
│ ├── arb_hypgeom.pxd
│ ├── arb_mat.pxd
│ ├── arb_poly.pxd
│ ├── arf.pxd
│ ├── arith.pxd
│ ├── bernoulli.pxd
│ ├── dirichlet.pxd
│ ├── fmpq.pxd
│ ├── fmpq_mat.pxd
│ ├── fmpq_poly.pxd
│ ├── fmpz.pxd
│ ├── fmpz_factor.pxd
│ ├── fmpz_lll.pxd
│ ├── fmpz_mat.pxd
│ ├── fmpz_mpoly.pxd
│ ├── fmpz_poly.pxd
│ ├── fmpz_poly_factor.pxd
│ ├── mag.pxd
│ ├── mpoly.pxd
│ ├── nmod_mat.pxd
│ ├── nmod_poly.pxd
│ ├── nmod_vec.pxd
│ ├── partitions.pxd
│ └── ulong_extras.pxd
├── test
│ ├── __init__.py
│ ├── __main__.py
│ └── test.py
├── types
│ ├── __init__.py
│ ├── acb.pxd
│ ├── acb.pyx
│ ├── acb_mat.pxd
│ ├── acb_mat.pyx
│ ├── acb_poly.pxd
│ ├── acb_poly.pyx
│ ├── acb_series.pxd
│ ├── acb_series.pyx
│ ├── arb.pxd
│ ├── arb.pyx
│ ├── arb_mat.pxd
│ ├── arb_mat.pyx
│ ├── arb_poly.pxd
│ ├── arb_poly.pyx
│ ├── arb_series.pxd
│ ├── arb_series.pyx
│ ├── arf.pxd
│ ├── arf.pyx
│ ├── dirichlet.pxd
│ ├── dirichlet.pyx
│ ├── fmpq.pxd
│ ├── fmpq.pyx
│ ├── fmpq_mat.pxd
│ ├── fmpq_mat.pyx
│ ├── fmpq_poly.pxd
│ ├── fmpq_poly.pyx
│ ├── fmpq_series.pxd
│ ├── fmpq_series.pyx
│ ├── fmpz.pxd
│ ├── fmpz.pyx
│ ├── fmpz_mat.pxd
│ ├── fmpz_mat.pyx
│ ├── fmpz_mpoly.pxd
│ ├── fmpz_mpoly.pyx
│ ├── fmpz_poly.pxd
│ ├── fmpz_poly.pyx
│ ├── fmpz_series.pxd
│ ├── fmpz_series.pyx
│ ├── nmod.pxd
│ ├── nmod.pyx
│ ├── nmod_mat.pxd
│ ├── nmod_mat.pyx
│ ├── nmod_poly.pxd
│ ├── nmod_poly.pyx
│ ├── nmod_series.pxd
│ └── nmod_series.pyx
└── utils
├── __init__.py
├── conversion.pxd
└── typecheck.pxd
6 directories, 100 files After an in-place build ( $ tree -v --filesfirst src
src
└── flint
├── __init__.py
├── _flint.pxd
├── functions.pyx
├── pyflint.c
├── pyflint.cpython-311-x86_64-linux-gnu.so
├── pyflint.pxd
├── pyflint.pyx
├── __pycache__
│ └── __init__.cpython-311.pyc
├── flint_base
│ ├── __init__.py
│ ├── flint_base.c
│ ├── flint_base.cpython-311-x86_64-linux-gnu.so
│ ├── flint_base.pxd
│ ├── flint_base.pyx
│ ├── flint_context.c
│ ├── flint_context.cpython-311-x86_64-linux-gnu.so
│ ├── flint_context.pxd
│ ├── flint_context.pyx
│ └── __pycache__
│ └── __init__.cpython-311.pyc
├── flintlib
│ ├── __init__.pxd
│ ├── __init__.py
│ ├── acb.pxd
│ ├── acb_calc.pxd
│ ├── acb_dft.pxd
│ ├── acb_dirichlet.pxd
│ ├── acb_elliptic.pxd
│ ├── acb_hypgeom.pxd
│ ├── acb_mat.pxd
│ ├── acb_modular.pxd
│ ├── acb_poly.pxd
│ ├── arb.pxd
│ ├── arb_fmpz_poly.pxd
│ ├── arb_hypgeom.pxd
│ ├── arb_mat.pxd
│ ├── arb_poly.pxd
│ ├── arf.pxd
│ ├── arith.pxd
│ ├── bernoulli.pxd
│ ├── dirichlet.pxd
│ ├── fmpq.pxd
│ ├── fmpq_mat.pxd
│ ├── fmpq_poly.pxd
│ ├── fmpz.pxd
│ ├── fmpz_factor.pxd
│ ├── fmpz_lll.pxd
│ ├── fmpz_mat.pxd
│ ├── fmpz_mpoly.pxd
│ ├── fmpz_poly.pxd
│ ├── fmpz_poly_factor.pxd
│ ├── mag.pxd
│ ├── mpoly.pxd
│ ├── nmod_mat.pxd
│ ├── nmod_poly.pxd
│ ├── nmod_vec.pxd
│ ├── partitions.pxd
│ └── ulong_extras.pxd
├── test
│ ├── __init__.py
│ ├── __main__.py
│ ├── test.py
│ └── __pycache__
│ ├── __init__.cpython-311.pyc
│ ├── __main__.cpython-311.pyc
│ └── test.cpython-311.pyc
├── types
│ ├── __init__.py
│ ├── acb.c
│ ├── acb.cpython-311-x86_64-linux-gnu.so
│ ├── acb.pxd
│ ├── acb.pyx
│ ├── acb_mat.c
│ ├── acb_mat.cpython-311-x86_64-linux-gnu.so
│ ├── acb_mat.pxd
│ ├── acb_mat.pyx
│ ├── acb_poly.c
│ ├── acb_poly.cpython-311-x86_64-linux-gnu.so
│ ├── acb_poly.pxd
│ ├── acb_poly.pyx
│ ├── acb_series.c
│ ├── acb_series.cpython-311-x86_64-linux-gnu.so
│ ├── acb_series.pxd
│ ├── acb_series.pyx
│ ├── arb.c
│ ├── arb.cpython-311-x86_64-linux-gnu.so
│ ├── arb.pxd
│ ├── arb.pyx
│ ├── arb_mat.c
│ ├── arb_mat.cpython-311-x86_64-linux-gnu.so
│ ├── arb_mat.pxd
│ ├── arb_mat.pyx
│ ├── arb_poly.c
│ ├── arb_poly.cpython-311-x86_64-linux-gnu.so
│ ├── arb_poly.pxd
│ ├── arb_poly.pyx
│ ├── arb_series.c
│ ├── arb_series.cpython-311-x86_64-linux-gnu.so
│ ├── arb_series.pxd
│ ├── arb_series.pyx
│ ├── arf.c
│ ├── arf.cpython-311-x86_64-linux-gnu.so
│ ├── arf.pxd
│ ├── arf.pyx
│ ├── dirichlet.c
│ ├── dirichlet.cpython-311-x86_64-linux-gnu.so
│ ├── dirichlet.pxd
│ ├── dirichlet.pyx
│ ├── fmpq.c
│ ├── fmpq.cpython-311-x86_64-linux-gnu.so
│ ├── fmpq.pxd
│ ├── fmpq.pyx
│ ├── fmpq_mat.c
│ ├── fmpq_mat.cpython-311-x86_64-linux-gnu.so
│ ├── fmpq_mat.pxd
│ ├── fmpq_mat.pyx
│ ├── fmpq_poly.c
│ ├── fmpq_poly.cpython-311-x86_64-linux-gnu.so
│ ├── fmpq_poly.pxd
│ ├── fmpq_poly.pyx
│ ├── fmpq_series.c
│ ├── fmpq_series.cpython-311-x86_64-linux-gnu.so
│ ├── fmpq_series.pxd
│ ├── fmpq_series.pyx
│ ├── fmpz.c
│ ├── fmpz.cpython-311-x86_64-linux-gnu.so
│ ├── fmpz.pxd
│ ├── fmpz.pyx
│ ├── fmpz_mat.c
│ ├── fmpz_mat.cpython-311-x86_64-linux-gnu.so
│ ├── fmpz_mat.pxd
│ ├── fmpz_mat.pyx
│ ├── fmpz_mpoly.c
│ ├── fmpz_mpoly.cpython-311-x86_64-linux-gnu.so
│ ├── fmpz_mpoly.pxd
│ ├── fmpz_mpoly.pyx
│ ├── fmpz_poly.c
│ ├── fmpz_poly.cpython-311-x86_64-linux-gnu.so
│ ├── fmpz_poly.pxd
│ ├── fmpz_poly.pyx
│ ├── fmpz_series.c
│ ├── fmpz_series.cpython-311-x86_64-linux-gnu.so
│ ├── fmpz_series.pxd
│ ├── fmpz_series.pyx
│ ├── nmod.c
│ ├── nmod.cpython-311-x86_64-linux-gnu.so
│ ├── nmod.pxd
│ ├── nmod.pyx
│ ├── nmod_mat.c
│ ├── nmod_mat.cpython-311-x86_64-linux-gnu.so
│ ├── nmod_mat.pxd
│ ├── nmod_mat.pyx
│ ├── nmod_poly.c
│ ├── nmod_poly.cpython-311-x86_64-linux-gnu.so
│ ├── nmod_poly.pxd
│ ├── nmod_poly.pyx
│ ├── nmod_series.c
│ ├── nmod_series.cpython-311-x86_64-linux-gnu.so
│ ├── nmod_series.pxd
│ ├── nmod_series.pyx
│ └── __pycache__
│ └── __init__.cpython-311.pyc
└── utils
├── __init__.py
├── conversion.pxd
└── typecheck.pxd
10 directories, 158 files So we now have 26 extension modules instead of previously one (or actually two or three already since previous changes):
The total size of the src directory is 43M but that also includes .c files: $ du -sh src
43M src Total size of .so files is 21MB: $ du -c `find src -name '*.so'`
908 src/flint/flint_base/flint_base.cpython-311-x86_64-linux-gnu.so
480 src/flint/flint_base/flint_context.cpython-311-x86_64-linux-gnu.so
660 src/flint/types/fmpz_series.cpython-311-x86_64-linux-gnu.so
684 src/flint/types/fmpz_poly.cpython-311-x86_64-linux-gnu.so
644 src/flint/types/fmpq.cpython-311-x86_64-linux-gnu.so
680 src/flint/types/fmpq_poly.cpython-311-x86_64-linux-gnu.so
788 src/flint/types/fmpz.cpython-311-x86_64-linux-gnu.so
720 src/flint/types/fmpq_series.cpython-311-x86_64-linux-gnu.so
1208 src/flint/types/arb_series.cpython-311-x86_64-linux-gnu.so
736 src/flint/types/fmpz_mat.cpython-311-x86_64-linux-gnu.so
2028 src/flint/types/arb.cpython-311-x86_64-linux-gnu.so
896 src/flint/types/fmpz_mpoly.cpython-311-x86_64-linux-gnu.so
472 src/flint/types/arf.cpython-311-x86_64-linux-gnu.so
248 src/flint/types/nmod_series.cpython-311-x86_64-linux-gnu.so
1036 src/flint/types/acb_series.cpython-311-x86_64-linux-gnu.so
820 src/flint/types/arb_mat.cpython-311-x86_64-linux-gnu.so
696 src/flint/types/nmod_mat.cpython-311-x86_64-linux-gnu.so
696 src/flint/types/arb_poly.cpython-311-x86_64-linux-gnu.so
732 src/flint/types/acb_poly.cpython-311-x86_64-linux-gnu.so
856 src/flint/types/acb_mat.cpython-311-x86_64-linux-gnu.so
2336 src/flint/types/acb.cpython-311-x86_64-linux-gnu.so
432 src/flint/types/dirichlet.cpython-311-x86_64-linux-gnu.so
352 src/flint/types/nmod.cpython-311-x86_64-linux-gnu.so
680 src/flint/types/fmpq_mat.cpython-311-x86_64-linux-gnu.so
652 src/flint/types/nmod_poly.cpython-311-x86_64-linux-gnu.so
644 src/flint/pyflint.cpython-311-x86_64-linux-gnu.so
21084 total |
Total time for a full build from scratch seems about the same. An incremental rebuild for a single module is much faster though: $ touch src/flint/types/fmpz.pyx
$ time bin/build_inplace.sh
...
Compiling src/flint/types/fmpz.pyx because it changed.
[1/1] Cythonizing src/flint/types/fmpz.pyx
...
real 0m11.716s
user 0m10.843s
sys 0m1.015s That's 10 seconds rather than a few minutes previously which is much more manageable for development. |
With meson I guess it would be easier to parallelise the build now since it is many smaller modules. |
Total size of all wheels is now 159MB vs 142MB previously. $ du -h old/*
142M old/artifact.zip
6.4M old/python_flint-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl
32M old/python_flint-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
9.5M old/python_flint-0.4.2-cp310-cp310-win_amd64.whl
6.4M old/python_flint-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl
32M old/python_flint-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
9.5M old/python_flint-0.4.2-cp311-cp311-win_amd64.whl
6.4M old/python_flint-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
32M old/python_flint-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
9.5M old/python_flint-0.4.2-cp39-cp39-win_amd64.whl
1.2M old/python-flint-0.4.2.tar.gz
$ du -h new/*
159M new/artifact.zip
6.8M new/python_flint-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl
34M new/python_flint-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
12M new/python_flint-0.4.2-cp310-cp310-win_amd64.whl
6.8M new/python_flint-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl
35M new/python_flint-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
12M new/python_flint-0.4.2-cp311-cp311-win_amd64.whl
6.8M new/python_flint-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
34M new/python_flint-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
12M new/python_flint-0.4.2-cp39-cp39-win_amd64.whl
2.5M new/python-flint-0.4.2.tar.gz Most wheels are about 5-10% bigger. Looks like the sdist doubled in size. I guess that is because it includes all of the C code:
Actually the sdist does not have any of the Cython code. I guess in principle this should mean that it can build without Cython. Probably it would be better though for the sdist to include the Cython files and just depend on Cython as a build-time dependency. |
Installing the CI built wheel I run python and check the memory usage:
That's 5.8MB according to the system monitor. Then
It goes up to 6.9MB I'm not really sure how all these many megabytes of .so files only amount to 1.1MB of memory at runtime. Previously importing flint would add about 0.8MB but with the changes here it is about 1.1MB. I think that is fine: I just wanted to check that it would not grow massively. |
All tests are passing in CI and locally. I tried both local build and also downloading the CI built wheels. |
The installed files (from the CI build wheel look like: $ tree venv/lib/python3.11/site-packages/flint/
venv/lib/python3.11/site-packages/flint/
├── flint_base
│ ├── flint_base.cpython-311-x86_64-linux-gnu.so
│ └── flint_context.cpython-311-x86_64-linux-gnu.so
├── __init__.py
├── __pycache__
│ └── __init__.cpython-311.pyc
├── pyflint.cpython-311-x86_64-linux-gnu.so
├── test
│ ├── __init__.py
│ ├── __main__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-311.pyc
│ │ ├── __main__.cpython-311.pyc
│ │ └── test.cpython-311.pyc
│ └── test.py
└── types
├── acb.cpython-311-x86_64-linux-gnu.so
├── acb_mat.cpython-311-x86_64-linux-gnu.so
├── acb_poly.cpython-311-x86_64-linux-gnu.so
├── acb_series.cpython-311-x86_64-linux-gnu.so
├── arb.cpython-311-x86_64-linux-gnu.so
├── arb_mat.cpython-311-x86_64-linux-gnu.so
├── arb_poly.cpython-311-x86_64-linux-gnu.so
├── arb_series.cpython-311-x86_64-linux-gnu.so
├── arf.cpython-311-x86_64-linux-gnu.so
├── dirichlet.cpython-311-x86_64-linux-gnu.so
├── fmpq.cpython-311-x86_64-linux-gnu.so
├── fmpq_mat.cpython-311-x86_64-linux-gnu.so
├── fmpq_poly.cpython-311-x86_64-linux-gnu.so
├── fmpq_series.cpython-311-x86_64-linux-gnu.so
├── fmpz.cpython-311-x86_64-linux-gnu.so
├── fmpz_mat.cpython-311-x86_64-linux-gnu.so
├── fmpz_mpoly.cpython-311-x86_64-linux-gnu.so
├── fmpz_poly.cpython-311-x86_64-linux-gnu.so
├── fmpz_series.cpython-311-x86_64-linux-gnu.so
├── nmod.cpython-311-x86_64-linux-gnu.so
├── nmod_mat.cpython-311-x86_64-linux-gnu.so
├── nmod_poly.cpython-311-x86_64-linux-gnu.so
└── nmod_series.cpython-311-x86_64-linux-gnu.so
5 directories, 34 files That takes 31MB. Also: $ tree venv/lib/python3.11/site-packages/python_flint.libs/
venv/lib/python3.11/site-packages/python_flint.libs/
├── libarb-4c2cc9a4.so.2.14.0
├── libflint-c1ff2639.so.17.0.0
├── libgmp-e0c82b6b.so.10.5.0
└── libmpfr-90ec1309.so.6.1.0
0 directories, 4 files Those are huge:
Is it normal for libflint to be 57MB? Actually my local build is 45MB so I guess so (probably the CI built wheels are larger because of extra bundling or something). I guess when the |
It looks like this change brings a small increase in wheel size and installed disk usage as well as a small increase in runtime memory. Those are all fine I think but still if there is some way to significantly reduce any of those then that would be good. (This is likely an orthogonal point to the PR here though...) Currently the installed disk usage of python-flint is about 120MB with half of that just being |
I'm not sure what you mean by this. I tried this and everything seemed fine: diff --git a/src/flint/_flint.pxd b/src/flint/_flint.pxd
index 09ba307..8806fb5 100644
--- a/src/flint/_flint.pxd
+++ b/src/flint/_flint.pxd
@@ -70,7 +70,6 @@ cdef extern from *:
"""
slong pylong_as_slong(PyObject *pylong, int *overflow)
-from flint.flintlib.nmod_vec cimport nmod_t
from flint.flintlib.nmod_poly cimport nmod_poly_t
from flint.flintlib.nmod_mat cimport nmod_mat_t
from flint.flintlib.fmpz cimport fmpz_t
diff --git a/src/flint/types/nmod.pxd b/src/flint/types/nmod.pxd
index 4ece832..0a441fe 100644
--- a/src/flint/types/nmod.pxd
+++ b/src/flint/types/nmod.pxd
@@ -1,6 +1,6 @@
from flint.flint_base.flint_base cimport flint_scalar
from flint._flint cimport mp_limb_t
-from flint._flint cimport nmod_t
+from flint.flintlib.nmod_vec cimport nmod_t
cdef int any_as_nmod(mp_limb_t * val, obj, nmod_t mod) except -1
Btw why is |
Could you try to add this patch and build?
When I do this, I get an error of
Which makes absolutely no sense to me, as the change should have had no effect there. |
I worked through it a bit and saw the same errors. I think that the error is basically just the equivalent of an ImportError. Cython did not find the arb_ptr object in the arb "module" (.pxd file) and so it looked for an arb_ptr.pxd file as if arb was a package. Then it fails and gives this error. I think that the reason it fails is effectively something like a circular import. There are a bunch of different files importing each other and some point we get back to the importing from the same module but the expected name has not been defined yet (or something like that). The solution I went for is just to delete everything from |
The contents of utils does not depend on anything else in python-flint whereas Looking at the contents of |
The main thing to with functions.pyx is just to make it a separate module somewhere rather having it as the final remaining include: python-flint/src/flint/pyflint.pyx Line 16 in 8ad8919
There are various problems with this like it breaks coverage measurement under Cython (see bin/coverage.sh ).
Its code could even just be moved into pyflint.pyx. I'm not sure what we otherwise would want to do with pyflint.pyx after you have removed almost everything from it here. |
Is there any strong reason not to merge this right now? I think it looks good and achieves the main part of #15. This is a huge diff that moves virtually every line in the codebase. If we want it in then I think it is best to merge immediately and make any smaller followup improvements later. |
Maybe one thing before merging is fixing the "functions" file, which also could do with a more descriptive name? I would have suggested to move it into utils, but I see your message above. As far as I can tell the only function which we need to export is
All other functions in |
I think that we can equally do that after merging though. The question is really just whether anything is majorly wrong with this bulk movement of code that we might regret (I don't think there is). Leaving a PR like this open for any length of time is problematic because it is difficult to keep it in sync with any other changes. After this is merged a smaller PR that moves a few functions around is fine.
I think it is only used in doctests so actually there is nowhere in the codebase that uses showgood internally. It could be considered just a function for testing but since it is widely shown in the docs it should probably be thought of as a function for end users. |
I agree with this, it's a good point. Once this is merged I can also start trying to help (deinst did such great work here I thought it best for this to be merged before doing work myself again) |
I don't see any real good reason not to merge it. I have tried to be conscientious about not breaking anything, and if it works merge it. That said, I would not trust my life on the fact that I haven't screwed something up, but if I have we can probably fix it later. |
Exactly. This is a great PR but when something like this is open it sort of blocks other work. Luckily python-flint does not currently have large numbers of open PRs although some like #43 will need updating after.
I'm confident it will be fine and yes we can definitely fix anything later if needed. Usually with something like this the problems are fairly obvious so once it looks like it is working it probably is totally fine. |
Thanks @deinst and @GiacomoPope ! |
Deinst did all the hard work!! I'm really excited to keep working on this repo :) |
Ok This compiles and passes tests on my machine.
Most of the code that interfaces to flint has been separated into
pxd
files in theflintlib
submodule. All that is left in_flint.pxd
is some basic flint and gmp code that will stay in_flint
or wbatever it gets renamed to and a bunch of statements of the formfrom flint.flintlib.foo cimport foo_t
that just reexports interfaces fromflintlib
. These reexports should be easy to replace, but I have had no luck. Everytime I try to replacefrom flint._flint cimport foo_t
withflint.flintlib.foo cimport foo_t
errors pop up in unrelated places.So I would like to know if this works on other machines, and if other people have weird problems. Regardless it is late, 90 degrees F and my brain is dead. I'd like to see if it works on the CI machines. I'd discourage merging it until the weird behavior is understood.
There are a few other things that I know are less than gracefully handled.
I was not sure if
functions.pyx
belongs inutils
ortypes
so I did nothing. Once a decision is made this should be easy to deal with.I left the
ctx
--thectx
in pretty much the same state as it has always been. I tried a bunch or things and could not get consistent behavior between Python and Cython.I made
FMPZ_UNKNOWN
,FMPZ_REF
andFMPZ_TMP
into an anonymous enum. The DEF's do not get exported and I am loath to sprinkle includes in a bunch of files.