Skip to content

Commit

Permalink
deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Oct 15, 2023
1 parent bca013c commit 8e1238b
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 0 deletions.
74 changes: 74 additions & 0 deletions src/sage/libs/flint/arith.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
r"""
Deprecated module.
Functions were moved in arith_sage.pyx
TESTS::
sage: from sage.libs.flint.arith import bell_number, bernoulli_number, euler_number, stirling_number_1, stirling_number_2, number_of_partitions, dedekind_sum, harmonic_number
sage: bell_number(4)
doctest:warning
...
DeprecationWarning:
Importing bell_number from here is deprecated; please use "from sage.libs.flint.arith_sage import bell_number" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
15
sage: bernoulli_number(4)
doctest:warning
...
DeprecationWarning:
Importing bernoulli_number from here is deprecated; please use "from sage.libs.flint.arith_sage import bernoulli_number" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
-1/30
sage: euler_number(4)
doctest:warning
...
DeprecationWarning:
Importing euler_number from here is deprecated; please use "from sage.libs.flint.arith_sage import euler_number" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
5
sage: stirling_number_1(2, 4)
doctest:warning
...
DeprecationWarning:
Importing stirling_number_1 from here is deprecated; please use "from sage.libs.flint.arith_sage import stirling_number_1" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
0
sage: stirling_number_2(2, 4)
doctest:warning
...
DeprecationWarning:
Importing stirling_number_2 from here is deprecated; please use "from sage.libs.flint.arith_sage import stirling_number_2" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
0
sage: number_of_partitions(4)
doctest:warning
...
DeprecationWarning:
Importing number_of_partitions from here is deprecated; please use "from sage.libs.flint.arith_sage import number_of_partitions" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
5
sage: dedekind_sum(4, 5)
doctest:warning
...
DeprecationWarning:
Importing dedekind_sum from here is deprecated; please use "from sage.libs.flint.arith_sage import dedekind_sum" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
-1/5
sage: harmonic_number(4)
doctest:warning
...
DeprecationWarning:
Importing harmonic_number from here is deprecated; please use "from sage.libs.flint.arith_sage import harmonic_number" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
25/12
"""

from sage.misc.lazy_import import lazy_import

lazy_import('sage.libs.flint.arith_sage', ['bell_number', 'bernoulli_number',
'euler_number', 'stirling_number_1', 'stirling_number_2',
'number_of_partitions', 'dedekind_sum', 'harmonic_number'],
deprecation=36449)

del lazy_import
20 changes: 20 additions & 0 deletions src/sage/libs/flint/fmpz_poly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
r"""
Deprecated module
TESTS::
sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
sage: Fmpz_poly([1, 1])
doctest:warning
...
DeprecationWarning:
Importing Fmpz_poly from here is deprecated; please use "from sage.libs.flint.fmpz_poly_sage import Fmpz_poly" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
2 1 1
"""

from sage.misc.lazy_import import lazy_import

lazy_import('sage.libs.flint.fmpz_poly_sage', 'Fmpz_poly', deprecation=36449)

del lazy_import
22 changes: 22 additions & 0 deletions src/sage/libs/flint/qsieve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
r"""
Deprecated module.
Functions were moved in qsieve_sage.pyx.
TESTS::
sage: from sage.libs.flint.qsieve import qsieve
sage: qsieve(1000)
doctest:warning
...
DeprecationWarning:
Importing qsieve from here is deprecated; please use "from sage.libs.flint.qsieve_sage import qsieve" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
[(2, 3), (5, 3)]
"""

from sage.misc.lazy_import import lazy_import

lazy_import('sage.libs.flint.qsieve_sage', 'qsieve', deprecation=36449)

del lazy_import
22 changes: 22 additions & 0 deletions src/sage/libs/flint/ulong_extras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
r"""
Deprecated modules.
Functions were moved in ulong_extras_sage.pyx
TESTS::
sage: from sage.libs.flint.ulong_extras import n_factor_to_list
sage: n_factor_to_list(60, 20)
doctest:warning
...
DeprecationWarning:
Importing n_factor_to_list from here is deprecated; please use "from sage.libs.flint.ulong_extras_sage import n_factor_to_list" instead.
See https://github.com/sagemath/sage/issues/36449 for details.
[(2, 2), (3, 1), (5, 1)]
"""

from sage.misc.lazy_import import lazy_import

lazy_import('sage.libs.flint.ulong_extras_sage', 'n_factor_to_list', deprecation=36449)

del lazy_import

0 comments on commit 8e1238b

Please sign in to comment.