Skip to content

Commit

Permalink
Merge pull request #67 from GiacomoPope/refactor-functions
Browse files Browse the repository at this point in the history
Refactor functions into submodule
  • Loading branch information
oscarbenjamin authored Sep 7, 2023
2 parents 24267a5 + e5ab6f4 commit 68249c8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
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"

0 comments on commit 68249c8

Please sign in to comment.