Skip to content
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

Refactor functions into submodule #67

Merged
merged 12 commits into from
Sep 7, 2023
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
'flint.flintlib',
'flint.flint_base',
'flint.types',
'flint.functions',
'flint.utils',
'flint.test',
]
Expand Down Expand Up @@ -102,6 +103,8 @@
("flint.types.dirichlet", ["src/flint/types/dirichlet.pyx"]),
("flint.flint_base.flint_base", ["src/flint/flint_base/flint_base.pyx"]),
("flint.flint_base.flint_context", ["src/flint/flint_base/flint_context.pyx"]),
# Helper for unittests
("flint.functions.showgood", ["src/flint/functions/showgood.pyx"]),

]

Expand Down
1 change: 1 addition & 0 deletions src/flint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
from .types.acb_mat import *
from .types.acb_series import *
from .types.fmpz_mpoly import *
from .functions.showgood import showgood

__version__ = '0.4.4'
Empty file added src/flint/functions/__init__.py
Empty file.
4 changes: 3 additions & 1 deletion src/flint/functions.pyx → src/flint/functions/showgood.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .utils.conversion cimport dps_to_prec
from flint.flint_base.flint_context cimport thectx
from flint.utils.conversion cimport dps_to_prec
from flint.types.arb_mat cimport arb_mat
from flint.types.acb_mat cimport acb_mat
from flint.types.arb_poly cimport arb_poly
Expand All @@ -10,6 +11,7 @@ from flint.types.acb_series cimport acb_series
from flint.flintlib.arb cimport *
from flint.flintlib.acb cimport *

ctx = thectx

# xxx: this doesn't work when changed to a cdef function. why?
def __goodness(x, bint parts=True, metric=None):
Expand Down
2 changes: 0 additions & 2 deletions src/flint/pyflint.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ cdef flint_rand_t global_random_state
flint_randinit(global_random_state)

ctx = thectx

include "functions.pyx"