Skip to content

Commit 0f0cfb7

Browse files
committed
Reenable gr_nf tests
1 parent 87c8837 commit 0f0cfb7

1 file changed

Lines changed: 28 additions & 36 deletions

File tree

src/flint/types/_gr.pyx

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,25 +1205,21 @@ cdef class gr_nf_ctx(gr_scalar_ctx):
12051205
def new(poly) -> gr_nf_ctx:
12061206
"""Create a new context for number fields.
12071207

1208-
The doctests below are commented out because they crash under WASM:
1209-
1210-
https://github.com/flintlib/python-flint/issues/319
1211-
1212-
# >>> from flint.types._gr import gr_nf_ctx
1213-
# >>> Qa = gr_nf_ctx.new([-2, 0, 1])
1214-
# >>> Qa
1215-
# gr_nf_ctx(x^2 + (-2))
1216-
# >>> Qa.modulus()
1217-
# x^2 + (-2)
1218-
# >>> a = Qa.gen()
1219-
# >>> a
1220-
# a
1221-
# >>> a**2
1222-
# 2
1223-
# >>> (1 + a) ** 2
1224-
# 2*a+3
1225-
# >>> (1 + a) / 2
1226-
# 1/2*a+1/2
1208+
>>> from flint.types._gr import gr_nf_ctx
1209+
>>> Qa = gr_nf_ctx.new([-2, 0, 1])
1210+
>>> Qa
1211+
gr_nf_ctx(x^2 + (-2))
1212+
>>> Qa.modulus()
1213+
x^2 + (-2)
1214+
>>> a = Qa.gen()
1215+
>>> a
1216+
a
1217+
>>> a**2
1218+
2
1219+
>>> (1 + a) ** 2
1220+
2*a+3
1221+
>>> (1 + a) / 2
1222+
1/2*a+1/2
12271223
"""
12281224
poly = fmpq_poly(poly)
12291225
return gr_nf_ctx._new(poly)
@@ -1252,23 +1248,19 @@ cdef class gr_nf_fmpz_poly_ctx(gr_scalar_ctx):
12521248
def new(poly) -> gr_nf_fmpz_poly_ctx:
12531249
"""Create a new context for number fields.
12541250

1255-
The doctests below are commented out because they crash under WASM:
1256-
1257-
https://github.com/flintlib/python-flint/issues/319
1258-
1259-
# >>> from flint.types._gr import gr_nf_fmpz_poly_ctx
1260-
# >>> Qa = gr_nf_fmpz_poly_ctx.new([-2, 0, 1])
1261-
# >>> Qa
1262-
# gr_nf_fmpz_poly_ctx(x^2 + (-2))
1263-
# >>> Qa.modulus()
1264-
# x^2 + (-2)
1265-
# >>> a = Qa.gen()
1266-
# >>> a
1267-
# a
1268-
# >>> a**2
1269-
# 2
1270-
# >>> (1 + a) ** 2
1271-
# 2*a+3
1251+
>>> from flint.types._gr import gr_nf_fmpz_poly_ctx
1252+
>>> Qa = gr_nf_fmpz_poly_ctx.new([-2, 0, 1])
1253+
>>> Qa
1254+
gr_nf_fmpz_poly_ctx(x^2 + (-2))
1255+
>>> Qa.modulus()
1256+
x^2 + (-2)
1257+
>>> a = Qa.gen()
1258+
>>> a
1259+
a
1260+
>>> a**2
1261+
2
1262+
>>> (1 + a) ** 2
1263+
2*a+3
12721264
"""
12731265
poly = fmpz_poly(poly)
12741266
return gr_nf_fmpz_poly_ctx._new(poly)

0 commit comments

Comments
 (0)