Skip to content

Commit ea7140d

Browse files
authored
Merge branch 'master' into add_fq_poly
2 parents d1198cb + f5b07e9 commit ea7140d

4 files changed

Lines changed: 268 additions & 54 deletions

File tree

.github/workflows/buildwheel.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,23 @@ jobs:
138138
- run: pip install .
139139
- run: python -m flint.test --verbose
140140

141+
# Test that we can still make a coverage build with setuptools.
142+
test_coverage_setuptools:
143+
name: Test coverage setuptools build
144+
runs-on: ubuntu-24.04
145+
steps:
146+
- uses: actions/checkout@v4
147+
- uses: actions/setup-python@v5
148+
with:
149+
python-version: '3.12'
150+
- run: sudo apt-get update
151+
- run: sudo apt-get install libflint-dev
152+
- run: pip install cython setuptools coverage
153+
- run: bin/coverage.sh
154+
env:
155+
PYTHONPATH: src
156+
- run: coverage report --sort=cover
157+
141158
# Run SymPy test suite against python-flint master
142159
test_sympy:
143160
name: Test SymPy ${{ matrix.sympy-version }}

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
("flint.types.fmpz_mod_mat", ["src/flint/types/fmpz_mod_mat.pyx"]),
104104

105105
("flint.types.fmpq_mpoly", ["src/flint/types/fmpq_mpoly.pyx"]),
106-
("flint.types.fmpz_mpoly_q", ["src/flint/types/fmpz_mpoly_q.pyx"]),
107106

108107
("flint.types.fq_default", ["src/flint/types/fq_default.pyx"]),
109108
("flint.types.fq_default_poly", ["src/flint/types/fq_default_poly.pyx"]),

src/flint/test/test_all.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,37 @@ def test_fmpz_mod_poly():
22472247
l = [-1,-2,-3,-4,-5]
22482248
assert [f(x) for x in l] == f.multipoint_evaluate(l)
22492249

2250+
# truncate things
2251+
2252+
f = R_test.random_element()
2253+
g = R_test.random_element()
2254+
h = R_test.random_element()
2255+
x = R_test.gen()
2256+
2257+
f_trunc = f % x**3
2258+
2259+
assert f.equal_trunc(f_trunc, 3)
2260+
assert not f.equal_trunc("A", 3)
2261+
assert not f.equal_trunc(f_cmp, 3)
2262+
2263+
assert raises(lambda: f.add_trunc("A", 1), TypeError)
2264+
assert raises(lambda: f.add_trunc(f_cmp, 1), ValueError)
2265+
assert f.add_trunc(g, 3) == (f + g) % x**3
2266+
2267+
assert raises(lambda: f.sub_trunc("A", 1), TypeError)
2268+
assert raises(lambda: f.sub_trunc(f_cmp, 1), ValueError)
2269+
assert f.sub_trunc(g, 3) == (f - g) % x**3
2270+
2271+
assert raises(lambda: f.mul_low("A", h), TypeError)
2272+
assert raises(lambda: f.mul_low(g, "A"), TypeError)
2273+
assert f.mul_low(g, 3) == (f * g) % x**3
2274+
2275+
assert raises(lambda: f.mul_mod(f_cmp, h), ValueError)
2276+
assert raises(lambda: f.mul_mod(g, f_cmp), ValueError)
2277+
assert f.mul_mod(g, h) == (f * g) % h
2278+
2279+
assert raises(lambda: f.pow_trunc(-1, 5), ValueError)
2280+
22502281

22512282
def test_fmpz_mod_mat():
22522283
c11 = flint.fmpz_mod_ctx(11)

0 commit comments

Comments
 (0)