Skip to content

Commit 68249c8

Browse files
Merge pull request #67 from GiacomoPope/refactor-functions
Refactor functions into submodule
2 parents 24267a5 + e5ab6f4 commit 68249c8

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
'flint.flintlib',
6969
'flint.flint_base',
7070
'flint.types',
71+
'flint.functions',
7172
'flint.utils',
7273
'flint.test',
7374
]
@@ -102,6 +103,8 @@
102103
("flint.types.dirichlet", ["src/flint/types/dirichlet.pyx"]),
103104
("flint.flint_base.flint_base", ["src/flint/flint_base/flint_base.pyx"]),
104105
("flint.flint_base.flint_context", ["src/flint/flint_base/flint_context.pyx"]),
106+
# Helper for unittests
107+
("flint.functions.showgood", ["src/flint/functions/showgood.pyx"]),
105108

106109
]
107110

src/flint/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
from .types.acb_mat import *
2222
from .types.acb_series import *
2323
from .types.fmpz_mpoly import *
24+
from .functions.showgood import showgood
2425

2526
__version__ = '0.4.4'

src/flint/functions/__init__.py

Whitespace-only changes.

src/flint/functions.pyx src/flint/functions/showgood.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from .utils.conversion cimport dps_to_prec
1+
from flint.flint_base.flint_context cimport thectx
2+
from flint.utils.conversion cimport dps_to_prec
23
from flint.types.arb_mat cimport arb_mat
34
from flint.types.acb_mat cimport acb_mat
45
from flint.types.arb_poly cimport arb_poly
@@ -10,6 +11,7 @@ from flint.types.acb_series cimport acb_series
1011
from flint.flintlib.arb cimport *
1112
from flint.flintlib.acb cimport *
1213

14+
ctx = thectx
1315

1416
# xxx: this doesn't work when changed to a cdef function. why?
1517
def __goodness(x, bint parts=True, metric=None):

src/flint/pyflint.pyx

-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ cdef flint_rand_t global_random_state
1212
flint_randinit(global_random_state)
1313

1414
ctx = thectx
15-
16-
include "functions.pyx"

0 commit comments

Comments
 (0)