Skip to content

Commit b174bb2

Browse files
Merge branch 'master' into pr_lerch_phi
2 parents 19c5f0d + feb0508 commit b174bb2

35 files changed

Lines changed: 3454 additions & 480 deletions

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ CHANGELOG
132132
-------------
133133

134134
Next release:
135+
135136
- [gh-161](https://github.com/flintlib/python-flint/pull/161)
136137
Add `acb.lerch_phi` to compute the Lerch transcendent.
138+
- [gh-132](https://github.com/flintlib/python-flint/pull/132)
139+
Add `fmpz_mpoly` and `fmpq_mpoly` types for multivariate polynomials with
140+
integer or rational coefficients.
137141
- [gh-160](https://github.com/flintlib/python-flint/pull/160)
138142
Add `bits` to `arb` and `acb`, add `log_base` to `arb`.
139143
- [gh-149](https://github.com/flintlib/python-flint/pull/149)
@@ -145,8 +149,8 @@ Next release:
145149
Add `rel_one_ccuracy_bits` to `arb` and `acb`.
146150
- [gh-142](https://github.com/flintlib/python-flint/pull/142)
147151
Add `acb_theta` module for the numerical evaluation of [theta
148-
functions](https://flintlib.org/doc/acb_theta.html) (only available for Flint
149-
>= 3.1).
152+
functions](https://flintlib.org/doc/acb_theta.html) (only available for
153+
`Flint >= 3.1`).
150154
- [gh-137](https://github.com/flintlib/python-flint/pull/137)
151155
Add `erfinv` and `erfcinv` for `arb`.
152156
- [gh-129](https://github.com/flintlib/python-flint/pull/129)

bin/bump_version.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python
2+
3+
filenames_default = [
4+
"pyproject.toml",
5+
"src/flint/__init__.py",
6+
"doc/source/conf.py",
7+
"src/flint/test/test_all.py",
8+
]
9+
10+
def main(version2=None, *filenames):
11+
"""Bump version number in files.
12+
13+
$ bin/bump_version.py
14+
Current version: 0.1.0
15+
16+
$ bin/bump_version.py 0.1.0 0.1.1
17+
Set version 0.1.0 to 0.1.1 in:
18+
pyproject.toml
19+
src/flint/__init__.py
20+
doc/source/conf.py
21+
src/flint/test/test_all.py
22+
23+
"""
24+
with open("pyproject.toml", "r") as f:
25+
text = f.read()
26+
version1 = text.split("version = \"")[1].split("\"")[0]
27+
28+
if not version2:
29+
print(f"Current version: {version1}")
30+
return
31+
32+
if not filenames:
33+
filenames = filenames_default
34+
35+
print(f"Set version {version1} to {version2} in:")
36+
for filename in filenames:
37+
print(filename)
38+
with open(filename, "r") as f:
39+
text = f.read()
40+
with open(filename, "w") as f:
41+
f.write(text.replace(version1, version2))
42+
43+
if __name__ == "__main__":
44+
import sys
45+
main(*sys.argv[1:])

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
# built documents.
5252
#
5353
# The short X.Y version.
54-
version = '0.7.0a2'
54+
version = '0.7.0a3'
5555
# The full version, including alpha/beta/rc tags.
56-
release = '0.7.0a2'
56+
release = '0.7.0a3'
5757

5858
# The language for content autogenerated by Sphinx. Refer to documentation
5959
# for a list of supported languages.

meson.build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ gmp_dep = dependency('gmp')
99
mpfr_dep = dependency('mpfr')
1010
flint_dep = dependency('flint')
1111

12+
add_project_arguments(
13+
'-X', 'embedsignature=True',
14+
'-X', 'emit_code_comments=True',
15+
language : 'cython'
16+
)
17+
18+
if get_option('coverage')
19+
add_project_arguments('-X', 'linetrace=True', language : 'cython')
20+
add_project_arguments('-DCYTHON_TRACE=1', language : 'c')
21+
endif
22+
1223
# Add rpaths for a local build of flint found via pkgconfig
1324
# https://github.com/mesonbuild/meson/issues/13046
1425
if get_option('add_flint_rpath')

meson.options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
option('coverage', type : 'boolean', value : false, description : 'enable coverage build')
12
option('add_flint_rpath', type : 'boolean', value : false)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "mesonpy"
55
[project]
66
name = "python-flint"
77
description = "Bindings for FLINT and Arb"
8-
version = "0.7.0a2"
8+
version = "0.7.0a3"
99
urls = {Homepage = "https://github.com/flintlib/python-flint"}
1010
authors = [
1111
{name = "Fredrik Johansson", email = "fredrik.johansson@gmail.com"},

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@
8181
("flint.flint_base.flint_context", ["src/flint/flint_base/flint_context.pyx"]),
8282

8383
("flint.types.fmpz", ["src/flint/types/fmpz.pyx"]),
84+
("flint.types.fmpz_vec", ["src/flint/types/fmpz_vec.pyx"]),
8485
("flint.types.fmpz_poly", ["src/flint/types/fmpz_poly.pyx"]),
8586
("flint.types.fmpz_mpoly", ["src/flint/types/fmpz_mpoly.pyx"]),
8687
("flint.types.fmpz_mat", ["src/flint/types/fmpz_mat.pyx"]),
8788
("flint.types.fmpz_series", ["src/flint/types/fmpz_series.pyx"]),
8889

8990
("flint.types.fmpq", ["src/flint/types/fmpq.pyx"]),
91+
("flint.types.fmpq_vec", ["src/flint/types/fmpq_vec.pyx"]),
9092
("flint.types.fmpq_poly", ["src/flint/types/fmpq_poly.pyx"]),
9193
("flint.types.fmpq_mat", ["src/flint/types/fmpq_mat.pyx"]),
9294
("flint.types.fmpq_series", ["src/flint/types/fmpq_series.pyx"]),
@@ -100,6 +102,9 @@
100102
("flint.types.fmpz_mod_poly", ["src/flint/types/fmpz_mod_poly.pyx"]),
101103
("flint.types.fmpz_mod_mat", ["src/flint/types/fmpz_mod_mat.pyx"]),
102104

105+
("flint.types.fmpq_mpoly", ["src/flint/types/fmpq_mpoly.pyx"]),
106+
("flint.types.fmpz_mpoly_q", ["src/flint/types/fmpz_mpoly_q.pyx"]),
107+
103108
("flint.types.arf", ["src/flint/types/arf.pyx"]),
104109
("flint.types.arb", ["src/flint/types/arb.pyx"]),
105110
("flint.types.arb_poly", ["src/flint/types/arb_poly.pyx"]),

src/flint/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@
44
from .types.fmpz_poly import *
55
from .types.fmpz_mat import *
66
from .types.fmpz_series import *
7+
from .types.fmpz_vec import fmpz_vec
78

89
from .types.fmpq import *
910
from .types.fmpq_poly import *
1011
from .types.fmpq_mat import *
1112
from .types.fmpq_series import *
13+
from .types.fmpq_vec import fmpq_vec
1214

1315
from .types.nmod import *
1416
from .types.nmod_poly import *
1517
from .types.nmod_mat import *
1618
from .types.nmod_series import *
1719

18-
from .types.fmpz_mpoly import *
20+
from .types.fmpz_mpoly import fmpz_mpoly_ctx, fmpz_mpoly, fmpz_mpoly_vec
1921
from .types.fmpz_mod import *
2022
from .types.fmpz_mod_poly import *
2123
from .types.fmpz_mod_mat import fmpz_mod_mat
2224

25+
from .types.fmpq_mpoly import fmpq_mpoly_ctx, fmpq_mpoly, fmpq_mpoly_vec
26+
2327
from .types.arf import *
2428
from .types.arb import *
2529
from .types.arb_poly import *
@@ -36,6 +40,7 @@
3640
from .flint_base.flint_base import (
3741
FLINT_VERSION as __FLINT_VERSION__,
3842
FLINT_RELEASE as __FLINT_RELEASE__,
43+
Ordering,
3944
)
4045

41-
__version__ = '0.7.0a2'
46+
__version__ = '0.7.0a3'

src/flint/flint_base/flint_base.pxd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from flint.flintlib.mpoly cimport ordering_t
2+
13
cdef class flint_elem:
24
pass
35

@@ -7,6 +9,10 @@ cdef class flint_scalar(flint_elem):
79
cdef class flint_poly(flint_elem):
810
pass
911

12+
cdef class flint_mpoly_context(flint_elem):
13+
cdef public object py_names
14+
cdef const char ** c_names
15+
1016
cdef class flint_mpoly(flint_elem):
1117
pass
1218

@@ -15,3 +21,9 @@ cdef class flint_mat(flint_elem):
1521

1622
cdef class flint_series(flint_elem):
1723
pass
24+
25+
cpdef enum Ordering:
26+
lex, deglex, degrevlex
27+
28+
cdef ordering_t ordering_py_to_c(ordering: Ordering)
29+
cdef ordering_c_to_py(ordering_t ordering)

0 commit comments

Comments
 (0)