From 0bf710dbe15cc6d4a963f1d91ea68796456b65cf Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 19 Nov 2024 23:47:54 -0800 Subject: [PATCH 1/4] pyproject.toml: Declare extra 'passagemath' --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 137e302..3947843 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,9 +16,15 @@ repository = "https://github.com/ACSVMath/sage_acsv" [tool.poetry.dependencies] python = "^3.8" +passagemath-symbolics = { version = "^10.4", optional = true } +passagemath-repl = { version = "^10.4", optional = true } + [tool.poetry.dev-dependencies] pytest = "^5.2" +[tool.poetry.extras] +passagemath = ["passagemath-symbolics", "passagemath-repl"] + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From 5ac6307048e587030fa11df21db0d603af076d19 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 19 Nov 2024 23:48:03 -0800 Subject: [PATCH 2/4] tox.ini: New --- tox.ini | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..7bc29bf --- /dev/null +++ b/tox.ini @@ -0,0 +1,17 @@ +[tox] +envlist = passagemath + +[testenv:passagemath] +usedevelop = True + +extras = passagemath + +allowlist_externals = + bash + +passenv = + HOME + GITHUB_ACTIONS + +commands = + bash -c "PYTHONPATH={toxinidir} sage -t -p --force-lib $([ -n \"$GITHUB_ACTIONS\" ] && echo \"--format github\") --environment=sage.all__sagemath_symbolics --optional=sage sage_acsv/" From 5bab6f7503d7342002473f8fd9ea1d732f2829ab Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 19 Nov 2024 23:51:00 -0800 Subject: [PATCH 3/4] sage_acsv: Replace .all imports --- sage_acsv/asymptotics.py | 19 ++++++++++++++++--- sage_acsv/helpers.py | 9 ++++++++- sage_acsv/kronecker.py | 4 +++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/sage_acsv/asymptotics.py b/sage_acsv/asymptotics.py index 268ac20..e6c0091 100644 --- a/sage_acsv/asymptotics.py +++ b/sage_acsv/asymptotics.py @@ -3,8 +3,21 @@ """ from copy import copy -from sage.all import AA, PolynomialRing, QQ, QQbar, SR, DifferentialWeylAlgebra -from sage.all import gcd, prod, pi, matrix, exp, log, I, factorial, srange +from sage.rings.qqbar import AA +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.rational_field import Q as QQ +from sage.rings.qqbar import QQbar +from sage.symbolic.ring import SR +from sage.algebras.weyl_algebra import DifferentialWeylAlgebra +from sage.arith.misc import GCD as gcd +from sage.misc.misc_c import prod +from sage.symbolic.constants import pi +from sage.matrix.constructor import Matrix as matrix +from sage.functions.log import exp +from sage.misc.functional import log +from sage.rings.imaginary_unit import I +from sage.functions.other import factorial +from sage.arith.srange import srange from sage_acsv.kronecker import _kronecker_representation from sage_acsv.helpers import ACSVException, NewtonSeries, RationalFunctionReduce, OutputFormat, GetHessian @@ -299,7 +312,7 @@ def diagonal_asy( result = sum([a**n * b * c * d for (a, b, c, d) in result]) elif output_format == OutputFormat.ASYMPTOTIC: - from sage.all import AsymptoticRing + from sage.rings.asymptotic.asymptotic_ring import AsymptoticRing SR_without_n = SR.subring(rejecting_variables=('n',)) AR = AsymptoticRing('SR^n * n^QQ', SR_without_n) n = AR.gen() diff --git a/sage_acsv/helpers.py b/sage_acsv/helpers.py index 0dd00ab..b274043 100644 --- a/sage_acsv/helpers.py +++ b/sage_acsv/helpers.py @@ -1,6 +1,13 @@ from enum import Enum -from sage.all import AA, QQ, Ideal, ceil, gcd, matrix, randint +from sage.rings.qqbar import AA +from sage.rings.rational_field import Q as QQ +from sage.rings.ideal import Ideal +from sage.functions.other import ceil +from sage.arith.misc import GCD as gcd +from sage.matrix.constructor import Matrix as matrix +from sage.misc.prandom import randint + class OutputFormat(Enum): """Output options for displaying the asymptotic behavior determined diff --git a/sage_acsv/kronecker.py b/sage_acsv/kronecker.py index f23e8ef..c5dc856 100644 --- a/sage_acsv/kronecker.py +++ b/sage_acsv/kronecker.py @@ -1,4 +1,6 @@ -from sage.all import PolynomialRing, QQ, gcd +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.rational_field import Q as QQ +from sage.arith.misc import GCD as gcd from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal from sage_acsv.helpers import ACSVException, GenerateLinearForm From 68efdd5e68e0e9da7aa70ee67bba18f3eda7ac1f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 19 Nov 2024 23:54:15 -0800 Subject: [PATCH 4/4] pyproject.toml: Add passagemath-singular to extra 'passagemath' --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3947843..ae1e527 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ repository = "https://github.com/ACSVMath/sage_acsv" [tool.poetry.dependencies] python = "^3.8" +passagemath-singular = { version = "^10.4", optional = true } passagemath-symbolics = { version = "^10.4", optional = true } passagemath-repl = { version = "^10.4", optional = true } @@ -23,7 +24,7 @@ passagemath-repl = { version = "^10.4", optional = true } pytest = "^5.2" [tool.poetry.extras] -passagemath = ["passagemath-symbolics", "passagemath-repl"] +passagemath = ["passagemath-singular", "passagemath-symbolics", "passagemath-repl"] [build-system] requires = ["poetry-core>=1.0.0"]