diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 538b44d1431..d189ad5d07f 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -181,7 +181,7 @@ jobs: # SPKGs to install as system packages SPKGS: _bootstrap _prereq # Non-Python packages to install as spkgs - TARGETS_PRE: gmp mpfr mpc bliss coxeter3 mcqd meataxe sirocco boost_cropped tdlib + TARGETS_PRE: gmp mpfr mpc bliss coxeter3 mcqd meataxe sirocco boost_cropped tdlib brial CIBW_BUILD: "*${{ matrix.build }}*" # Disable building PyPy wheels on all platforms CIBW_SKIP: "pp*" @@ -255,6 +255,10 @@ jobs: run: | "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*bliss* + - name: sagemath-brial + run: | + "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*brial* + - name: sagemath-coxeter3 run: | "${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*coxeter3* diff --git a/.gitignore b/.gitignore index 7d8c2f0adc4..149abde5c38 100644 --- a/.gitignore +++ b/.gitignore @@ -221,6 +221,7 @@ build/pkgs/wheel/version_requirements.txt /pkgs/sagemath-objects/setup.cfg /pkgs/sagemath-bliss/setup.cfg +/pkgs/sagemath-brial/setup.cfg /pkgs/sagemath-coxeter3/setup.cfg /pkgs/sagemath-mcqd/setup.cfg /pkgs/sagemath-meataxe/setup.cfg @@ -231,6 +232,7 @@ build/pkgs/wheel/version_requirements.txt /pkgs/sagemath-repl/setup.cfg /pkgs/sagemath-objects/pyproject.toml /pkgs/sagemath-bliss/pyproject.toml +/pkgs/sagemath-brial/pyproject.toml /pkgs/sagemath-coxeter3/pyproject.toml /pkgs/sagemath-mcqd/pyproject.toml /pkgs/sagemath-meataxe/pyproject.toml @@ -241,6 +243,7 @@ build/pkgs/wheel/version_requirements.txt /pkgs/sagemath-repl/pyproject.toml /pkgs/sagemath-objects/requirements*.txt /pkgs/sagemath-bliss/requirements*.txt +/pkgs/sagemath-brial/requirements*.txt /pkgs/sagemath-coxeter3/requirements*.txt /pkgs/sagemath-mcqd/requirements*.txt /pkgs/sagemath-meataxe/requirements*.txt diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 420dadb9364..510cfde3990 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -146,7 +146,8 @@ PYPI_WHEEL_PACKAGES = $(PYPI_NOARCH_WHEEL_PACKAGES) \ sagemath_tdlib \ sagemath_coxeter3 \ sagemath_sirocco \ - sagemath_meataxe + sagemath_meataxe \ + sagemath_brial # sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES) \ diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies index b1ebfd0825e..acd3a2a5e84 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ -FORCE $(SCRIPTS) boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup $(PYTHON) pythran +FORCE $(SCRIPTS) boost_cropped $(BLAS) cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup $(PYTHON) pythran ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/sagelib/dependencies_optional b/build/pkgs/sagelib/dependencies_optional new file mode 100644 index 00000000000..96f2ad18fa7 --- /dev/null +++ b/build/pkgs/sagelib/dependencies_optional @@ -0,0 +1 @@ +brial diff --git a/build/pkgs/sagemath_brial/SPKG.rst b/build/pkgs/sagemath_brial/SPKG.rst new file mode 120000 index 00000000000..b4545b4bda6 --- /dev/null +++ b/build/pkgs/sagemath_brial/SPKG.rst @@ -0,0 +1 @@ +src/README.rst \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/bootstrap b/build/pkgs/sagemath_brial/bootstrap new file mode 120000 index 00000000000..40542346a4e --- /dev/null +++ b/build/pkgs/sagemath_brial/bootstrap @@ -0,0 +1 @@ +../sagelib/bootstrap \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/dependencies b/build/pkgs/sagemath_brial/dependencies new file mode 100644 index 00000000000..ae30ae46bf7 --- /dev/null +++ b/build/pkgs/sagemath_brial/dependencies @@ -0,0 +1 @@ +cypari memory_allocator brial sagelib | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig $(PYTHON) diff --git a/build/pkgs/sagemath_brial/dependencies_check b/build/pkgs/sagemath_brial/dependencies_check new file mode 120000 index 00000000000..e3d1f535f9e --- /dev/null +++ b/build/pkgs/sagemath_brial/dependencies_check @@ -0,0 +1 @@ +../sagemath_categories/dependencies_check \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/package-version.txt b/build/pkgs/sagemath_brial/package-version.txt new file mode 120000 index 00000000000..c4540217bba --- /dev/null +++ b/build/pkgs/sagemath_brial/package-version.txt @@ -0,0 +1 @@ +src/VERSION.txt \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/spkg-check b/build/pkgs/sagemath_brial/spkg-check new file mode 120000 index 00000000000..91c6b1835fc --- /dev/null +++ b/build/pkgs/sagemath_brial/spkg-check @@ -0,0 +1 @@ +../sagemath_objects/spkg-check \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/spkg-install.in b/build/pkgs/sagemath_brial/spkg-install.in new file mode 120000 index 00000000000..935c21a7554 --- /dev/null +++ b/build/pkgs/sagemath_brial/spkg-install.in @@ -0,0 +1 @@ +../sagemath_tdlib/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/spkg-src b/build/pkgs/sagemath_brial/spkg-src new file mode 100755 index 00000000000..e911f19255e --- /dev/null +++ b/build/pkgs/sagemath_brial/spkg-src @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sagemath-brial +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# ./sage --sh build/pkgs/sagemath_brial/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sagemath_brial + +cd src +# Get rid of old *.egg-info/SOURCES.txt +rm -Rf *.egg-info + +python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES" diff --git a/build/pkgs/sagemath_brial/src b/build/pkgs/sagemath_brial/src new file mode 120000 index 00000000000..91b20962d0b --- /dev/null +++ b/build/pkgs/sagemath_brial/src @@ -0,0 +1 @@ +../../../pkgs/sagemath-brial \ No newline at end of file diff --git a/build/pkgs/sagemath_brial/type b/build/pkgs/sagemath_brial/type new file mode 100644 index 00000000000..a6a7b9cd726 --- /dev/null +++ b/build/pkgs/sagemath_brial/type @@ -0,0 +1 @@ +standard diff --git a/build/pkgs/sagemath_brial/version_requirements.txt b/build/pkgs/sagemath_brial/version_requirements.txt new file mode 100644 index 00000000000..c8732a9fefd --- /dev/null +++ b/build/pkgs/sagemath_brial/version_requirements.txt @@ -0,0 +1,2 @@ +# This file is updated on every release by the sage-update-version script +sagemath-brial diff --git a/pkgs/sagemath-brial/MANIFEST.in b/pkgs/sagemath-brial/MANIFEST.in new file mode 100644 index 00000000000..c3f2800773a --- /dev/null +++ b/pkgs/sagemath-brial/MANIFEST.in @@ -0,0 +1,21 @@ +prune sage + +include VERSION.txt + +graft sage/libs/polybori +graft sage/rings/polynomial/pbori + +global-exclude *.c +global-exclude *.cpp + +global-exclude all__sagemath_*.py +global-include all__sagemath_brial.py + +global-exclude __pycache__ +global-exclude *.py[co] +global-exclude *.bak +global-exclude *.so +global-exclude *~ +prune .tox +prune build +prune dist diff --git a/pkgs/sagemath-brial/README.rst b/pkgs/sagemath-brial/README.rst new file mode 100644 index 00000000000..8646fcfb769 --- /dev/null +++ b/pkgs/sagemath-brial/README.rst @@ -0,0 +1,30 @@ +========================================================================= + Sage: Open Source Mathematics Software: Boolean Ring Algebra with BRiAl +========================================================================= + +About SageMath +-------------- + + "Creating a Viable Open Source Alternative to + Magma, Maple, Mathematica, and MATLAB" + + Copyright (C) 2005-2023 The Sage Development Team + + https://www.sagemath.org + +SageMath fully supports all major Linux distributions, recent versions of +macOS, and Windows (using Cygwin or Windows Subsystem for Linux). + +The traditional and recommended way to install SageMath is from source via +Sage-the-distribution (https://www.sagemath.org/download-source.html). +Sage-the-distribution first builds a large number of open source packages from +source (unless it finds suitable versions installed in the system) and then +installs the Sage Library (sagelib, implemented in Python and Cython). + + +About this pip-installable source distribution +---------------------------------------------- + +This pip-installable source distribution ``sagemath-brial`` provides +a Boolean Ring Algebra implementation using binary decision diagrams, +implemented by the BRiAl library, the successor to PolyBoRi. diff --git a/pkgs/sagemath-brial/VERSION.txt b/pkgs/sagemath-brial/VERSION.txt new file mode 120000 index 00000000000..43f4773d7de --- /dev/null +++ b/pkgs/sagemath-brial/VERSION.txt @@ -0,0 +1 @@ +../../src/VERSION.txt \ No newline at end of file diff --git a/pkgs/sagemath-brial/pyproject.toml.m4 b/pkgs/sagemath-brial/pyproject.toml.m4 new file mode 100644 index 00000000000..b99d59c3365 --- /dev/null +++ b/pkgs/sagemath-brial/pyproject.toml.m4 @@ -0,0 +1,57 @@ +include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- +[build-system] +# Minimum requirements for the build system to execute. +requires = [ + SPKG_INSTALL_REQUIRES_setuptools + SPKG_INSTALL_REQUIRES_pkgconfig + SPKG_INSTALL_REQUIRES_sage_setup + SPKG_INSTALL_REQUIRES_sagemath_categories + SPKG_INSTALL_REQUIRES_sagemath_environment + SPKG_INSTALL_REQUIRES_sagemath_objects + SPKG_INSTALL_REQUIRES_cython + SPKG_INSTALL_REQUIRES_cysignals +] +build-backend = "setuptools.build_meta" + +[project] +name = "sagemath-brial" +description = "Sage: Open Source Mathematics Software: Boolean Ring Algebra with BRiAl" +dependencies = [ + SPKG_INSTALL_REQUIRES_cysignals +] +dynamic = ["version"] +include(`pyproject_toml_metadata.m4')dnl' + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.optional-dependencies] +test = [ + SPKG_INSTALL_REQUIRES_sagemath_categories + SPKG_INSTALL_REQUIRES_sagemath_repl +] + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.dynamic] +version = {file = ["VERSION.txt"]} + +[external] +# External dependencies in the format proposed by https://peps.python.org/pep-0725 +build-requires = [ + "virtual:compiler/c", + "virtual:compiler/cpp", + "pkg:generic/pkg-config", +] + +host-requires = [ + "pkg:generic/brial", + "pkg:generic/gmp", + "pkg:generic/mpc", + "pkg:generic/mpfr", +] + +dependencies = [ +] diff --git a/pkgs/sagemath-brial/requirements-editable.txt.m4 b/pkgs/sagemath-brial/requirements-editable.txt.m4 new file mode 100644 index 00000000000..36ce34fa058 --- /dev/null +++ b/pkgs/sagemath-brial/requirements-editable.txt.m4 @@ -0,0 +1,6 @@ +include(`sage_spkg_versions.m4')dnl +dnl Same as setup.cfg.m4 install_requires; FIXME: should pin to built wheels. +SPKG_INSTALL_REQUIRES_gmpy2 +SPKG_INSTALL_REQUIRES_cysignals +-e ../sagemath-objects +-e ../sagemath-categories diff --git a/pkgs/sagemath-brial/requirements.txt.m4 b/pkgs/sagemath-brial/requirements.txt.m4 new file mode 100644 index 00000000000..8b6ca03b0b9 --- /dev/null +++ b/pkgs/sagemath-brial/requirements.txt.m4 @@ -0,0 +1,2 @@ +Cython==esyscmd(`printf $(sed "s/[.]p.*//;" ../cython/package-version.txt)') +sagemath-standard==esyscmd(`printf $(sed "s/[.]p.*//;" ../sagelib/package-version.txt)') diff --git a/pkgs/sagemath-brial/sage b/pkgs/sagemath-brial/sage new file mode 120000 index 00000000000..e0da5daa6f2 --- /dev/null +++ b/pkgs/sagemath-brial/sage @@ -0,0 +1 @@ +../../src/sage \ No newline at end of file diff --git a/pkgs/sagemath-brial/setup.py b/pkgs/sagemath-brial/setup.py new file mode 100644 index 00000000000..219a8f81f63 --- /dev/null +++ b/pkgs/sagemath-brial/setup.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +# PEP 517 builds do not have . in sys.path +import os +import sys +sys.path.insert(0, os.path.dirname(__file__)) + +from sage_setup import sage_setup + +sage_setup(['sagemath-brial'], + required_modules=('m4ri', 'libpng')) diff --git a/pkgs/sagemath-brial/tox.ini b/pkgs/sagemath-brial/tox.ini new file mode 100644 index 00000000000..649c4188b20 --- /dev/null +++ b/pkgs/sagemath-brial/tox.ini @@ -0,0 +1,120 @@ +# To build and test in the tox environment: +# +# ./sage -sh -c '(cd pkgs/sagemath-brial && tox -v -v -v -e sagepython)' +# +# To test interactively: +# +# pkgs/sagemath-brial/.tox/sagepython/bin/python +# +[tox] +envlist = + sagepython-sagewheels-nopypi-norequirements + +requires = + # Auto-provision a modern tox. + # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance + # Because of https://github.com/tox-dev/tox/issues/3238, need <4.14.1 + tox>=4.2 + tox<4.14.1 + +[pkgenv] +# Environment in which to build the sdist. +# https://tox.wiki/en/latest/upgrading.html#packaging-environments +passenv = + # Variables set by .homebrew-build-env + CPATH + LIBRARY_PATH + PKG_CONFIG_PATH + # Parallel build + SAGE_NUM_THREADS + SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS + # SAGE_VENV only for referring to the basepython or finding the wheels + sagepython, sagewheels: SAGE_VENV + # Location of the wheels + sagewheels: SAGE_SPKG_WHEELS + +setenv = + # We supply pip options by environment variables so that they + # apply both to the installation of the dependencies and of the package + sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + nopypi: PIP_NO_INDEX=true + +[testenv] +deps = + !norequirements: -rrequirements.txt + +extras = test + +passenv = {[pkgenv]passenv} + +setenv = {[pkgenv]setenv} + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + # Stop 'sage -t --installed' from picking up doc installed in SAGE_LOCAL + SAGE_DOC=/doesnotexist + KNOWN_TEST_FAILURES={toxinidir}/known-test-failures.json + # See src/bin/sage-env + PYDEVD_DISABLE_FILE_VALIDATION=1 + +allowlist_externals = + bash + +commands = + # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. + {envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.all__sagemath_brial; import sage.rings.polynomial.pbori' + +[testenv:.tox] +# Allow access to PyPI for auto-provisioning a suitable tox version +passenv = +setenv = PIP_NO_INDEX=false + +[testenv:.pkg-sagepython] +# Environment in which to build the sdist. +# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi] +passenv = {[pkgenv]passenv} + SAGE_VENV + SAGE_SPKG_WHEELS + +setenv = {[pkgenv]setenv} + PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + PIP_NO_INDEX=true + +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi-editable] +config_settings_build_editable = + editable_mode = strict + + +[testenv:sagepython] +basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython + +[testenv:sagepython-sagewheels-nopypi] +basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi + +[testenv:sagepython-sagewheels] +basepython = {env:SAGE_VENV}/bin/python +package_env = .pkg-sagepython + +[testenv:sagepython-norequirements] +basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython + + +[testenv:sagepython-sagewheels-nopypi-norequirements] +basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi + +[testenv:sagepython-sagewheels-nopypi-editable] +basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi-editable +package = editable +deps = -r requirements-editable.txt +config_settings_build_editable = + editable_mode = strict diff --git a/pkgs/sagemath-categories/MANIFEST.in.m4 b/pkgs/sagemath-categories/MANIFEST.in.m4 index b2e35673ec0..7a1826212d5 100644 --- a/pkgs/sagemath-categories/MANIFEST.in.m4 +++ b/pkgs/sagemath-categories/MANIFEST.in.m4 @@ -28,15 +28,223 @@ exclude sage/categories/sets_with_partial_maps.* exclude sage/categories/subobjects.* exclude sage/categories/subquotients.* exclude sage/categories/with_realizations.* -# Exclude to make it a namespace package -exclude sage/categories/__init__.py -include sage/rings/ideal.* -include sage/rings/ring.* +include sage/geometry/abc.p* + +# Interfaces +include sage/interfaces/all.p* +include sage/interfaces/abc.p* +include sage/interfaces/process.p* # needed for sage.parallel +include sage/interfaces/tab_completion.p* +include sage/misc/object_multiplexer.p* +include sage/misc/multireplace.p* +include sage/interfaces/sagespawn.p* +include sage/interfaces/quit.p* +include sage/interfaces/cleaner.p* +include sage/interfaces/expect.p* +include sage/interfaces/interface.p* +include sage/interfaces/sage0.p* + +graft sage/parallel + graft sage/typeset # dep of sage.categories.tensor -# include sage/rings/integer*.* # depends on cypari, flint - https://github.com/sagemath/sage/issues/30022 -# include sage/rings/rational*.* -# include sage/rings/infinity.* + +include sage/groups/generic.p* +include sage/groups/groups_catalog.p* + +include sage/monoids/monoid.p* + +include sage/rings/ring.* +include sage/rings/quotient_ring*.p* +include sage/rings/homset.p* +include sage/rings/ideal*.p* +include sage/rings/noncommutative_ideals.p* +include sage/rings/localization.p* +include sage/rings/morphism.p* + +include sage/rings/abc.* +include sage/rings/integer*.p* +exclude sage/rings/integer_fake.pxd # in sagemath-objects +include sage/rings/rational*.* +include sage/rings/infinity.* +include sage/rings/factorint.p* +include sage/rings/sum_of_squares.p* +include sage/rings/generic.p* + +include sage/misc/allocator.* +include sage/misc/latex*.* +include sage/misc/html.p* +include sage/misc/mathml.p* +include sage/misc/table.p* +include sage/misc/map_threaded.p* +include sage/misc/mrange.p* +include sage/misc/defaults.p* +include sage/misc/converting_dict.p* +include sage/misc/parser.p* +include sage/misc/method_decorator.p* +include sage/misc/random_testing.p* +include sage/misc/rest_index_of_methods.p* +include sage/misc/callable_dict.p* +include sage/misc/search.p* +include sage/misc/stopgap.p* + +## Data structures +include sage/misc/binary_tree.p* +graft sage/data_structures # bitset needed by sage.graphs and sage.geometry.polyhedron +exclude sage/data_structures/bounded_integer_sequences.* # depends on flint +exclude sage/data_structures/stream.* +graft sage/groups/perm_gps/partn_ref # but not partn_ref2, which depends on GAP +exclude sage/groups/perm_gps/partn_ref/refinement_graphs.p* # sagemath-graphs +exclude sage/groups/perm_gps/partn_ref/refinement_matrices.p* # sagemath-modules +exclude sage/groups/perm_gps/partn_ref/refinement_binary.p* # sagemath-modules + + +# These might later go to a separate distribution sagemath-functions (> sagemath-objects); +# but sage.functions currently depends on basic rings (QQ etc) +graft sage/arith +# Exclude what is included in sagemath-objects already +exclude sage/arith/long.p* +exclude sage/arith/numerical_approx.p* +exclude sage/arith/power.p* + +include sage/calculus/functional.p* +include sage/calculus/functions.p* +include sage/misc/derivative.p* +include sage/misc/functional.p* +include sage/symbolic/symbols.p* +include sage/symbolic/function.p* +graft sage/functions + + +include sage/rings/finite_rings/element_base.* +include sage/rings/finite_rings/stdint.* +include sage/rings/finite_rings/finite_field_base.p* +include sage/rings/finite_rings/finite_field_constructor.p* +include sage/rings/finite_rings/finite_field_prime_modn.p* +include sage/rings/finite_rings/residue_field.p* +include sage/rings/finite_rings/hom_finite_field.p* +include sage/rings/finite_rings/hom_prime_finite_field.p* +include sage/rings/finite_rings/homset.p* +include sage/rings/fast_arith.* +include sage/rings/finite_rings/integer_mod_limits.h +include sage/rings/finite_rings/integer_mod.p* +include sage/rings/finite_rings/integer_mod_ring.p* +include sage/rings/finite_rings/conway_polynomials.p* +include sage/rings/finite_rings/galois_group.p* +include sage/rings/algebraic_closure_finite_field.p* + +include sage/rings/number_field/number_field_base.p* +include sage/rings/number_field/number_field_element_base.p* +include sage/rings/number_field/number_field_ideal.p* +include sage/rings/real_double.p* + +include sage/rings/real_lazy.p* + +include sage/rings/fraction_field.p* +include sage/rings/fraction_field_element.p* +include sage/rings/qqbar_decorators.p* + +include sage/rings/padics/padic_generic.p* +include sage/rings/padics/local_generic.p* +include sage/rings/padics/local_generic_element.p* +include sage/rings/padics/precision_error.p* +include sage/rings/padics/misc.p* + +include sage/rings/polynomial/polynomial_ring.p* +include sage/rings/polynomial/polynomial_ring_constructor.p* +include sage/rings/polynomial/polynomial_ring_homomorphism.p* +include sage/rings/polynomial/polynomial_quotient_ring.p* +include sage/rings/polynomial/polynomial_singular_interface.p* +include sage/rings/polynomial/multi_polynomial_ring.p* +include sage/rings/polynomial/multi_polynomial_ring_base.p* +include sage/rings/polynomial/multi_polynomial_sequence.p* +include sage/rings/polynomial/multi_polynomial_ideal.p* +include sage/rings/polynomial/infinite_polynomial_*.p* +include sage/rings/polynomial/commutative_polynomial.p* +include sage/rings/polynomial/polynomial_compiled.p* +include sage/rings/polynomial/polynomial_element.p* +include sage/rings/polynomial/polynomial_element_generic.p* +include sage/rings/polynomial/polynomial_fateman.p* +include sage/rings/polynomial/polynomial_quotient_ring_element.p* +include sage/rings/polynomial/multi_polynomial.p* +include sage/rings/polynomial/multi_polynomial_element.p* +include sage/rings/polynomial/polydict.p* +include sage/rings/polynomial/term_order.p* +include sage/rings/polynomial/flatten.p* +include sage/rings/polynomial/cyclotomic.p* +include sage/rings/polynomial/laurent_polynomial_ring*.p* +include sage/rings/polynomial/laurent_polynomial_ideal.p* +include sage/rings/polynomial/laurent_polynomial.p* # but not laurent_polynomial_mpair, which needs Matrix +include sage/rings/polynomial/ideal.p* +include sage/rings/polynomial/toy*.p* +include sage/rings/polynomial/symmetric_*.p* +## include sage/rings/polynomial/ore*.p* # need for sage.categories.drinfeld_modules + +include sage/rings/continued_fraction*.p* + +graft sage/rings/function_field +exclude sage/rings/function_field/*_polymod.* # needs Singular +exclude sage/rings/function_field/derivations*.* # module elements +exclude sage/rings/function_field/differential.* # module elements +exclude sage/rings/function_field/divisor.* # module elements +exclude sage/rings/function_field/hermite_form_polynomial.* # cimports Matrix +exclude sage/rings/function_field/valuation*.* # ?? +exclude sage/rings/function_field/khuri_makdisi.p* +prune sage/rings/function_field/drinfeld_modules # needs ore_polynomial etc. + +include sage/rings/power_series_mpoly.p* +include sage/rings/power_series_poly.p* +include sage/rings/power_series_ring_element.p* +include sage/rings/power_series_ring.p* +include sage/rings/multi_power_series_ring.py +include sage/rings/multi_power_series_ring_element.py +include sage/rings/laurent_series_ring*.p* +include sage/rings/puiseux_series_ring*.p* + +graft sage/rings/semirings + +include sage/rings/tests.p* +include sage/rings/big_oh.p* + +include sage/ext/fast_*.p* + +include sage/combinat/integer_vector.p* +graft sage/combinat/integer_lists +include sage/combinat/backtrack.p* +include sage/combinat/combinat.p* +include sage/combinat/combinat_cython.p* +include sage/combinat/combination.p* +include sage/combinat/combinatorial_map.p* +include sage/combinat/composition.p* +include sage/combinat/permutation.p* +include sage/combinat/permutation_cython.p* +include sage/combinat/ranker.py # for sage.sets.finite_set_map_cy +include sage/combinat/subset.p* +include sage/combinat/tools.p* +include sage/combinat/tuple.p* +# leave out partition - has complicated deps +# leave out integer_vector_weighted - needs combinat.words.word +include sage/combinat/subsets_hereditary.p* +include sage/combinat/subsets_pairwise.p* +include sage/combinat/dlx.p* +include sage/combinat/matrices/dancing_links.p* +include sage/combinat/matrices/dancing_links_c.h +include sage/combinat/matrices/dlxcpp.p* + +# see src/sage/schemes/generic/notes/imports.txt +graft sage/schemes/generic +graft sage/schemes/affine +graft sage/schemes/projective +graft sage/schemes/product_projective + +graft sage/sets +exclude sage/sets/pythonclass.* # sagemath-objects + +include sage/numerical/backends/generic*backend.p* + +## These two should probably go to sagemath-combinat instead. +# include sage/data_structures/stream.p* +# include sage/rings/lazy_series*.p* global-exclude *.c global-exclude *.cpp diff --git a/pkgs/sagemath-categories/README.rst b/pkgs/sagemath-categories/README.rst index 01e974442f8..07ae9c02fed 100644 --- a/pkgs/sagemath-categories/README.rst +++ b/pkgs/sagemath-categories/README.rst @@ -1,6 +1,6 @@ -========================================================================= - Sage: Open Source Mathematics Software: Sage categories and basic rings -========================================================================= +============================================================================================== + Sage: Open Source Mathematics Software: Sage categories, basic rings, polynomials, functions +============================================================================================== About SageMath -------------- @@ -33,19 +33,60 @@ available without introducing dependencies on additional mathematical libraries. -Dependencies ------------- +What is included +---------------- -When building from source, development packages of `gmp`, `mpfr`, and `mpc` are needed. +* `Structure `_, `Coercion framework `_, `Base Classes, Metaclasses `_ + +* `Categories and functorial constructions `_ + +* `Sets `_ + +* Basic Combinatorial and Data Structures: `Binary trees `_, `Bitsets `_, `Permutations `_, Combinations + +* Basic Rings and Fields: `Integers, Rationals `_, `Double Precision Reals `_, `Z/nZ `_ + +* `Commutative Polynomials `_, `Power Series and Laurent Series `_, `Rational Function Fields `_ + +* Arithmetic Functions, `Elementary and Special Functions `_ as generic entry points + +* Base classes for Groups, Rings, `Finite Fields `_, `Number Fields `_, `Schemes `_ + +* Facilities for `Parallel Computing `_, `Formatted Output `_ +Available in other distribution packages +---------------------------------------- -Documentation -------------- +* `sagemath-combinat `_: + Algebraic combinatorics, combinatorial representation theory -* `Categories `_ +* `sagemath-graphs `_: + Graphs, posets, hypergraphs, designs, abstract complexes, combinatorial polyhedra, abelian sandpiles, quivers -* `Structure `_ +* `sagemath-groups `_: + Groups, invariant theory -* `Coercion `_ +* `sagemath-modules `_: + Vectors, matrices, tensors, vector spaces, affine spaces, + modules and algebras, additive groups, quadratic forms, root systems, homology, coding theory, matroids -* `Classes, Metaclasses `_ +* `sagemath-plot `_: + Plotting and graphics with Matplotlib, Three.JS, etc. + +* `sagemath-polyhedra `_: + Convex polyhedra in arbitrary dimension, triangulations, polyhedral fans, lattice points, geometric complexes, hyperplane arrangements + +* `sagemath-repl `_: + IPython REPL, the interactive language of SageMath (preparser), interacts, development tools + +* `sagemath-schemes `_: + Schemes, varieties, Groebner bases, elliptic curves, algebraic Riemann surfaces, modular forms, arithmetic dynamics + +* `sagemath-symbolics `_: + Symbolic expressions, calculus, differentiable manifolds, asymptotics + + +Dependencies +------------ + +When building from source, development packages of `gmp`, `mpfr`, and `mpc` are needed. diff --git a/pkgs/sagemath-categories/known-test-failures.json b/pkgs/sagemath-categories/known-test-failures.json index 23e9f1adeeb..ff8036b7c50 100644 --- a/pkgs/sagemath-categories/known-test-failures.json +++ b/pkgs/sagemath-categories/known-test-failures.json @@ -1,13 +1,28 @@ { + "sage.arith.functions": { + "failed": true, + "ntests": 42 + }, + "sage.arith.misc": { + "failed": true, + "ntests": 919 + }, "sage.arith.numerical_approx": { "ntests": 1 }, "sage.arith.power": { - "failed": true, "ntests": 16 }, + "sage.arith.rational_reconstruction": { + "ntests": 1 + }, + "sage.arith.srange": { + "ntests": 72 + }, + "sage.calculus.functional": { + "ntests": 2 + }, "sage.categories.action": { - "failed": true, "ntests": 78 }, "sage.categories.additive_groups": { @@ -18,64 +33,54 @@ "ntests": 134 }, "sage.categories.additive_monoids": { - "failed": true, "ntests": 16 }, "sage.categories.additive_semigroups": { - "failed": true, "ntests": 28 }, "sage.categories.affine_weyl_groups": { "ntests": 15 }, + "sage.categories.algebra_functor": { + "ntests": 7 + }, "sage.categories.algebra_ideals": { - "failed": true, "ntests": 8 }, "sage.categories.algebra_modules": { - "failed": true, "ntests": 9 }, "sage.categories.algebras": { - "failed": true, "ntests": 25 }, "sage.categories.algebras_with_basis": { - "failed": true, - "ntests": 46 + "ntests": 16 }, "sage.categories.aperiodic_semigroups": { "ntests": 1 }, "sage.categories.associative_algebras": { - "failed": true, "ntests": 5 }, "sage.categories.bialgebras": { - "ntests": 3 + "ntests": 4 }, "sage.categories.bialgebras_with_basis": { - "failed": true, - "ntests": 31 + "ntests": 24 }, "sage.categories.bimodules": { - "failed": true, "ntests": 15 }, "sage.categories.cartesian_product": { - "failed": true, "ntests": 42 }, "sage.categories.category": { - "failed": true, "ntests": 433 }, "sage.categories.category_cy_helper": { - "failed": true, "ntests": 27 }, "sage.categories.category_singleton": { - "failed": true, "ntests": 59 }, "sage.categories.category_types": { @@ -83,61 +88,49 @@ "ntests": 74 }, "sage.categories.category_with_axiom": { - "failed": true, "ntests": 328 }, "sage.categories.chain_complexes": { - "failed": true, - "ntests": 20 + "ntests": 22 }, "sage.categories.coalgebras": { - "ntests": 6 + "ntests": 1 }, "sage.categories.coalgebras_with_basis": { - "failed": true, - "ntests": 23 + "ntests": 20 }, "sage.categories.coercion_methods": { - "failed": true, "ntests": 6 }, "sage.categories.commutative_additive_groups": { - "failed": true, "ntests": 17 }, "sage.categories.commutative_additive_monoids": { "ntests": 5 }, "sage.categories.commutative_additive_semigroups": { - "failed": true, "ntests": 6 }, "sage.categories.commutative_algebra_ideals": { - "failed": true, "ntests": 9 }, "sage.categories.commutative_algebras": { - "failed": true, "ntests": 11 }, "sage.categories.commutative_ring_ideals": { - "failed": true, "ntests": 7 }, "sage.categories.commutative_rings": { - "failed": true, - "ntests": 41 + "ntests": 80 }, "sage.categories.complete_discrete_valuation": { - "failed": true, "ntests": 30 }, "sage.categories.complex_reflection_groups": { - "failed": true, "ntests": 16 }, "sage.categories.complex_reflection_or_generalized_coxeter_groups": { - "ntests": 67 + "ntests": 47 }, "sage.categories.covariant_functorial_construction": { "failed": true, @@ -150,12 +143,13 @@ "failed": true, "ntests": 392 }, + "sage.categories.crystals": { + "ntests": 1 + }, "sage.categories.cw_complexes": { - "failed": true, "ntests": 36 }, "sage.categories.dedekind_domains": { - "failed": true, "ntests": 30 }, "sage.categories.discrete_valuation": { @@ -163,45 +157,36 @@ "ntests": 28 }, "sage.categories.distributive_magmas_and_additive_magmas": { - "failed": true, "ntests": 13 }, "sage.categories.division_rings": { "ntests": 11 }, "sage.categories.domains": { - "failed": true, "ntests": 7 }, "sage.categories.dual": { - "failed": true, "ntests": 1 }, "sage.categories.enumerated_sets": { - "failed": true, "ntests": 132 }, "sage.categories.euclidean_domains": { - "failed": true, "ntests": 22 }, "sage.categories.examples.algebras_with_basis": { "ntests": 8 }, "sage.categories.examples.commutative_additive_monoids": { - "failed": true, "ntests": 14 }, "sage.categories.examples.commutative_additive_semigroups": { - "failed": true, "ntests": 28 }, "sage.categories.examples.cw_complexes": { - "failed": true, "ntests": 33 }, "sage.categories.examples.facade_sets": { - "failed": true, "ntests": 21 }, "sage.categories.examples.filtered_algebras_with_basis": { @@ -215,70 +200,55 @@ "ntests": 1 }, "sage.categories.examples.finite_enumerated_sets": { - "failed": true, "ntests": 29 }, "sage.categories.examples.finite_monoids": { - "failed": true, "ntests": 15 }, "sage.categories.examples.finite_semigroups": { - "failed": true, "ntests": 27 }, "sage.categories.examples.finite_weyl_groups": { - "failed": true, "ntests": 25 }, "sage.categories.examples.graded_modules_with_basis": { "ntests": 14 }, "sage.categories.examples.graphs": { - "failed": true, "ntests": 24 }, "sage.categories.examples.infinite_enumerated_sets": { - "failed": true, "ntests": 35 }, "sage.categories.examples.lie_algebras": { "ntests": 25 }, "sage.categories.examples.magmas": { - "failed": true, "ntests": 20 }, "sage.categories.examples.manifolds": { - "failed": true, "ntests": 15 }, "sage.categories.examples.monoids": { - "failed": true, "ntests": 16 }, "sage.categories.examples.posets": { - "failed": true, "ntests": 29 }, "sage.categories.examples.semigroups": { - "failed": true, "ntests": 83 }, "sage.categories.examples.semigroups_cython": { - "failed": true, "ntests": 47 }, "sage.categories.examples.sets_with_grading": { - "failed": true, "ntests": 14 }, "sage.categories.facade_sets": { - "failed": true, "ntests": 27 }, "sage.categories.fields": { - "failed": true, - "ntests": 109 + "ntests": 100 }, "sage.categories.filtered_algebras": { "failed": true, @@ -289,11 +259,9 @@ "ntests": 39 }, "sage.categories.filtered_hopf_algebras_with_basis": { - "failed": true, "ntests": 12 }, "sage.categories.filtered_modules": { - "failed": true, "ntests": 18 }, "sage.categories.filtered_modules_with_basis": { @@ -301,76 +269,67 @@ "ntests": 74 }, "sage.categories.finite_complex_reflection_groups": { - "failed": true, - "ntests": 189 + "ntests": 172 }, "sage.categories.finite_coxeter_groups": { "ntests": 6 }, "sage.categories.finite_dimensional_algebras_with_basis": { - "failed": true, - "ntests": 91 + "ntests": 71 }, "sage.categories.finite_dimensional_bialgebras_with_basis": { - "failed": true, "ntests": 4 }, "sage.categories.finite_dimensional_coalgebras_with_basis": { - "failed": true, "ntests": 4 }, "sage.categories.finite_dimensional_graded_lie_algebras_with_basis": { - "failed": true, "ntests": 22 }, "sage.categories.finite_dimensional_hopf_algebras_with_basis": { - "failed": true, "ntests": 3 }, "sage.categories.finite_dimensional_lie_algebras_with_basis": { "failed": true, - "ntests": 73 + "ntests": 167 }, "sage.categories.finite_dimensional_modules_with_basis": { - "failed": true, - "ntests": 89 + "ntests": 56 }, "sage.categories.finite_dimensional_nilpotent_lie_algebras_with_basis": { - "failed": true, "ntests": 19 }, "sage.categories.finite_dimensional_semisimple_algebras_with_basis": { - "failed": true, - "ntests": 12 + "ntests": 11 }, "sage.categories.finite_enumerated_sets": { - "failed": true, "ntests": 123 }, "sage.categories.finite_fields": { - "failed": true, "ntests": 14 }, + "sage.categories.finite_groups": { + "ntests": 5 + }, "sage.categories.finite_lattice_posets": { "ntests": 31 }, "sage.categories.finite_monoids": { - "failed": true, "ntests": 28 }, "sage.categories.finite_permutation_groups": { - "ntests": 2 + "ntests": 12 + }, + "sage.categories.finite_posets": { + "ntests": 19 }, "sage.categories.finite_semigroups": { - "failed": true, "ntests": 14 }, "sage.categories.finite_sets": { - "failed": true, "ntests": 14 }, "sage.categories.finite_weyl_groups": { - "failed": true, "ntests": 6 }, "sage.categories.finitely_generated_lambda_bracket_algebras": { @@ -380,19 +339,15 @@ "ntests": 10 }, "sage.categories.finitely_generated_magmas": { - "failed": true, "ntests": 6 }, "sage.categories.finitely_generated_semigroups": { - "failed": true, "ntests": 27 }, "sage.categories.function_fields": { - "failed": true, "ntests": 11 }, "sage.categories.functor": { - "failed": true, "ntests": 128 }, "sage.categories.g_sets": { @@ -405,64 +360,49 @@ "ntests": 12 }, "sage.categories.graded_algebras": { - "failed": true, "ntests": 8 }, "sage.categories.graded_algebras_with_basis": { - "failed": true, "ntests": 8 }, "sage.categories.graded_bialgebras": { - "failed": true, "ntests": 3 }, "sage.categories.graded_bialgebras_with_basis": { - "failed": true, "ntests": 3 }, "sage.categories.graded_coalgebras": { - "failed": true, "ntests": 6 }, "sage.categories.graded_coalgebras_with_basis": { - "failed": true, "ntests": 6 }, "sage.categories.graded_hopf_algebras": { - "failed": true, "ntests": 3 }, "sage.categories.graded_hopf_algebras_with_basis": { - "failed": true, "ntests": 12 }, "sage.categories.graded_lie_algebras": { - "failed": true, "ntests": 12 }, "sage.categories.graded_lie_algebras_with_basis": { - "failed": true, "ntests": 5 }, "sage.categories.graded_lie_conformal_algebras": { - "failed": true, "ntests": 5 }, "sage.categories.graded_modules": { - "failed": true, "ntests": 16 }, "sage.categories.graded_modules_with_basis": { - "failed": true, "ntests": 25 }, "sage.categories.graphs": { - "failed": true, "ntests": 25 }, "sage.categories.group_algebras": { - "failed": true, - "ntests": 27 + "ntests": 30 }, "sage.categories.groups": { "ntests": 45 @@ -471,32 +411,25 @@ "ntests": 4 }, "sage.categories.hecke_modules": { - "failed": true, "ntests": 16 }, "sage.categories.homset": { - "failed": true, "ntests": 197 }, "sage.categories.homsets": { - "failed": true, "ntests": 56 }, "sage.categories.hopf_algebras": { - "failed": true, "ntests": 15 }, "sage.categories.hopf_algebras_with_basis": { - "failed": true, "ntests": 30 }, "sage.categories.infinite_enumerated_sets": { - "failed": true, "ntests": 13 }, "sage.categories.integral_domains": { - "failed": true, - "ntests": 22 + "ntests": 24 }, "sage.categories.isomorphic_objects": { "ntests": 2 @@ -505,14 +438,12 @@ "ntests": 1 }, "sage.categories.kac_moody_algebras": { - "failed": true, "ntests": 9 }, "sage.categories.l_trivial_semigroups": { "ntests": 5 }, "sage.categories.lambda_bracket_algebras": { - "failed": true, "ntests": 16 }, "sage.categories.lambda_bracket_algebras_with_basis": { @@ -522,43 +453,37 @@ "ntests": 10 }, "sage.categories.left_modules": { - "failed": true, "ntests": 4 }, "sage.categories.lie_algebras": { "failed": true, - "ntests": 135 + "ntests": 120 }, "sage.categories.lie_algebras_with_basis": { "ntests": 19 }, "sage.categories.lie_conformal_algebras": { - "failed": true, "ntests": 25 }, "sage.categories.lie_conformal_algebras_with_basis": { "ntests": 17 }, "sage.categories.lie_groups": { - "failed": true, "ntests": 9 }, "sage.categories.loop_crystals": { "ntests": 1 }, "sage.categories.magmas": { - "failed": true, "ntests": 147 }, "sage.categories.magmas_and_additive_magmas": { "ntests": 21 }, "sage.categories.magmatic_algebras": { - "failed": true, "ntests": 27 }, "sage.categories.manifolds": { - "failed": true, "ntests": 52 }, "sage.categories.map": { @@ -566,47 +491,36 @@ "ntests": 353 }, "sage.categories.matrix_algebras": { - "failed": true, "ntests": 3 }, "sage.categories.metric_spaces": { - "failed": true, "ntests": 46 }, "sage.categories.modular_abelian_varieties": { - "failed": true, "ntests": 8 }, "sage.categories.modules": { - "failed": true, "ntests": 120 }, "sage.categories.modules_with_basis": { - "failed": true, - "ntests": 240 + "ntests": 223 }, "sage.categories.monoid_algebras": { - "failed": true, "ntests": 4 }, "sage.categories.monoids": { - "failed": true, "ntests": 81 }, "sage.categories.morphism": { - "failed": true, "ntests": 126 }, "sage.categories.noetherian_rings": { - "failed": true, "ntests": 19 }, "sage.categories.number_fields": { - "failed": true, "ntests": 41 }, "sage.categories.objects": { - "failed": true, "ntests": 12 }, "sage.categories.partially_ordered_monoids": { @@ -619,35 +533,29 @@ "ntests": 3 }, "sage.categories.polyhedra": { - "failed": true, "ntests": 4 }, "sage.categories.poor_man_map": { - "failed": true, "ntests": 59 }, "sage.categories.posets": { "ntests": 2 }, "sage.categories.primer": { - "failed": true, - "ntests": 162 + "ntests": 161 }, "sage.categories.principal_ideal_domains": { - "failed": true, - "ntests": 11 + "ntests": 29 }, "sage.categories.pushout": { "failed": true, - "ntests": 624 + "ntests": 619 }, "sage.categories.quantum_group_representations": { - "failed": true, "ntests": 13 }, "sage.categories.quotient_fields": { - "failed": true, - "ntests": 81 + "ntests": 77 }, "sage.categories.quotients": { "ntests": 2 @@ -656,45 +564,39 @@ "ntests": 3 }, "sage.categories.realizations": { - "failed": true, "ntests": 21 }, + "sage.categories.regular_crystals": { + "ntests": 3 + }, "sage.categories.right_modules": { - "failed": true, "ntests": 4 }, "sage.categories.ring_ideals": { - "failed": true, "ntests": 9 }, "sage.categories.rings": { - "failed": true, - "ntests": 146 + "ntests": 173 }, "sage.categories.rngs": { "ntests": 6 }, "sage.categories.schemes": { - "failed": true, - "ntests": 41 + "ntests": 39 }, "sage.categories.semigroups": { - "failed": true, "ntests": 112 }, "sage.categories.semirings": { "ntests": 6 }, "sage.categories.semisimple_algebras": { - "failed": true, "ntests": 15 }, "sage.categories.sets_cat": { - "failed": true, "ntests": 412 }, "sage.categories.sets_with_grading": { - "failed": true, "ntests": 23 }, "sage.categories.sets_with_partial_maps": { @@ -704,21 +606,18 @@ "ntests": 5 }, "sage.categories.signed_tensor": { - "failed": true, "ntests": 10 }, "sage.categories.simplicial_complexes": { "ntests": 17 }, "sage.categories.simplicial_sets": { - "failed": true, - "ntests": 98 + "ntests": 57 }, "sage.categories.subobjects": { "ntests": 2 }, "sage.categories.super_algebras": { - "failed": true, "ntests": 8 }, "sage.categories.super_algebras_with_basis": { @@ -726,56 +625,110 @@ "ntests": 10 }, "sage.categories.super_hopf_algebras_with_basis": { - "failed": true, "ntests": 10 }, "sage.categories.super_lie_conformal_algebras": { - "failed": true, "ntests": 20 }, "sage.categories.super_modules": { - "failed": true, "ntests": 18 }, "sage.categories.super_modules_with_basis": { - "failed": true, "ntests": 10 }, "sage.categories.supercommutative_algebras": { - "failed": true, "ntests": 8 }, "sage.categories.tensor": { - "failed": true, "ntests": 9 }, "sage.categories.topological_spaces": { "ntests": 27 }, "sage.categories.triangular_kac_moody_algebras": { - "failed": true, - "ntests": 15 + "ntests": 12 }, "sage.categories.tutorial": { - "failed": true, "ntests": 4 }, "sage.categories.unique_factorization_domains": { - "failed": true, "ntests": 39 }, "sage.categories.unital_algebras": { - "failed": true, - "ntests": 37 + "ntests": 30 }, "sage.categories.vector_spaces": { - "failed": true, "ntests": 44 }, "sage.categories.with_realizations": { - "failed": true, "ntests": 24 }, + "sage.combinat.backtrack": { + "ntests": 28 + }, + "sage.combinat.combinat": { + "ntests": 236 + }, + "sage.combinat.combinat_cython": { + "ntests": 22 + }, + "sage.combinat.combination": { + "ntests": 97 + }, + "sage.combinat.combinatorial_map": { + "ntests": 75 + }, + "sage.combinat.composition": { + "ntests": 287 + }, + "sage.combinat.dlx": { + "ntests": 61 + }, + "sage.combinat.integer_lists.base": { + "ntests": 116 + }, + "sage.combinat.integer_lists.invlex": { + "ntests": 304 + }, + "sage.combinat.integer_lists.lists": { + "ntests": 56 + }, + "sage.combinat.integer_lists.nn": { + "ntests": 5 + }, + "sage.combinat.integer_vector": { + "ntests": 254 + }, + "sage.combinat.matrices.dancing_links": { + "ntests": 250 + }, + "sage.combinat.matrices.dlxcpp": { + "ntests": 9 + }, + "sage.combinat.permutation": { + "ntests": 1184 + }, + "sage.combinat.permutation_cython": { + "ntests": 39 + }, + "sage.combinat.ranker": { + "ntests": 48 + }, + "sage.combinat.subset": { + "ntests": 281 + }, + "sage.combinat.subsets_hereditary": { + "ntests": 7 + }, + "sage.combinat.subsets_pairwise": { + "ntests": 32 + }, + "sage.combinat.tools": { + "ntests": 2 + }, + "sage.combinat.tuple": { + "ntests": 33 + }, "sage.cpython.atexit": { "ntests": 19 }, @@ -783,15 +736,12 @@ "ntests": 4 }, "sage.cpython.debug": { - "failed": true, "ntests": 13 }, "sage.cpython.dict_del_by_value": { - "failed": true, "ntests": 21 }, "sage.cpython.getattr": { - "failed": true, "ntests": 65 }, "sage.cpython.string": { @@ -804,8 +754,22 @@ "ntests": 7 }, "sage.cpython.wrapperdescr": { - "failed": true, - "ntests": 0 + "ntests": 13 + }, + "sage.data_structures.bitset": { + "ntests": 425 + }, + "sage.data_structures.blas_dict": { + "ntests": 61 + }, + "sage.data_structures.list_of_pairs": { + "ntests": 14 + }, + "sage.data_structures.mutable_poset": { + "ntests": 441 + }, + "sage.doctest.__main__": { + "ntests": 9 }, "sage.doctest.check_tolerance": { "failed": true, @@ -813,7 +777,7 @@ }, "sage.doctest.control": { "failed": true, - "ntests": 230 + "ntests": 229 }, "sage.doctest.external": { "ntests": 42 @@ -823,7 +787,7 @@ }, "sage.doctest.forker": { "failed": true, - "ntests": 413 + "ntests": 414 }, "sage.doctest.marked_output": { "failed": true, @@ -834,30 +798,34 @@ "ntests": 275 }, "sage.doctest.reporting": { - "ntests": 115 + "ntests": 126 }, "sage.doctest.rif_tol": { "failed": true, "ntests": 18 }, "sage.doctest.sources": { - "failed": true, "ntests": 343 }, "sage.doctest.test": { - "failed": true, "ntests": 23 }, "sage.doctest.util": { - "failed": true, - "ntests": 141 + "ntests": 137 }, "sage.env": { "failed": true, "ntests": 41 }, + "sage.ext.fast_callable": { + "failed": true, + "ntests": 317 + }, + "sage.ext.fast_eval": { + "ntests": 4 + }, "sage.features": { - "ntests": 143 + "ntests": 146 }, "sage.features.all": { "ntests": 14 @@ -868,6 +836,9 @@ "sage.features.cddlib": { "ntests": 4 }, + "sage.features.coxeter3": { + "ntests": 4 + }, "sage.features.csdp": { "ntests": 6 }, @@ -899,6 +870,9 @@ "sage.features.gfan": { "ntests": 2 }, + "sage.features.giac": { + "ntests": 4 + }, "sage.features.graph_generators": { "ntests": 18 }, @@ -913,7 +887,7 @@ }, "sage.features.interfaces": { "failed": true, - "ntests": 33 + "ntests": 34 }, "sage.features.internet": { "ntests": 5 @@ -922,8 +896,7 @@ "ntests": 4 }, "sage.features.join_feature": { - "failed": true, - "ntests": 25 + "ntests": 23 }, "sage.features.kenzo": { "ntests": 6 @@ -980,15 +953,20 @@ "ntests": 28 }, "sage.features.sagemath": { - "failed": true, - "ntests": 151 + "ntests": 161 + }, + "sage.features.sat": { + "ntests": 16 }, "sage.features.singular": { "ntests": 4 }, - "sage.features.sphinx": { + "sage.features.sirocco": { "ntests": 4 }, + "sage.features.sphinx": { + "ntests": 8 + }, "sage.features.symengine_py": { "ntests": 4 }, @@ -999,61 +977,216 @@ "failed": true, "ntests": 6 }, - "sage.misc.abstract_method": { + "sage.features.topcom": { + "ntests": 8 + }, + "sage.functions.airy": { + "ntests": 99 + }, + "sage.functions.bessel": { + "ntests": 160 + }, + "sage.functions.error": { + "ntests": 94 + }, + "sage.functions.exp_integral": { + "ntests": 156 + }, + "sage.functions.gamma": { + "failed": true, + "ntests": 140 + }, + "sage.functions.generalized": { + "ntests": 70 + }, + "sage.functions.hyperbolic": { + "ntests": 81 + }, + "sage.functions.hypergeometric": { + "ntests": 79 + }, + "sage.functions.jacobi": { + "ntests": 38 + }, + "sage.functions.log": { + "ntests": 153 + }, + "sage.functions.min_max": { + "ntests": 21 + }, + "sage.functions.orthogonal_polys": { + "ntests": 230 + }, + "sage.functions.other": { "failed": true, + "ntests": 238 + }, + "sage.functions.piecewise": { + "ntests": 11 + }, + "sage.functions.prime_pi": { + "ntests": 4 + }, + "sage.functions.special": { + "ntests": 121 + }, + "sage.functions.spike_function": { + "ntests": 32 + }, + "sage.functions.transcendental": { + "ntests": 55 + }, + "sage.functions.trig": { + "ntests": 126 + }, + "sage.functions.wigner": { + "ntests": 24 + }, + "sage.geometry.abc": { + "ntests": 15 + }, + "sage.groups.generic": { + "ntests": 110 + }, + "sage.groups.group": { + "ntests": 45 + }, + "sage.groups.old": { + "ntests": 31 + }, + "sage.groups.perm_gps.partn_ref.canonical_augmentation": { + "ntests": 1 + }, + "sage.groups.perm_gps.partn_ref.data_structures": { + "ntests": 4 + }, + "sage.groups.perm_gps.partn_ref.refinement_lists": { + "ntests": 3 + }, + "sage.groups.perm_gps.partn_ref.refinement_python": { + "ntests": 101 + }, + "sage.groups.perm_gps.partn_ref.refinement_sets": { + "ntests": 156 + }, + "sage.interfaces.abc": { + "ntests": 8 + }, + "sage.interfaces.interface": { + "ntests": 4 + }, + "sage.interfaces.process": { + "ntests": 39 + }, + "sage.interfaces.quit": { + "ntests": 16 + }, + "sage.interfaces.sage0": { + "ntests": 4 + }, + "sage.interfaces.sagespawn": { + "ntests": 34 + }, + "sage.interfaces.tab_completion": { + "ntests": 13 + }, + "sage.misc.abstract_method": { "ntests": 33 }, "sage.misc.banner": { - "failed": true, "ntests": 12 }, + "sage.misc.binary_tree": { + "ntests": 61 + }, "sage.misc.bindable_class": { "ntests": 47 }, "sage.misc.c3_controlled": { - "failed": true, "ntests": 150 }, "sage.misc.cachefunc": { - "failed": true, "ntests": 692 }, "sage.misc.call": { "ntests": 28 }, + "sage.misc.callable_dict": { + "ntests": 12 + }, "sage.misc.classcall_metaclass": { "ntests": 78 }, "sage.misc.constant_function": { "ntests": 21 }, + "sage.misc.converting_dict": { + "ntests": 53 + }, "sage.misc.decorators": { - "failed": true, "ntests": 125 }, - "sage.misc.fast_methods": { + "sage.misc.defaults": { + "ntests": 14 + }, + "sage.misc.derivative": { + "ntests": 24 + }, + "sage.misc.dev_tools": { + "failed": true, + "ntests": 61 + }, + "sage.misc.edit_module": { + "ntests": 16 + }, + "sage.misc.explain_pickle": { "failed": true, + "ntests": 400 + }, + "sage.misc.fast_methods": { "ntests": 80 }, "sage.misc.flatten": { - "failed": true, "ntests": 15 }, + "sage.misc.fpickle": { + "ntests": 13 + }, "sage.misc.function_mangling": { "ntests": 32 }, + "sage.misc.functional": { + "failed": true, + "ntests": 271 + }, + "sage.misc.html": { + "failed": true, + "ntests": 64 + }, "sage.misc.inherit_comparison": { "ntests": 2 }, + "sage.misc.inline_fortran": { + "ntests": 12 + }, "sage.misc.instancedoc": { "ntests": 67 }, - "sage.misc.lazy_attribute": { + "sage.misc.latex": { + "failed": true, + "ntests": 211 + }, + "sage.misc.latex_macros": { "failed": true, + "ntests": 11 + }, + "sage.misc.latex_standalone": { + "ntests": 210 + }, + "sage.misc.lazy_attribute": { "ntests": 100 }, "sage.misc.lazy_format": { - "failed": true, "ntests": 23 }, "sage.misc.lazy_import": { @@ -1061,46 +1194,71 @@ "ntests": 279 }, "sage.misc.lazy_import_cache": { - "failed": true, "ntests": 8 }, + "sage.misc.lazy_list": { + "ntests": 227 + }, "sage.misc.lazy_string": { - "failed": true, "ntests": 131 }, + "sage.misc.map_threaded": { + "ntests": 1 + }, + "sage.misc.method_decorator": { + "ntests": 13 + }, "sage.misc.misc": { "failed": true, - "ntests": 176 + "ntests": 162 }, "sage.misc.misc_c": { - "failed": true, "ntests": 121 }, + "sage.misc.mrange": { + "ntests": 96 + }, + "sage.misc.multireplace": { + "ntests": 4 + }, "sage.misc.namespace_package": { "ntests": 7 }, "sage.misc.nested_class": { "ntests": 67 }, + "sage.misc.object_multiplexer": { + "ntests": 15 + }, "sage.misc.package": { - "ntests": 36 + "ntests": 22 }, "sage.misc.package_dir": { - "failed": true, - "ntests": 35 + "ntests": 29 + }, + "sage.misc.parser": { + "ntests": 136 }, "sage.misc.persist": { - "failed": true, "ntests": 137 }, "sage.misc.prandom": { "failed": true, "ntests": 74 }, + "sage.misc.random_testing": { + "ntests": 18 + }, "sage.misc.repr": { - "failed": true, "ntests": 31 }, + "sage.misc.reset": { + "failed": true, + "ntests": 29 + }, + "sage.misc.rest_index_of_methods": { + "ntests": 22 + }, "sage.misc.sage_eval": { "failed": true, "ntests": 31 @@ -1109,8 +1267,16 @@ "failed": true, "ntests": 732 }, + "sage.misc.sage_ostools": { + "ntests": 41 + }, + "sage.misc.sage_timeit": { + "ntests": 44 + }, + "sage.misc.sage_timeit_class": { + "ntests": 6 + }, "sage.misc.sage_unittest": { - "failed": true, "ntests": 88 }, "sage.misc.sagedoc": { @@ -1118,21 +1284,37 @@ "ntests": 103 }, "sage.misc.sageinspect": { + "ntests": 321 + }, + "sage.misc.search": { + "ntests": 4 + }, + "sage.misc.session": { "failed": true, - "ntests": 322 + "ntests": 61 + }, + "sage.misc.stopgap": { + "ntests": 11 }, "sage.misc.superseded": { "failed": true, "ntests": 59 }, + "sage.misc.table": { + "ntests": 66 + }, "sage.misc.temporary_file": { - "failed": true, "ntests": 80 }, + "sage.misc.test_nested_class": { + "ntests": 18 + }, "sage.misc.timing": { - "failed": true, "ntests": 35 }, + "sage.misc.trace": { + "ntests": 5 + }, "sage.misc.unknown": { "ntests": 22 }, @@ -1140,22 +1322,54 @@ "ntests": 22 }, "sage.misc.viewer": { - "failed": true, "ntests": 49 }, "sage.misc.weak_dict": { - "failed": true, "ntests": 251 }, + "sage.modules.module": { + "ntests": 37 + }, + "sage.numerical.backends.generic_backend": { + "failed": true, + "ntests": 60 + }, + "sage.numerical.backends.generic_sdp_backend": { + "failed": true, + "ntests": 22 + }, + "sage.parallel.decorate": { + "ntests": 86 + }, + "sage.parallel.map_reduce": { + "failed": true, + "ntests": 293 + }, + "sage.parallel.multiprocessing_sage": { + "ntests": 9 + }, + "sage.parallel.ncpus": { + "ntests": 1 + }, + "sage.parallel.parallelism": { + "ntests": 53 + }, + "sage.parallel.reference": { + "ntests": 5 + }, + "sage.parallel.use_fork": { + "failed": true, + "ntests": 28 + }, "sage.repl.attach": { "failed": true, - "ntests": 128 + "ntests": 135 }, "sage.repl.configuration": { + "failed": true, "ntests": 22 }, "sage.repl.display.fancy_repr": { - "failed": true, "ntests": 27 }, "sage.repl.display.formatter": { @@ -1166,17 +1380,13 @@ "ntests": 25 }, "sage.repl.display.pretty_print": { - "failed": true, "ntests": 21 }, "sage.repl.display.util": { "ntests": 7 }, - "sage.repl.image": { - "failed": true, - "ntests": 42 - }, "sage.repl.inputhook": { + "failed": true, "ntests": 7 }, "sage.repl.interface_magic": { @@ -1196,11 +1406,9 @@ "ntests": 35 }, "sage.repl.ipython_kernel.interact": { - "failed": true, "ntests": 42 }, "sage.repl.ipython_kernel.kernel": { - "failed": true, "ntests": 12 }, "sage.repl.ipython_kernel.widgets": { @@ -1217,11 +1425,10 @@ }, "sage.repl.load": { "failed": true, - "ntests": 38 + "ntests": 40 }, "sage.repl.preparse": { - "failed": true, - "ntests": 349 + "ntests": 353 }, "sage.repl.rich_output.backend_base": { "failed": true, @@ -1238,11 +1445,9 @@ "ntests": 75 }, "sage.repl.rich_output.buffer": { - "failed": true, "ntests": 49 }, "sage.repl.rich_output.display_manager": { - "failed": true, "ntests": 86 }, "sage.repl.rich_output.output_basic": { @@ -1264,53 +1469,518 @@ "ntests": 68 }, "sage.repl.rich_output.pretty_print": { - "failed": true, "ntests": 41 }, "sage.repl.rich_output.test_backend": { - "failed": true, "ntests": 37 }, - "sage.rings.ideal": { + "sage.rings.abc": { + "ntests": 91 + }, + "sage.rings.big_oh": { + "ntests": 22 + }, + "sage.rings.continued_fraction": { + "ntests": 286 + }, + "sage.rings.continued_fraction_gosper": { + "ntests": 34 + }, + "sage.rings.factorint": { + "ntests": 10 + }, + "sage.rings.finite_rings.conway_polynomials": { + "ntests": 20 + }, + "sage.rings.finite_rings.element_base": { + "ntests": 13 + }, + "sage.rings.finite_rings.finite_field_base": { + "ntests": 24 + }, + "sage.rings.finite_rings.finite_field_constructor": { + "ntests": 17 + }, + "sage.rings.finite_rings.finite_field_prime_modn": { "failed": true, - "ntests": 336 + "ntests": 28 }, - "sage.rings.integer_fake.pxd": { + "sage.rings.finite_rings.galois_group": { "ntests": 1 }, - "sage.rings.ring": { - "failed": true, - "ntests": 298 + "sage.rings.finite_rings.hom_prime_finite_field": { + "ntests": 15 }, - "sage.sets.pythonclass": { + "sage.rings.finite_rings.integer_mod": { "failed": true, - "ntests": 55 + "ntests": 539 }, - "sage.structure.category_object": { + "sage.rings.finite_rings.integer_mod_ring": { "failed": true, - "ntests": 140 + "ntests": 253 }, - "sage.structure.coerce": { + "sage.rings.finite_rings.residue_field": { "failed": true, - "ntests": 310 + "ntests": 41 }, - "sage.structure.coerce_actions": { + "sage.rings.fraction_field": { "failed": true, - "ntests": 128 + "ntests": 197 }, - "sage.structure.coerce_dict": { + "sage.rings.fraction_field_element": { "failed": true, - "ntests": 289 + "ntests": 198 }, - "sage.structure.coerce_maps": { - "failed": true, + "sage.rings.function_field.constructor": { + "ntests": 34 + }, + "sage.rings.function_field.element": { + "ntests": 148 + }, + "sage.rings.function_field.element_rational": { + "ntests": 71 + }, + "sage.rings.function_field.extensions": { + "ntests": 7 + }, + "sage.rings.function_field.function_field": { + "failed": true, + "ntests": 158 + }, + "sage.rings.function_field.function_field_rational": { + "failed": true, + "ntests": 135 + }, + "sage.rings.function_field.ideal": { + "failed": true, + "ntests": 92 + }, + "sage.rings.function_field.ideal_rational": { + "ntests": 82 + }, + "sage.rings.function_field.maps": { + "ntests": 55 + }, + "sage.rings.function_field.order": { + "ntests": 29 + }, + "sage.rings.function_field.order_basis": { + "ntests": 20 + }, + "sage.rings.function_field.order_rational": { + "failed": true, + "ntests": 69 + }, + "sage.rings.function_field.place": { + "ntests": 51 + }, + "sage.rings.function_field.place_rational": { + "ntests": 7 + }, + "sage.rings.generic": { + "ntests": 51 + }, + "sage.rings.homset": { + "ntests": 37 + }, + "sage.rings.ideal": { + "ntests": 336 + }, + "sage.rings.ideal_monoid": { + "ntests": 22 + }, + "sage.rings.infinity": { + "ntests": 313 + }, + "sage.rings.integer": { + "failed": true, + "ntests": 1068 + }, + "sage.rings.integer_fake.pxd": { + "ntests": 1 + }, + "sage.rings.integer_ring": { + "failed": true, + "ntests": 202 + }, + "sage.rings.laurent_series_ring": { + "failed": true, + "ntests": 151 + }, + "sage.rings.laurent_series_ring_element": { + "ntests": 335 + }, + "sage.rings.localization": { + "ntests": 110 + }, + "sage.rings.morphism": { + "failed": true, + "ntests": 444 + }, + "sage.rings.multi_power_series_ring": { + "failed": true, + "ntests": 218 + }, + "sage.rings.multi_power_series_ring_element": { + "failed": true, + "ntests": 426 + }, + "sage.rings.number_field.number_field_base": { + "ntests": 1 + }, + "sage.rings.number_field.number_field_element_base": { + "ntests": 4 + }, + "sage.rings.number_field.number_field_ideal": { + "ntests": 9 + }, + "sage.rings.padics.local_generic": { + "ntests": 72 + }, + "sage.rings.padics.local_generic_element": { + "ntests": 12 + }, + "sage.rings.padics.misc": { + "ntests": 26 + }, + "sage.rings.padics.padic_generic": { + "ntests": 58 + }, + "sage.rings.polynomial.commutative_polynomial": { + "ntests": 7 + }, + "sage.rings.polynomial.cyclotomic": { + "ntests": 31 + }, + "sage.rings.polynomial.flatten": { + "failed": true, + "ntests": 133 + }, + "sage.rings.polynomial.ideal": { + "ntests": 13 + }, + "sage.rings.polynomial.infinite_polynomial_element": { + "failed": true, + "ntests": 298 + }, + "sage.rings.polynomial.infinite_polynomial_ring": { + "failed": true, + "ntests": 275 + }, + "sage.rings.polynomial.laurent_polynomial": { + "failed": true, + "ntests": 417 + }, + "sage.rings.polynomial.laurent_polynomial_ideal": { + "ntests": 7 + }, + "sage.rings.polynomial.laurent_polynomial_ring": { + "failed": true, + "ntests": 87 + }, + "sage.rings.polynomial.laurent_polynomial_ring_base": { + "ntests": 5 + }, + "sage.rings.polynomial.multi_polynomial": { + "failed": true, + "ntests": 466 + }, + "sage.rings.polynomial.multi_polynomial_element": { + "failed": true, + "ntests": 251 + }, + "sage.rings.polynomial.multi_polynomial_ideal": { + "ntests": 99 + }, + "sage.rings.polynomial.multi_polynomial_ring": { + "failed": true, + "ntests": 149 + }, + "sage.rings.polynomial.multi_polynomial_ring_base": { + "failed": true, + "ntests": 230 + }, + "sage.rings.polynomial.multi_polynomial_sequence": { + "failed": true, + "ntests": 135 + }, + "sage.rings.polynomial.polydict": { + "ntests": 396 + }, + "sage.rings.polynomial.polynomial_element": { + "failed": true, + "ntests": 1844 + }, + "sage.rings.polynomial.polynomial_element_generic": { + "failed": true, + "ntests": 194 + }, + "sage.rings.polynomial.polynomial_quotient_ring": { + "ntests": 36 + }, + "sage.rings.polynomial.polynomial_quotient_ring_element": { + "ntests": 13 + }, + "sage.rings.polynomial.polynomial_ring": { + "failed": true, + "ntests": 397 + }, + "sage.rings.polynomial.polynomial_ring_constructor": { + "failed": true, + "ntests": 130 + }, + "sage.rings.polynomial.polynomial_ring_homomorphism": { + "ntests": 24 + }, + "sage.rings.polynomial.polynomial_singular_interface": { + "ntests": 42 + }, + "sage.rings.polynomial.symmetric_ideal": { + "ntests": 37 + }, + "sage.rings.polynomial.symmetric_reduction": { + "ntests": 9 + }, + "sage.rings.polynomial.term_order": { + "ntests": 319 + }, + "sage.rings.polynomial.toy_buchberger": { + "ntests": 32 + }, + "sage.rings.polynomial.toy_d_basis": { + "ntests": 51 + }, + "sage.rings.polynomial.toy_variety": { + "ntests": 24 + }, + "sage.rings.power_series_mpoly": { + "ntests": 4 + }, + "sage.rings.power_series_poly": { + "failed": true, + "ntests": 257 + }, + "sage.rings.power_series_ring": { + "failed": true, + "ntests": 241 + }, + "sage.rings.power_series_ring_element": { + "failed": true, + "ntests": 471 + }, + "sage.rings.puiseux_series_ring": { + "ntests": 72 + }, + "sage.rings.puiseux_series_ring_element": { + "ntests": 198 + }, + "sage.rings.quotient_ring": { + "failed": true, + "ntests": 185 + }, + "sage.rings.quotient_ring_element": { + "ntests": 100 + }, + "sage.rings.rational": { + "failed": true, + "ntests": 533 + }, + "sage.rings.rational_field": { + "failed": true, + "ntests": 189 + }, + "sage.rings.real_double": { + "failed": true, + "ntests": 288 + }, + "sage.rings.real_lazy": { + "ntests": 19 + }, + "sage.rings.ring": { + "failed": true, + "ntests": 206 + }, + "sage.rings.semirings.non_negative_integer_semiring": { + "ntests": 16 + }, + "sage.rings.semirings.tropical_semiring": { + "ntests": 120 + }, + "sage.rings.sum_of_squares": { + "ntests": 35 + }, + "sage.rings.tests": { + "ntests": 39 + }, + "sage.schemes.affine.affine_homset": { + "ntests": 52 + }, + "sage.schemes.affine.affine_morphism": { + "failed": true, + "ntests": 282 + }, + "sage.schemes.affine.affine_point": { + "failed": true, + "ntests": 69 + }, + "sage.schemes.affine.affine_rational_point": { + "ntests": 26 + }, + "sage.schemes.affine.affine_space": { + "failed": true, + "ntests": 167 + }, + "sage.schemes.affine.affine_subscheme": { + "ntests": 81 + }, + "sage.schemes.generic.algebraic_scheme": { + "failed": true, + "ntests": 339 + }, + "sage.schemes.generic.ambient_space": { + "ntests": 60 + }, + "sage.schemes.generic.divisor_group": { + "ntests": 40 + }, + "sage.schemes.generic.homset": { + "ntests": 121 + }, + "sage.schemes.generic.morphism": { + "failed": true, + "ntests": 391 + }, + "sage.schemes.generic.point": { + "ntests": 35 + }, + "sage.schemes.generic.scheme": { + "ntests": 178 + }, + "sage.schemes.generic.spec": { + "ntests": 32 + }, + "sage.schemes.product_projective.homset": { + "ntests": 26 + }, + "sage.schemes.product_projective.morphism": { + "ntests": 99 + }, + "sage.schemes.product_projective.point": { + "ntests": 111 + }, + "sage.schemes.product_projective.rational_point": { + "ntests": 25 + }, + "sage.schemes.product_projective.space": { + "ntests": 153 + }, + "sage.schemes.product_projective.subscheme": { + "ntests": 62 + }, + "sage.schemes.projective.proj_bdd_height": { + "ntests": 21 + }, + "sage.schemes.projective.projective_homset": { + "ntests": 58 + }, + "sage.schemes.projective.projective_morphism": { + "failed": true, + "ntests": 480 + }, + "sage.schemes.projective.projective_point": { + "failed": true, + "ntests": 281 + }, + "sage.schemes.projective.projective_rational_point": { + "ntests": 34 + }, + "sage.schemes.projective.projective_space": { + "failed": true, + "ntests": 381 + }, + "sage.schemes.projective.projective_subscheme": { + "failed": true, + "ntests": 233 + }, + "sage.sets.cartesian_product": { + "ntests": 54 + }, + "sage.sets.condition_set": { + "ntests": 53 + }, + "sage.sets.disjoint_set": { + "ntests": 266 + }, + "sage.sets.disjoint_union_enumerated_sets": { + "ntests": 61 + }, + "sage.sets.family": { + "ntests": 378 + }, + "sage.sets.finite_enumerated_set": { + "ntests": 84 + }, + "sage.sets.finite_set_map_cy": { + "ntests": 111 + }, + "sage.sets.finite_set_maps": { + "ntests": 86 + }, + "sage.sets.image_set": { + "ntests": 58 + }, + "sage.sets.integer_range": { + "ntests": 166 + }, + "sage.sets.non_negative_integers": { + "ntests": 48 + }, + "sage.sets.positive_integers": { + "ntests": 14 + }, + "sage.sets.primes": { + "ntests": 39 + }, + "sage.sets.pythonclass": { + "ntests": 55 + }, + "sage.sets.real_set": { + "ntests": 23 + }, + "sage.sets.recursively_enumerated_set": { + "ntests": 336 + }, + "sage.sets.set": { + "failed": true, + "ntests": 352 + }, + "sage.sets.set_from_iterator": { + "ntests": 150 + }, + "sage.sets.totally_ordered_finite_set": { + "ntests": 69 + }, + "sage.structure.category_object": { + "ntests": 140 + }, + "sage.structure.coerce": { + "failed": true, + "ntests": 311 + }, + "sage.structure.coerce_actions": { + "ntests": 128 + }, + "sage.structure.coerce_dict": { + "failed": true, + "ntests": 289 + }, + "sage.structure.coerce_maps": { "ntests": 90 }, "sage.structure.debug_options": { "ntests": 5 }, "sage.structure.dynamic_class": { - "failed": true, "ntests": 83 }, "sage.structure.element": { @@ -1318,11 +1988,9 @@ "ntests": 562 }, "sage.structure.element.pxd": { - "failed": true, - "ntests": 23 + "ntests": 18 }, "sage.structure.element_wrapper": { - "failed": true, "ntests": 160 }, "sage.structure.factorization": { @@ -1330,7 +1998,6 @@ "ntests": 200 }, "sage.structure.factorization_integer": { - "failed": true, "ntests": 6 }, "sage.structure.factory": { @@ -1338,18 +2005,15 @@ "ntests": 99 }, "sage.structure.formal_sum": { - "failed": true, - "ntests": 67 + "ntests": 71 }, "sage.structure.global_options": { "ntests": 145 }, "sage.structure.indexed_generators": { - "failed": true, "ntests": 90 }, "sage.structure.list_clone": { - "failed": true, "ntests": 380 }, "sage.structure.list_clone_demo": { @@ -1362,19 +2026,15 @@ "ntests": 12 }, "sage.structure.mutability": { - "failed": true, "ntests": 68 }, "sage.structure.nonexact": { - "failed": true, "ntests": 11 }, "sage.structure.parent": { - "failed": true, - "ntests": 303 + "ntests": 300 }, "sage.structure.parent_gens": { - "failed": true, "ntests": 24 }, "sage.structure.parent_old": { @@ -1388,60 +2048,83 @@ "ntests": 50 }, "sage.structure.richcmp": { - "failed": true, "ntests": 56 }, "sage.structure.richcmp.pxd": { "ntests": 24 }, "sage.structure.sage_object": { - "failed": true, "ntests": 84 }, "sage.structure.sequence": { - "failed": true, "ntests": 183 }, "sage.structure.set_factories": { - "failed": true, "ntests": 225 }, "sage.structure.set_factories_example": { - "failed": true, "ntests": 81 }, "sage.structure.support_view": { "ntests": 38 }, "sage.structure.test_factory": { - "failed": true, "ntests": 6 }, "sage.structure.unique_representation": { + "ntests": 234 + }, + "sage.symbolic.function": { "failed": true, - "ntests": 226 + "ntests": 169 + }, + "sage.symbolic.symbols": { + "ntests": 3 + }, + "sage.tests.article_heuberger_krenn_kropf_fsm-in-sage": { + "ntests": 22 + }, + "sage.tests.book_schilling_zabrocki_kschur_primer": { + "ntests": 2 + }, + "sage.tests.book_stein_ent": { + "ntests": 8 + }, + "sage.tests.cmdline": { + "ntests": 133 + }, + "sage.tests.finite_poset": { + "ntests": 1 + }, + "sage.tests.functools_partial_src": { + "ntests": 3 + }, + "sage.tests.parigp": { + "ntests": 4 + }, + "sage.tests.startup": { + "ntests": 6 + }, + "sage.tests.test_deprecation": { + "ntests": 4 }, "sage.typeset.ascii_art": { "failed": true, "ntests": 24 }, "sage.typeset.character_art": { - "failed": true, "ntests": 108 }, "sage.typeset.character_art_factory": { - "failed": true, "ntests": 53 }, "sage.typeset.symbols": { - "failed": true, "ntests": 28 }, "sage.typeset.unicode_art": { - "failed": true, "ntests": 18 }, "sage.typeset.unicode_characters": { "ntests": 27 } -} +} \ No newline at end of file diff --git a/pkgs/sagemath-categories/pyproject.toml.m4 b/pkgs/sagemath-categories/pyproject.toml.m4 index edbafa59242..a1ad47838e9 100644 --- a/pkgs/sagemath-categories/pyproject.toml.m4 +++ b/pkgs/sagemath-categories/pyproject.toml.m4 @@ -3,12 +3,13 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- # Minimum requirements for the build system to execute. requires = [ SPKG_INSTALL_REQUIRES_setuptools - SPKG_INSTALL_REQUIRES_wheel SPKG_INSTALL_REQUIRES_sage_setup + SPKG_INSTALL_REQUIRES_jinja2 SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_sagemath_objects SPKG_INSTALL_REQUIRES_cython SPKG_INSTALL_REQUIRES_gmpy2 + SPKG_INSTALL_REQUIRES_memory_allocator SPKG_INSTALL_REQUIRES_cysignals SPKG_INSTALL_REQUIRES_pkgconfig ] @@ -19,6 +20,7 @@ name = "sagemath-categories" description = "Sage: Open Source Mathematics Software: Sage categories and basic rings" dependencies = [ SPKG_INSTALL_REQUIRES_sagemath_objects + SPKG_INSTALL_REQUIRES_memory_allocator ] dynamic = ["version"] include(`pyproject_toml_metadata.m4')dnl' @@ -38,6 +40,9 @@ include-package-data = false [tool.setuptools.dynamic] version = {file = ["VERSION.txt"]} +[tool.setuptools.package-data] +"sage.rings.finite_rings" = ["integer_mod_limits.h"] + [external] # External dependencies in the format proposed by https://peps.python.org/pep-0725 build-requires = [ diff --git a/pkgs/sagemath-environment/MANIFEST.in b/pkgs/sagemath-environment/MANIFEST.in index ca4266e2bf4..f7b1523ef88 100644 --- a/pkgs/sagemath-environment/MANIFEST.in +++ b/pkgs/sagemath-environment/MANIFEST.in @@ -6,6 +6,7 @@ include sage/misc/package.py include sage/misc/package_dir.py include sage/misc/temporary_file.py include sage/misc/viewer.py + graft sage/features include VERSION.txt diff --git a/pkgs/sagemath-objects/MANIFEST.in b/pkgs/sagemath-objects/MANIFEST.in index c9b25189372..8df65d2eccb 100644 --- a/pkgs/sagemath-objects/MANIFEST.in +++ b/pkgs/sagemath-objects/MANIFEST.in @@ -32,6 +32,7 @@ include sage/misc/classcall_metaclass.* include sage/misc/inherit_comparison*.* include sage/misc/weak_dict.* include sage/misc/nested_class*.* +include sage/misc/test_nested_class*.p* include sage/misc/abstract_method.* include sage/misc/cachefunc.* include sage/misc/decorators.* @@ -46,41 +47,55 @@ include sage/misc/constant_function.* include sage/misc/call.* include sage/misc/bindable_class.* include sage/misc/namespace_package.p* -include sage/misc/package_dir.py include sage/misc/verbose.* include sage/misc/repr.* include sage/misc/superseded.* include sage/misc/misc_c.* # prod include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.py - +include sage/misc/lazy_list.p* include sage/misc/lazy_import*.* include sage/misc/sageinspect.* # dep of sage/misc/lazy_import include sage/misc/instancedoc.* # dep of sage/misc/lazy_import include sage/misc/persist.* include sage/misc/sage_unittest.* # dep of sage/misc/persist +include sage/misc/fpickle.p* include sage/misc/randstate.* # used in sage.doctest include sage/misc/prandom.* # dep of sage/rings/ring include sage/ext/stdsage.pxd +include sage/ext/mod_int.* +include sage/ext/cplusplus.pxd include sage/sets/pythonclass.* include sage/arith/power.* include sage/arith/numerical_approx.* # integers... include sage/arith/long.* include sage/rings/integer_fake.* -graft sage/libs/gmp +# coerce actions needs is_Group +include sage/groups/group.* +include sage/groups/old.* +# needed for sage.structure.formal_sum +include sage/modules/module.p* + +graft sage/libs/gmp +include sage/libs/gmpxx.pxd ## What we do not want: # sage/misc/latex -- this should really go to another package -## FIXME: Needed for doctesting +## Needed for doctesting; we keep sagemath-repl pure Python include sage/misc/misc.* # some_tuples used in sage.misc.sage_unittest include sage/misc/timing.p* # walltime, cputime used in sage.doctest +include sage/misc/globals.p* +include sage/misc/sage_timeit*.p* +include sage/misc/session.p* +include sage/misc/reset.p* +include sage/misc/sage_ostools.p* global-exclude all__*.py global-include all__sagemath_objects.py diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 index 68cfbafe935..4a68c34f70e 100644 --- a/pkgs/sagemath-objects/pyproject.toml.m4 +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -3,7 +3,6 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- # Minimum requirements for the build system to execute. requires = [ SPKG_INSTALL_REQUIRES_setuptools - SPKG_INSTALL_REQUIRES_wheel SPKG_INSTALL_REQUIRES_sage_setup SPKG_INSTALL_REQUIRES_sagemath_environment SPKG_INSTALL_REQUIRES_cython @@ -40,11 +39,15 @@ version = {file = ["VERSION.txt"]} [tool.setuptools.package-data] "sage.cpython" = [ + "pycore_long.h", "pyx_visit.h", "string_impl.h", "cython_metaclass.h", "python_debug.h", ] +"sage.ext" = [ + "mod_int.h", +] "sage.rings" = ["integer_fake.h"] [external] diff --git a/pkgs/sagemath-repl/MANIFEST.in b/pkgs/sagemath-repl/MANIFEST.in index 0d9a0289491..38ba4e82577 100644 --- a/pkgs/sagemath-repl/MANIFEST.in +++ b/pkgs/sagemath-repl/MANIFEST.in @@ -2,11 +2,22 @@ prune sage graft sage/doctest graft sage/repl +graft sage/tests + include sage/misc/banner.py include sage/misc/sagedoc.py include sage/misc/sage_input.py include sage/misc/sage_eval.py +include sage/misc/explain_pickle.py +include sage/misc/trace.py +include sage/misc/profiler.py +include sage/misc/dev_tools.py +include sage/misc/edit_module.py +include sage/misc/pager.py + +include sage/misc/cython.py +include sage/misc/inline_fortran.py # expect_objects from sage.interfaces.quit is needed to compute the # CPU time used by each doctest. We include sage.interfaces.cleaner # because it is conditionally imported by sage.interfaces.quit. diff --git a/pkgs/sagemath-repl/known-test-failures.json b/pkgs/sagemath-repl/known-test-failures.json index 6703c0a50cf..9f2a76a39c6 100644 --- a/pkgs/sagemath-repl/known-test-failures.json +++ b/pkgs/sagemath-repl/known-test-failures.json @@ -1,30 +1,28 @@ { "sage.doctest.control": { "failed": true, - "ntests": 0 + "ntests": 229 }, "sage.doctest.external": { - "ntests": 41 + "ntests": 40 }, "sage.doctest.fixtures": { - "failed": true, - "ntests": 59 + "ntests": 58 }, "sage.doctest.forker": { "failed": true, - "ntests": 432 + "ntests": 412 }, "sage.doctest.parsing": { "failed": true, - "ntests": 316 + "ntests": 308 }, "sage.doctest.reporting": { - "failed": true, - "ntests": 124 + "ntests": 126 }, "sage.doctest.sources": { "failed": true, - "ntests": 376 + "ntests": 341 }, "sage.doctest.test": { "ntests": 23 @@ -42,7 +40,7 @@ "ntests": 721 }, "sage.repl.attach": { - "ntests": 128 + "ntests": 135 }, "sage.repl.configuration": { "ntests": 22 @@ -78,7 +76,7 @@ }, "sage.repl.interpreter": { "failed": true, - "ntests": 109 + "ntests": 105 }, "sage.repl.ipython_extension": { "failed": true, @@ -86,7 +84,7 @@ }, "sage.repl.ipython_kernel.install": { "failed": true, - "ntests": 40 + "ntests": 35 }, "sage.repl.ipython_kernel.interact": { "failed": true, @@ -109,11 +107,11 @@ }, "sage.repl.load": { "failed": true, - "ntests": 41 + "ntests": 39 }, "sage.repl.preparse": { "failed": true, - "ntests": 343 + "ntests": 347 }, "sage.repl.rich_output.backend_base": { "failed": true, @@ -126,15 +124,14 @@ "ntests": 15 }, "sage.repl.rich_output.backend_ipython": { - "failed": true, - "ntests": 75 + "ntests": 73 }, "sage.repl.rich_output.buffer": { "ntests": 49 }, "sage.repl.rich_output.display_manager": { "failed": true, - "ntests": 85 + "ntests": 84 }, "sage.repl.rich_output.output_basic": { "ntests": 46 diff --git a/pkgs/sagemath-repl/pyproject.toml.m4 b/pkgs/sagemath-repl/pyproject.toml.m4 index f0ed5af473c..9cbd86b6b46 100644 --- a/pkgs/sagemath-repl/pyproject.toml.m4 +++ b/pkgs/sagemath-repl/pyproject.toml.m4 @@ -3,7 +3,6 @@ include(`sage_spkg_versions_toml.m4')dnl' -*- conf-toml -*- # Minimum requirements for the build system to execute. requires = [ SPKG_INSTALL_REQUIRES_setuptools - SPKG_INSTALL_REQUIRES_wheel ] build-backend = "setuptools.build_meta" @@ -39,6 +38,14 @@ py-modules = [ "sage.misc.sagedoc", "sage.misc.sage_input", "sage.misc.sage_eval", + "sage.misc.explain_pickle", + "sage.misc.trace", + "sage.misc.profiler", + "sage.misc.dev_tools", + "sage.misc.edit_module", + "sage.misc.pager", + "sage.misc.cython", + "sage.misc.inline_fortran", ] packages = [ "sage.doctest", @@ -47,6 +54,7 @@ packages = [ "sage.repl.display", "sage.repl.ipython_kernel", "sage.repl.rich_output", + "sage.tests", ] script-files = [ # Other scripts that should be in the path also for OS packaging of sage: diff --git a/src/doc/en/reference/sat/index.rst b/src/doc/en/reference/sat/index.rst index c0cfb22f855..70ce91380b6 100644 --- a/src/doc/en/reference/sat/index.rst +++ b/src/doc/en/reference/sat/index.rst @@ -96,6 +96,7 @@ Converters Sage supports conversion from Boolean polynomials (also known as Algebraic Normal Form) to Conjunctive Normal Form:: + sage: # needs sage.rings.polynomial.pbori sage: B. = BooleanPolynomialRing() sage: from sage.sat.converters.polybori import CNFEncoder sage: from sage.sat.solvers.dimacs import DIMACS @@ -123,6 +124,7 @@ Highlevel Interfaces Sage provides various highlevel functions which make working with Boolean polynomials easier. We construct a very small-scale AES system of equations and pass it to a SAT solver:: + sage: # needs sage.rings.polynomial.pbori sage: sr = mq.SR(1,1,1,4,gf2=True,polybori=True) sage: while True: ....: try: diff --git a/src/sage/all__sagemath_brial.py b/src/sage/all__sagemath_brial.py new file mode 100644 index 00000000000..6395af675fe --- /dev/null +++ b/src/sage/all__sagemath_brial.py @@ -0,0 +1,3 @@ +# sage_setup: distribution = sagemath-brial + +from .all__sagemath_categories import * diff --git a/src/sage/all__sagemath_categories.py b/src/sage/all__sagemath_categories.py index cb37b0baf2f..93f6532dea8 100644 --- a/src/sage/all__sagemath_categories.py +++ b/src/sage/all__sagemath_categories.py @@ -1,6 +1,26 @@ # sage_setup: distribution = sagemath-categories from sage.all__sagemath_objects import * -from sage.categories.all import * +try: + # For doctesting + from sage.all__sagemath_repl import * +except ImportError: + pass +from sage.categories.all import * from sage.rings.all__sagemath_categories import * +from sage.sets.all import * +from sage.combinat.all__sagemath_categories import * +from sage.arith.all import * +from sage.data_structures.all import * +from sage.ext.all__sagemath_categories import * +from sage.groups.all__sagemath_categories import * +from sage.interfaces.all import * +from sage.misc.all__sagemath_categories import * +from sage.typeset.all import * +from sage.schemes.all__sagemath_categories import * + +from sage.calculus.all__sagemath_categories import * +from sage.functions.all import * + +from sage.parallel.all import * diff --git a/src/sage/arith/all.py b/src/sage/arith/all.py index f1fc716071c..8fcffa6e4b9 100644 --- a/src/sage/arith/all.py +++ b/src/sage/arith/all.py @@ -1,3 +1,5 @@ +from sage.arith.all__sagemath_objects import * + from sage.misc.lazy_import import lazy_import from sage.arith.misc import (algdep, bernoulli, is_prime, is_prime_power, diff --git a/src/sage/arith/all__sagemath_objects.py b/src/sage/arith/all__sagemath_objects.py index 40da49fdd73..31d80d17daa 100644 --- a/src/sage/arith/all__sagemath_objects.py +++ b/src/sage/arith/all__sagemath_objects.py @@ -1,3 +1,5 @@ # sage_setup: distribution = sagemath-objects # The presence of this file ensures that sage_setup for sagemath-objects # considers this directory as a namespace package + +from sage.arith.power import generic_power as power diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py index 745d5fcbbe7..342a926eeaf 100644 --- a/src/sage/arith/misc.py +++ b/src/sage/arith/misc.py @@ -2733,7 +2733,7 @@ def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds): Test that :issue:`35219` is fixed:: - sage: len(factor(2^2203-1,proof=false)) + sage: len(factor(2^2203 - 1, proof=false)) # needs sage.libs.pari 1 """ try: @@ -6392,6 +6392,7 @@ def smooth_part(x, base): EXAMPLES:: + sage: # needs sage.libs.pari sage: from sage.arith.misc import smooth_part sage: from sage.rings.generic import ProductTree sage: smooth_part(10^77+1, primes(1000)) @@ -6433,6 +6434,7 @@ def coprime_part(x, base): EXAMPLES:: + sage: # needs sage.libs.pari sage: from sage.arith.misc import coprime_part, smooth_part sage: from sage.rings.generic import ProductTree sage: coprime_part(10^77+1, primes(10000)) diff --git a/src/sage/calculus/all.py b/src/sage/calculus/all.py index fc7f54a6758..73e701dbce7 100644 --- a/src/sage/calculus/all.py +++ b/src/sage/calculus/all.py @@ -1,3 +1,4 @@ +from sage.calculus.all__sagemath_categories import * from .calculus import maxima as maxima_calculus from .calculus import (laplace, inverse_laplace, @@ -8,10 +9,6 @@ from .interpolation import spline, Spline -from .functional import (diff, derivative, - expand, - taylor, simplify) - from .functions import (wronskian, jacobian) from .ode import ode_solver, ode_system diff --git a/src/sage/calculus/all__sagemath_categories.py b/src/sage/calculus/all__sagemath_categories.py new file mode 100644 index 00000000000..cf9a7fbd0b2 --- /dev/null +++ b/src/sage/calculus/all__sagemath_categories.py @@ -0,0 +1 @@ +from sage.calculus.functional import diff, derivative, expand, simplify, taylor diff --git a/src/sage/categories/functor.pyx b/src/sage/categories/functor.pyx index 9b491ee0b94..fecce86a72c 100644 --- a/src/sage/categories/functor.pyx +++ b/src/sage/categories/functor.pyx @@ -131,12 +131,12 @@ cdef class Functor(SageObject): From: Univariate Polynomial Ring in x over Integer Ring To: Multivariate Polynomial Ring in a, b over Rational Field Defn: x |--> a + b - sage: F(f) + sage: F(f) # needs sage.libs.singular Ring morphism: From: Fraction Field of Univariate Polynomial Ring in x over Integer Ring To: Fraction Field of Multivariate Polynomial Ring in a, b over Rational Field Defn: x |--> a + b - sage: F(f)(1/x) + sage: F(f)(1/x) # needs sage.libs.singular 1/(a + b) We can also apply a polynomial ring construction functor to our homomorphism. The diff --git a/src/sage/categories/modules_with_basis.py b/src/sage/categories/modules_with_basis.py index 7b51d82c7ba..ec854b26c93 100644 --- a/src/sage/categories/modules_with_basis.py +++ b/src/sage/categories/modules_with_basis.py @@ -996,6 +996,7 @@ def intersection(self, other): EXAMPLES:: + sage: # needs sage.modules sage: X = CombinatorialFreeModule(QQ, range(4)); x = X.basis() sage: U = X.submodule([x[0]-x[1], x[1]-x[2], x[2]-x[3]]) sage: F = CombinatorialFreeModule(QQ, ['a','b','c','d']) @@ -1049,6 +1050,7 @@ def cardinality(self): sage: s.cardinality() # needs sage.combinat sage.modules +Infinity + sage: # needs sage.modules sage: M = CombinatorialFreeModule(QQ, []) sage: M.dimension() 0 @@ -1479,6 +1481,7 @@ def _test_monomial_coefficients(self, **options): By default, this method tests only the elements returned by ``self.some_elements()``:: + sage: # needs sage.modules sage: A = AlgebrasWithBasis(QQ).example(); A An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field @@ -2142,6 +2145,7 @@ def map_coefficients(self, f, new_base_ring=None): We can map into a different base ring:: + sage: # needs sage.modules sage: F = CombinatorialFreeModule(QQ, ['a','b','c']) sage: B = F.basis() sage: a = 1/2*(B['a'] + 3*B['c']); a @@ -2158,9 +2162,9 @@ def map_coefficients(self, f, new_base_ring=None): Coefficients are converted to the new base ring after applying the map:: - sage: B['a'].map_coefficients(lambda c: 2*c, GF(2)) + sage: B['a'].map_coefficients(lambda c: 2*c, GF(2)) # needs sage.modules 0 - sage: B['a'].map_coefficients(lambda c: GF(2)(c), QQ) + sage: B['a'].map_coefficients(lambda c: GF(2)(c), QQ) # needs sage.modules B['a'] """ R = self.parent() diff --git a/src/sage/categories/quotient_fields.py b/src/sage/categories/quotient_fields.py index 76f0570a819..5cb4ae688e0 100644 --- a/src/sage/categories/quotient_fields.py +++ b/src/sage/categories/quotient_fields.py @@ -358,8 +358,8 @@ def factor(self, *args, **kwds): Here is an example to show that :issue:`7868` has been resolved:: sage: R. = GF(2)[] - sage: f = x*y/(x+y) - sage: f.factor() # needs sage.rings.finite_rings + sage: f = x*y/(x+y) # needs sage.libs.singular + sage: f.factor() # needs sage.libs.singular (x + y)^-1 * y * x """ return (self.numerator().factor(*args, **kwds) / @@ -620,7 +620,7 @@ def derivative(self, *args): :: sage: F. = Frac(QQ['x,y']) - sage: (1/(x+y)).derivative(x,y) + sage: (1/(x+y)).derivative(x,y) # needs sage.libs.singular 2/(x^3 + 3*x^2*y + 3*x*y^2 + y^3) """ from sage.misc.derivative import multi_derivative @@ -657,6 +657,7 @@ def _derivative(self, var=None): :: + sage: # needs sage.libs.singular sage: F. = Frac(QQ['x,y']) sage: t = (x*y/(x+y)) sage: t._derivative(x) diff --git a/src/sage/categories/rings.py b/src/sage/categories/rings.py index 781f1a1462b..82d30fcab04 100644 --- a/src/sage/categories/rings.py +++ b/src/sage/categories/rings.py @@ -1496,8 +1496,8 @@ def _random_nonzero_element(self, *args, **kwds): sage: ZZ._random_nonzero_element() != 0 True - sage: A = GF((5, 3)) - sage: A._random_nonzero_element() != 0 + sage: A = GF((5, 3)) # needs sage.rings.finite_rings + sage: A._random_nonzero_element() != 0 # needs sage.rings.finite_rings True """ while True: diff --git a/src/sage/categories/schemes.py b/src/sage/categories/schemes.py index 68187fa2257..b9fc30408dd 100644 --- a/src/sage/categories/schemes.py +++ b/src/sage/categories/schemes.py @@ -282,6 +282,7 @@ def extra_super_categories(self): EXAMPLES:: + sage: # needs sage.schemes sage: Hom(EllipticCurve(j=1), EllipticCurve(j=2)) in CommutativeAdditiveGroups() True """ @@ -301,6 +302,7 @@ def extra_super_categories(self): EXAMPLES:: + sage: # needs sage.schemes sage: End(EllipticCurve(j=1)) in Rings() True """ diff --git a/src/sage/combinat/all.py b/src/sage/combinat/all.py index 901bca30fd2..e0d6a4c40d6 100644 --- a/src/sage/combinat/all.py +++ b/src/sage/combinat/all.py @@ -53,16 +53,9 @@ install_dict(__package__, {'quickref': quickref, 'tutorial': tutorial}) del quickref, tutorial -from sage.misc.lazy_import import lazy_import +from sage.combinat.all__sagemath_categories import * -from sage.combinat.combinat import (CombinatorialObject, - bell_number, bell_polynomial, bernoulli_polynomial, - catalan_number, euler_number, - fibonacci, fibonacci_sequence, fibonacci_xrange, - lucas_number1, lucas_number2, - number_of_tuples, number_of_unordered_tuples, - polygonal_number, stirling_number1, stirling_number2, - tuples, unordered_tuples) +from sage.misc.lazy_import import lazy_import from sage.combinat.expnums import expnums @@ -70,8 +63,6 @@ from sage.combinat.crystals.all import * from sage.combinat.rigged_configurations.all import * -from sage.combinat.dlx import DLXMatrix, AllExactCovers, OneExactCover - # block designs, etc. from sage.combinat.designs.all import * @@ -86,7 +77,6 @@ from sage.combinat.yang_baxter_graph import YangBaxterGraph # Permutations -from sage.combinat.permutation import Permutation, Permutations, Arrangements, CyclicPermutations, CyclicPermutationsOfPartition from sage.combinat.affine_permutation import AffinePermutationGroup lazy_import('sage.combinat.colored_permutations', ['ColoredPermutations', 'SignedPermutation', @@ -103,11 +93,7 @@ # PerfectMatchings from sage.combinat.perfect_matching import PerfectMatching, PerfectMatchings -# Integer lists -from sage.combinat.integer_lists import IntegerListsLex - # Compositions -from sage.combinat.composition import Composition, Compositions from sage.combinat.composition_signed import SignedCompositions # Partitions @@ -170,9 +156,6 @@ from sage.combinat.graph_path import GraphPaths -# Tuples -from sage.combinat.tuple import Tuples, UnorderedTuples - # Alternating sign matrices lazy_import('sage.combinat.alternating_sign_matrix', ('AlternatingSignMatrix', 'AlternatingSignMatrices', @@ -210,7 +193,6 @@ lazy_import('sage.combinat.multiset_partition_into_sets_ordered', ['OrderedMultisetPartitionIntoSets', 'OrderedMultisetPartitionsIntoSets']) -from sage.combinat.subset import Subsets, subsets, powerset, uniq from sage.combinat.necklace import Necklaces lazy_import('sage.combinat.dyck_word', ('DyckWords', 'DyckWord')) lazy_import('sage.combinat.nu_dyck_word', ('NuDyckWords', 'NuDyckWord')) @@ -295,3 +277,6 @@ # Bijectionist lazy_import('sage.combinat.bijectionist', 'Bijectionist') +del lazy_import +del install_dict +del install_doc diff --git a/src/sage/combinat/all__sagemath_categories.py b/src/sage/combinat/all__sagemath_categories.py new file mode 100644 index 00000000000..f7ef4460977 --- /dev/null +++ b/src/sage/combinat/all__sagemath_categories.py @@ -0,0 +1,27 @@ +from sage.combinat.matrices.all__sagemath_categories import * + +from sage.misc.lazy_import import lazy_import + +# Integer lists +from sage.combinat.integer_lists import IntegerListsLex +from sage.combinat.integer_vector import IntegerVectors + +from sage.combinat.combinat import (CombinatorialObject, + bell_number, bell_polynomial, bernoulli_polynomial, + catalan_number, euler_number, + fibonacci, fibonacci_sequence, fibonacci_xrange, + lucas_number1, lucas_number2, + number_of_tuples, number_of_unordered_tuples, + polygonal_number, stirling_number1, stirling_number2, + tuples, unordered_tuples) + +from sage.combinat.combination import Combinations +from sage.combinat.composition import Composition, Compositions +from sage.combinat.permutation import Permutation, Permutations, Arrangements, CyclicPermutations, CyclicPermutationsOfPartition +from sage.combinat.subset import Subsets, subsets, powerset, uniq +from sage.combinat.tuple import Tuples, UnorderedTuples + + +from sage.combinat.dlx import DLXMatrix, AllExactCovers, OneExactCover + +del lazy_import diff --git a/src/sage/combinat/composition.py b/src/sage/combinat/composition.py index 173590cfd74..e06aa5830f5 100644 --- a/src/sage/combinat/composition.py +++ b/src/sage/combinat/composition.py @@ -1775,9 +1775,9 @@ def _element_constructor_(self, lst) -> Composition: EXAMPLES:: sage: P = Compositions() - sage: P([3,3,1]) # indirect doctest + sage: P([3,3,1]) # indirect doctest [3, 3, 1] - sage: P(Partition([5,2,1])) + sage: P(Partition([5,2,1])) # needs sage.combinat [5, 2, 1] """ # input can be an iterator, and one has to use it twice diff --git a/src/sage/combinat/matrices/all.py b/src/sage/combinat/matrices/all.py index 0f6adbb5355..92df248b91b 100644 --- a/src/sage/combinat/matrices/all.py +++ b/src/sage/combinat/matrices/all.py @@ -10,10 +10,14 @@ from sage.misc.namespace_package import install_doc install_doc(__package__, __doc__) +from sage.combinat.matrices.all__sagemath_categories import * + from sage.misc.lazy_import import lazy_import lazy_import('sage.combinat.matrices.latin', ['LatinSquare', 'LatinSquare_generator']) -lazy_import('sage.combinat.matrices.dlxcpp', 'DLXCPP') lazy_import('sage.combinat.matrices.hadamard_matrix', ['hadamard_matrix', 'hadamard_matrix_www']) + +del install_doc +del lazy_import diff --git a/src/sage/combinat/matrices/all__sagemath_categories.py b/src/sage/combinat/matrices/all__sagemath_categories.py new file mode 100644 index 00000000000..b168b0b1127 --- /dev/null +++ b/src/sage/combinat/matrices/all__sagemath_categories.py @@ -0,0 +1,4 @@ +from sage.misc.lazy_import import lazy_import + +lazy_import('sage.combinat.matrices.dlxcpp', 'DLXCPP') +del lazy_import diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index 53901bb3c17..faea652244d 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -250,7 +250,6 @@ from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets from sage.categories.sets_with_grading import SetsWithGrading from sage.combinat.backtrack import GenericBacktracker -from sage.combinat.SJT import SJT from sage.combinat.combinat import CombinatorialElement, catalan_number from sage.combinat.combinatorial_map import combinatorial_map from sage.combinat.composition import Composition @@ -270,6 +269,7 @@ from sage.structure.element import Element, get_coercion_model from sage.structure.unique_representation import UniqueRepresentation +lazy_import('sage.combinat.SJT', 'SJT') lazy_import('sage.combinat.rsk', ['RSK', 'RSK_inverse']) lazy_import('sage.combinat.tableau', 'Tableau') lazy_import('sage.combinat.words.finite_word', 'evaluation_dict') @@ -394,6 +394,7 @@ class Permutation(CombinatorialElement): Generate permutations using the Steinhaus-Johnson Trotter algorithm. The output is not in lexicographic order:: + sage: # needs sage.combinat sage: p = Permutation([1, 2, 3, 4], algorithm='sjt'); p [1, 2, 3, 4] sage: p = p.next(); p @@ -405,7 +406,6 @@ class Permutation(CombinatorialElement): ....: p = p.next() sage: p False - sage: Permutation([1, 3, 2, 4], algorithm='sjt') Traceback (most recent call last): ... @@ -575,13 +575,13 @@ def __init__(self, parent, l, algorithm='lex', sjt=None, check=True): 5. Some element may be repeated, or an element is missing, but there is something wrong with its length. - sage: Permutation([1, 3, 2], algorithm='sjt') + sage: Permutation([1, 3, 2], algorithm='sjt') # needs sage.combinat Traceback (most recent call last): ... ValueError: no internal state directions were given for non-identity starting permutation for Steinhaus-Johnson-Trotter algorithm - sage: Permutation([1, 3, 2], algorithm='sjt', check=False) + sage: Permutation([1, 3, 2], algorithm='sjt', check=False) # needs sage.combinat Traceback (most recent call last): ... ValueError: no internal state directions were given for non-identity @@ -800,7 +800,7 @@ def order(self) -> Integer: EXAMPLES:: sage: sigma = Permutation([3,4,1,2,5]) - sage: sigma.order() + sage: sigma.order() # needs sage.combinat 2 sage: sigma * sigma [1, 2, 3, 4, 5] @@ -854,10 +854,10 @@ def __next__(self): sage: p = Permutation([4,3,2,1]) sage: next(p) False - sage: p = Permutation([1, 2, 3], algorithm='sjt') - sage: p = next(p); p + sage: p = Permutation([1, 2, 3], algorithm='sjt') # needs sage.combinat + sage: p = next(p); p # needs sage.combinat [1, 3, 2] - sage: p = next(p); p + sage: p = next(p); p # needs sage.combinat [3, 1, 2] TESTS:: @@ -865,6 +865,8 @@ def __next__(self): sage: p = Permutation([]) sage: next(p) False + + sage: # needs sage.combinat sage: p = Permutation([], algorithm='sjt') sage: next(p) False @@ -944,8 +946,8 @@ def prev(self): sage: p.prev() False - sage: p = Permutation([1,2,3], algorithm='sjt') - sage: p.prev() + sage: p = Permutation([1,2,3], algorithm='sjt') # needs sage.combinat + sage: p.prev() # needs sage.combinat Traceback (most recent call last): ... NotImplementedError: previous permutation for SJT algorithm is not @@ -7197,6 +7199,7 @@ def _element_constructor_(self, x, check=True): Ensure that :issue:`37284` is fixed:: + sage: # needs sage.groups sage: PG = PermutationGroup([[(1,2,3),(5,6)],[(7,8)]]) sage: P8 = Permutations(8) sage: p = PG.an_element() diff --git a/src/sage/crypto/mq/sr.py b/src/sage/crypto/mq/sr.py index 610a97b05fb..6b3724df2ea 100644 --- a/src/sage/crypto/mq/sr.py +++ b/src/sage/crypto/mq/sr.py @@ -3318,7 +3318,7 @@ def test_consistency(max_n=2, **kwargs): has a more reasonable memory usage. :: sage: from sage.crypto.mq.sr import test_consistency - sage: test_consistency(1) # long time (65s on sage.math, 2012) + sage: test_consistency(1) # needs sage.rings.polynomial.pbori, long time (65s on sage.math, 2012) True """ consistent = True diff --git a/src/sage/data_structures/all.py b/src/sage/data_structures/all.py index eac1b4b8931..7062ccf447e 100644 --- a/src/sage/data_structures/all.py +++ b/src/sage/data_structures/all.py @@ -1,2 +1 @@ - -from sage.data_structures.bitset import Bitset, FrozenBitset +from sage.data_structures.all__sagemath_categories import * diff --git a/src/sage/data_structures/all__sagemath_categories.py b/src/sage/data_structures/all__sagemath_categories.py new file mode 100644 index 00000000000..fe98668667d --- /dev/null +++ b/src/sage/data_structures/all__sagemath_categories.py @@ -0,0 +1 @@ +from sage.data_structures.bitset import Bitset, FrozenBitset diff --git a/src/sage/data_structures/binary_search.pxd b/src/sage/data_structures/binary_search.pxd index 5eee088e8b8..afd10246a97 100644 --- a/src/sage/data_structures/binary_search.pxd +++ b/src/sage/data_structures/binary_search.pxd @@ -1,2 +1,2 @@ cdef Py_ssize_t binary_search(Py_ssize_t* v, Py_ssize_t n, Py_ssize_t x, Py_ssize_t* ins) noexcept -cdef Py_ssize_t binary_search0(Py_ssize_t* v, Py_ssize_t n, Py_ssize_t x) noexcept \ No newline at end of file +cdef Py_ssize_t binary_search0(Py_ssize_t* v, Py_ssize_t n, Py_ssize_t x) noexcept diff --git a/src/sage/doctest/util.py b/src/sage/doctest/util.py index ed831598e65..e6761741c50 100644 --- a/src/sage/doctest/util.py +++ b/src/sage/doctest/util.py @@ -360,6 +360,7 @@ def annotate(self, object): EXAMPLES:: + sage: # needs sage.schemes sage: from sage.doctest.util import Timer sage: Timer().start().annotate(EllipticCurve) sage: EllipticCurve.cputime # random diff --git a/src/sage/ext/all__sagemath_categories.py b/src/sage/ext/all__sagemath_categories.py new file mode 100644 index 00000000000..ec13d6e405f --- /dev/null +++ b/src/sage/ext/all__sagemath_categories.py @@ -0,0 +1,2 @@ +from sage.ext.fast_callable import fast_callable +from sage.ext.fast_eval import fast_float diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py index f536665d8cc..c59eb4bf1d0 100644 --- a/src/sage/features/sagemath.py +++ b/src/sage/features/sagemath.py @@ -986,7 +986,7 @@ def __init__(self): """ JoinFeature.__init__(self, 'sage.rings.polynomial.pbori', [PythonModule('sage.rings.polynomial.pbori.pbori')], - spkg='sagemath_brial', type='standard') + spkg='sagemath_brial', type='optional') class sage__rings__real_double(PythonModule): diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py index 5431d15ce18..fab093343d3 100644 --- a/src/sage/functions/hypergeometric.py +++ b/src/sage/functions/hypergeometric.py @@ -298,7 +298,7 @@ def __call__(self, a, b, z, **kwargs): TESTS:: - sage: hypergeometric([2, 3, 4], [4, 1], 1) + sage: hypergeometric([2, 3, 4], [4, 1], 1) # needs sage.symbolic hypergeometric((2, 3, 4), (4, 1), 1) """ return BuiltinFunction.__call__(self, diff --git a/src/sage/geometry/all__sagemath_categories.py b/src/sage/geometry/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/groups/all.py b/src/sage/groups/all.py index 601ba6c7ec0..dea758f900c 100644 --- a/src/sage/groups/all.py +++ b/src/sage/groups/all.py @@ -1,3 +1,5 @@ +from sage.groups.all__sagemath_categories import * + from sage.misc.lazy_import import lazy_import from sage.groups.pari_group import PariGroup @@ -7,9 +9,6 @@ from sage.groups.perm_gps.all import * -from sage.groups.generic import (discrete_log, discrete_log_rho, discrete_log_lambda, - linear_relation, multiple, multiples, order_from_multiple) - lazy_import('sage.groups.class_function', 'ClassFunction') from sage.groups.additive_abelian.all import * @@ -28,14 +27,13 @@ lazy_import('sage.groups.artin', 'ArtinGroup') lazy_import('sage.groups.raag', 'RightAngledArtinGroup') -lazy_import('sage.groups', 'groups_catalog', 'groups') - lazy_import('sage.groups.semimonomial_transformations.semimonomial_transformation_group', 'SemimonomialTransformationGroup') lazy_import('sage.groups.group_exp', 'GroupExp') lazy_import('sage.groups.group_exp', ['GroupExp_Class', 'GroupExpElement'], deprecation=38238) - lazy_import('sage.groups.group_semidirect_product', 'GroupSemidirectProduct') lazy_import('sage.groups.group_semidirect_product', 'GroupSemidirectProductElement', deprecation=38238) + +del lazy_import diff --git a/src/sage/groups/all__sagemath_categories.py b/src/sage/groups/all__sagemath_categories.py new file mode 100644 index 00000000000..cf28b7d6bff --- /dev/null +++ b/src/sage/groups/all__sagemath_categories.py @@ -0,0 +1,10 @@ +from sage.groups.all__sagemath_objects import * + +from sage.groups.generic import (discrete_log, discrete_log_rho, discrete_log_lambda, + linear_relation, multiple, multiples, order_from_multiple) + +from sage.misc.lazy_import import lazy_import + +lazy_import('sage.groups', 'groups_catalog', 'groups') + +del lazy_import diff --git a/src/sage/groups/all__sagemath_objects.py b/src/sage/groups/all__sagemath_objects.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py index 69acc7c654d..01d6df30262 100644 --- a/src/sage/groups/generic.py +++ b/src/sage/groups/generic.py @@ -1450,6 +1450,8 @@ def has_order(P, n, operation='+'): EXAMPLES:: sage: from sage.groups.generic import has_order + + sage: # needs sage.schemes sage: E.

= EllipticCurve(GF(71), [5,5]) sage: P.order() 57 @@ -1468,7 +1470,7 @@ def has_order(P, n, operation='+'): sage: R = Zmod(14981) sage: g = R(321) - sage: g.multiplicative_order() + sage: g.multiplicative_order() # needs sage.libs.pari 42 sage: has_order(g, 42, operation='*') True @@ -1479,6 +1481,7 @@ def has_order(P, n, operation='+'): TESTS:: + sage: # needs sage.modules sage: ns = [randrange(1,10**5) for _ in range(randrange(1,5))] sage: A = AdditiveAbelianGroup(ns) sage: from sage.groups.generic import has_order diff --git a/src/sage/groups/group.pyx b/src/sage/groups/group.pyx index b5047594a9c..6ce96db90bc 100644 --- a/src/sage/groups/group.pyx +++ b/src/sage/groups/group.pyx @@ -33,14 +33,14 @@ def is_Group(x): EXAMPLES:: - sage: F. = FreeGroup() # needs sage.groups sage: from sage.groups.group import is_Group - sage: is_Group(F) # needs sage.groups + sage: is_Group("a string") doctest:warning...DeprecationWarning: use instead G in Groups() See https://github.com/sagemath/sage/issues/37449 for details. - True - sage: is_Group("a string") False + sage: F. = FreeGroup() # needs sage.groups + sage: is_Group(F) # needs sage.groups + True """ deprecation(37449, 'use instead G in Groups()') return isinstance(x, Group) @@ -201,9 +201,10 @@ cdef class Group(Parent): EXAMPLES:: - sage: groups.presentation.Cyclic(1).is_trivial() + sage: groups.presentation.Cyclic(1).is_trivial() # needs sage.groups True + sage: # needs sage.groups sage: G. = FreeGroup('a, b') sage: H = G / (a^2, b^3, a*b*~a*~b) sage: H.is_trivial() @@ -211,6 +212,7 @@ cdef class Group(Parent): A non-trivial presentation of the trivial group:: + sage: # needs sage.groups sage: F. = FreeGroup() sage: J = F / ((~a)*b*a*(~b)^2, (~b)*a*b*(~a)^2) sage: J.is_trivial() diff --git a/src/sage/groups/perm_gps/all__sagemath_categories.py b/src/sage/groups/perm_gps/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/groups/perm_gps/partn_ref/all__sagemath_categories.py b/src/sage/groups/perm_gps/partn_ref/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/interfaces/all__sagemath_categories.py b/src/sage/interfaces/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/libs/all__sagemath_brial.py b/src/sage/libs/all__sagemath_brial.py new file mode 100644 index 00000000000..016ca38a057 --- /dev/null +++ b/src/sage/libs/all__sagemath_brial.py @@ -0,0 +1 @@ +# sage_setup: distribution = sagemath-brial diff --git a/src/sage/libs/polybori/__init__.pxd b/src/sage/libs/polybori/__init__.pxd index 361d7520c13..bc6ce2d1ff6 100644 --- a/src/sage/libs/polybori/__init__.pxd +++ b/src/sage/libs/polybori/__init__.pxd @@ -1 +1,2 @@ +# sage_setup: distribution = sagemath-brial # Insert a comment here to prevent repo corruption. diff --git a/src/sage/libs/polybori/decl.pxd b/src/sage/libs/polybori/decl.pxd index dd6a3aaf0b6..b516710851c 100644 --- a/src/sage/libs/polybori/decl.pxd +++ b/src/sage/libs/polybori/decl.pxd @@ -1,3 +1,4 @@ +# sage_setup: distribution = sagemath-brial # distutils: language = c++ # distutils: extra_compile_args = -std=c++11 diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py index fa14ec98696..0705e0f7858 100644 --- a/src/sage/misc/all.py +++ b/src/sage/misc/all.py @@ -1,137 +1,29 @@ from sage.misc.lazy_attribute import lazy_attribute, lazy_class_attribute -from sage.misc.lazy_import import lazy_import -from sage.misc.all__sagemath_objects import * +# from sage.misc.all__sagemath_objects import * from sage.misc.all__sagemath_environment import * +from sage.misc.all__sagemath_categories import * from sage.misc.all__sagemath_repl import * from sage.misc.misc import (BackslashOperator, - exists, forall, is_iterator, - random_sublist, - pad_zeros, - SAGE_DB, - newton_method_sizes, compose, - nest) - -from sage.misc.banner import version - -from sage.misc.dev_tools import import_statements - -from sage.misc.html import html, pretty_print_default - -from sage.misc.table import table - -from sage.misc.sage_timeit_class import timeit - -from sage.misc.edit_module import edit - -from sage.misc.map_threaded import map_threaded - -from sage.misc.session import load_session, save_session, show_identifiers + exists, forall, is_iterator, + random_sublist, + pad_zeros, + SAGE_DB, + newton_method_sizes, compose, + nest) from sage.misc.remote_file import get_remote_file -from sage.misc.mrange import xmrange, mrange, xmrange_iter, mrange_iter, cartesian_product_iterator - -from sage.misc.fpickle import pickle_function, unpickle_function - lazy_import('sage.misc.pager', 'pager') -lazy_import('sage.misc.sagedoc', ['browse_sage_doc', - 'search_src', 'search_def', 'search_doc', - 'tutorial', 'reference', 'manual', 'developer', - 'constructions', 'help']) -lazy_import('pydoc', 'help', 'python_help') - from sage.misc.classgraph import class_graph -from sage.misc.reset import reset, restore - from sage.misc.mathml import mathml -from sage.misc.defaults import (set_default_variable_name, - series_precision, set_series_precision) - lazy_import("sage.misc.cython", "cython_lambda") lazy_import("sage.misc.cython", "cython_compile", "cython") from sage.misc.func_persist import func_persist -from sage.misc.functional import (additive_order, - base_ring, - base_field, - basis, - category, - charpoly, - characteristic_polynomial, - coerce, - cyclotomic_polynomial, - decomposition, - denominator, - det, - dimension, - dim, - discriminant, - disc, - eta, - fcp, - gen, - gens, - hecke_operator, - image, - integral, integrate, - integral_closure, - interval, - xinterval, - is_even, - is_odd, - kernel, - krull_dimension, - lift, - log as log_b, - minimal_polynomial, - minpoly, - multiplicative_order, - ngens, - norm, - numerator, - numerical_approx, - n, N, - objgens, - objgen, - order, - rank, - regulator, - round, - quotient, - quo, - isqrt, - squarefree_part, - sqrt, - symbolic_sum as sum, - symbolic_prod as product, - transpose) - - -from sage.misc.latex import LatexExpr, latex, view - -from sage.misc.randstate import seed, set_random_seed, initial_seed, current_randstate - -from sage.misc.prandom import * - -from sage.misc.timing import walltime, cputime - -from sage.misc.explain_pickle import explain_pickle, unpickle_newobj, unpickle_global, unpickle_build, unpickle_instantiate, unpickle_persistent, unpickle_extension, unpickle_appends - -lazy_import('sage.misc.inline_fortran', 'fortran') - -lazy_import('sage.misc.banner', 'banner', deprecation=34259) -lazy_import('sage.misc.dev_tools', 'runsnake', deprecation=34259) -lazy_import('sage.misc.edit_module', 'set_edit_template', deprecation=34259) -lazy_import('sage.misc.profiler', 'Profiler', deprecation=34259) -lazy_import('sage.misc.trace', 'trace', deprecation=34259) -lazy_import('sage.misc.package', ('installed_packages', 'is_package_installed', - 'package_versions'), - deprecation=34259) -lazy_import('sage.misc.benchmark', 'benchmark', deprecation=34259) lazy_import('sage.repl.interpreter', 'logstr', deprecation=34259) diff --git a/src/sage/misc/all__sagemath_categories.py b/src/sage/misc/all__sagemath_categories.py new file mode 100644 index 00000000000..0806bdf7aec --- /dev/null +++ b/src/sage/misc/all__sagemath_categories.py @@ -0,0 +1,77 @@ + +from sage.misc.all__sagemath_objects import * + +from sage.misc.html import html, pretty_print_default + +from sage.misc.mathml import mathml + +from sage.misc.table import table + +from sage.misc.map_threaded import map_threaded + +from sage.misc.mrange import xmrange, mrange, xmrange_iter, mrange_iter, cartesian_product_iterator + +from sage.misc.defaults import (set_default_variable_name, + series_precision, set_series_precision) + + +from sage.misc.functional import (additive_order, + base_ring, + base_field, + basis, + category, + charpoly, + characteristic_polynomial, + coerce, + cyclotomic_polynomial, + decomposition, + denominator, + det, + dimension, + dim, + discriminant, + disc, + eta, + fcp, + gen, + gens, + hecke_operator, + image, + integral, integrate, + integral_closure, + interval, + xinterval, + is_even, + is_odd, + kernel, + krull_dimension, + lift, + log as log_b, + minimal_polynomial, + minpoly, + multiplicative_order, + ngens, + norm, + numerator, + numerical_approx, + n, N, + objgens, + objgen, + order, + rank, + regulator, + round, + quotient, + quo, + isqrt, + squarefree_part, + sqrt, + symbolic_sum as sum, + symbolic_prod as product, + transpose) + +from sage.misc.latex import LatexExpr, latex, view + +from sage.misc.fpickle import pickle_function, unpickle_function + +from sage.misc.persist import unpickle_global diff --git a/src/sage/misc/all__sagemath_objects.py b/src/sage/misc/all__sagemath_objects.py index 634584c5567..8dda37eb313 100644 --- a/src/sage/misc/all__sagemath_objects.py +++ b/src/sage/misc/all__sagemath_objects.py @@ -35,3 +35,9 @@ from sage.misc.abstract_method import abstract_method from sage.misc.timing import walltime, cputime + +from sage.misc.randstate import seed, set_random_seed, initial_seed, current_randstate +from sage.misc.prandom import * +from sage.misc.sage_timeit_class import timeit +from sage.misc.session import load_session, save_session, show_identifiers +from sage.misc.reset import reset, restore diff --git a/src/sage/misc/all__sagemath_repl.py b/src/sage/misc/all__sagemath_repl.py index 9631c49d0bd..a43e127eb22 100644 --- a/src/sage/misc/all__sagemath_repl.py +++ b/src/sage/misc/all__sagemath_repl.py @@ -1,4 +1,46 @@ # sage_setup: distribution = sagemath-repl + +from sage.misc.all__sagemath_objects import * + from sage.misc.sage_eval import sage_eval, sageobj from sage.misc.sage_input import sage_input + +from sage.misc.banner import version + +lazy_import('sage.misc.banner', 'banner', deprecation=34259) + +lazy_import('sage.misc.sagedoc', ['browse_sage_doc', + 'search_src', 'search_def', 'search_doc', + 'tutorial', 'reference', 'manual', 'developer', + 'constructions', 'help']) + +lazy_import('pydoc', 'help', 'python_help') + +from sage.misc.explain_pickle import (explain_pickle, unpickle_newobj, unpickle_build, + unpickle_instantiate, unpickle_persistent, + unpickle_extension, unpickle_appends) + +lazy_import('sage.misc.trace', 'trace', deprecation=34259) + +lazy_import('sage.misc.profiler', 'Profiler', deprecation=34259) + +from sage.misc.dev_tools import import_statements + +lazy_import('sage.misc.dev_tools', 'runsnake', deprecation=34259) + +from sage.misc.edit_module import edit + +lazy_import('sage.misc.edit_module', 'set_edit_template', deprecation=34259) + +lazy_import('sage.misc.pager', 'pager') + + +lazy_import("sage.misc.cython", "cython_lambda") +lazy_import("sage.misc.cython", "cython_compile", "cython") +lazy_import('sage.misc.inline_fortran', 'fortran') + +lazy_import('sage.misc.package', ('installed_packages', 'is_package_installed', + 'package_versions'), + deprecation=34259) +lazy_import('sage.misc.benchmark', 'benchmark', deprecation=34259) diff --git a/src/sage/misc/citation.pyx b/src/sage/misc/citation.pyx index fbe932ba49a..60ed09dbfa2 100644 --- a/src/sage/misc/citation.pyx +++ b/src/sage/misc/citation.pyx @@ -44,7 +44,7 @@ systems['MPFI'] = ['sage.rings.real_mpfi', 'sage.rings.complex_interval'] systems['M4RI'] = ['sage.matrix.matrix_mod2_dense'] systems['Givaro'] = ['sage.rings.finite_rings.element_givaro'] -systems['PolyBoRi'] = ['sage.rings.polynomial.pbori'] +systems['PolyBoRi'] = ['sage.rings.polynomial.pbori.pbori'] def get_systems(cmd): diff --git a/src/sage/misc/dev_tools.py b/src/sage/misc/dev_tools.py index b11b2078129..76fe5b97659 100644 --- a/src/sage/misc/dev_tools.py +++ b/src/sage/misc/dev_tools.py @@ -147,6 +147,7 @@ def load_submodules(module=None, exclude_pattern=None): EXAMPLES:: sage: sage.misc.dev_tools.load_submodules(sage.combinat) + load sage.combinat.SJT... succeeded load sage.combinat.algebraic_combinatorics... succeeded ... load sage.combinat.words.suffix_trees... succeeded @@ -277,6 +278,8 @@ def find_objects_from_name(name, module_name=None, include_lazy_imports=False): for smodule_name, smodule in sys.modules.items(): if module_name and not smodule_name.startswith(module_name): continue + if smodule_name.rpartition('.')[2].startswith('all__sagemath_'): + continue if hasattr(smodule, '__dict__') and name in smodule.__dict__: u = smodule.__dict__[name] if (not isinstance(u, LazyImport) or include_lazy_imports) and all(v is not u for v in obj): diff --git a/src/sage/misc/package_dir.py b/src/sage/misc/package_dir.py index b15374e3bbc..753e291f8e2 100644 --- a/src/sage/misc/package_dir.py +++ b/src/sage/misc/package_dir.py @@ -481,6 +481,7 @@ def _distribution_from_all_filename(filename): if distribution == 'all': distributions = ["sagemath-bliss", + "sagemath-brial", "sagemath-coxeter3", "sagemath-mcqd", "sagemath-meataxe", diff --git a/src/sage/misc/search.pxd b/src/sage/misc/search.pxd index 8cc43ba1b0f..f73e9061b8d 100644 --- a/src/sage/misc/search.pxd +++ b/src/sage/misc/search.pxd @@ -1 +1 @@ -cpdef search(object v, object x) \ No newline at end of file +cpdef search(object v, object x) diff --git a/src/sage/modules/all__sagemath_objects.py b/src/sage/modules/all__sagemath_objects.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/modules/module.pyx b/src/sage/modules/module.pyx index 1ca79818c26..f4921ccb31c 100644 --- a/src/sage/modules/module.pyx +++ b/src/sage/modules/module.pyx @@ -276,15 +276,15 @@ def is_Module(x): EXAMPLES:: sage: from sage.modules.module import is_Module - sage: M = FreeModule(RationalField(),30) # needs sage.modules - sage: is_Module(M) # needs sage.modules + sage: is_Module(10) doctest:warning... DeprecationWarning: the function is_Module is deprecated; use 'isinstance(..., Module)' instead See https://github.com/sagemath/sage/issues/37924 for details. - True - sage: is_Module(10) False + sage: M = FreeModule(RationalField(),30) # needs sage.modules + sage: is_Module(M) # needs sage.modules + True """ from sage.misc.superseded import deprecation_cython deprecation_cython(37924, "the function is_Module is deprecated; use 'isinstance(..., Module)' instead") diff --git a/src/sage/monoids/all__sagemath_categories.py b/src/sage/monoids/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/numerical/all__sagemath_categories.py b/src/sage/numerical/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/numerical/backends/all__sagemath_categories.py b/src/sage/numerical/backends/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/rings/all.py b/src/sage/rings/all.py index e3c7167fe12..d1cbc6d57ab 100644 --- a/src/sage/rings/all.py +++ b/src/sage/rings/all.py @@ -14,48 +14,9 @@ from sage.rings.all__sagemath_categories import * -# Ring base classes -from sage.rings.ring import (Ring, Field, CommutativeRing, IntegralDomain, - PrincipalIdealDomain) - -lazy_import("sage.rings.ring", "DedekindDomain") - -# Ring element base classes -from sage.structure.element import (CommutativeAlgebraElement, - RingElement, CommutativeRingElement, IntegralDomainElement, - DedekindDomainElement, PrincipalIdealDomainElement, - EuclideanDomainElement, FieldElement) - -# Ideals -from sage.rings.ideal import Ideal -ideal = Ideal - -# Quotient -from sage.rings.quotient_ring import QuotientRing - -# Infinities -from sage.rings.infinity import infinity, Infinity, InfinityRing, unsigned_infinity, UnsignedInfinityRing - -# Rational integers. -from sage.rings.integer_ring import IntegerRing, ZZ, crt_basis -from sage.rings.integer import Integer - -# Rational numbers -from sage.rings.rational_field import RationalField, QQ -from sage.rings.rational import Rational -Rationals = RationalField - -# Integers modulo n. -from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod -from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod -Integers = IntegerModRing - # Finite fields from sage.rings.finite_rings.all import * -# Number field -from sage.rings.number_field.all import * - # Function field from sage.rings.function_field.all import * @@ -66,6 +27,9 @@ from sage.rings.padics.all import * from sage.rings.padics.padic_printing import _printer_defaults as padic_printing +# Pseudo-ring of PARI objects. +from sage.rings.pari_ring import PariRing, Pari + # valuations from sage.rings.valuation.all import * @@ -74,12 +38,20 @@ # Real numbers from sage.rings.real_mpfr import (RealField, RR, - create_RealNumber as RealNumber) # this is used by the preparser to wrap real literals -- very important. + create_RealNumber as RealNumber) # this is used by the preparser to wrap real literals -- very important. + +# Lazy Laurent series ring +lazy_import('sage.rings.lazy_series_ring', ['LazyLaurentSeriesRing', 'LazyPowerSeriesRing', + 'LazySymmetricFunctions', 'LazyDirichletSeriesRing']) + +# Tate algebras +from sage.rings.tate_algebra import TateAlgebra + Reals = RealField -from sage.rings.real_double import RealDoubleField, RDF, RealDoubleElement +# Number field +from sage.rings.number_field.all import * -from sage.rings.real_lazy import RealLazyField, RLF, ComplexLazyField, CLF from sage.rings.real_arb import RealBallField, RBF @@ -115,35 +87,6 @@ lazy_import("sage.rings.imaginary_unit", "I") -# Power series rings -from sage.rings.power_series_ring import PowerSeriesRing - -# Laurent series ring in one variable -from sage.rings.laurent_series_ring import LaurentSeriesRing - -# Lazy Laurent series ring -lazy_import('sage.rings.lazy_series_ring', ['LazyLaurentSeriesRing', 'LazyPowerSeriesRing', - 'LazySymmetricFunctions', 'LazyDirichletSeriesRing']) - -# Tate algebras -from sage.rings.tate_algebra import TateAlgebra - -# Puiseux series ring -from sage.rings.puiseux_series_ring import PuiseuxSeriesRing - -# Pseudo-ring of PARI objects. -from sage.rings.pari_ring import PariRing, Pari - -# Big-oh notation -from sage.rings.big_oh import O - -# Fraction field -from sage.rings.fraction_field import FractionField -Frac = FractionField - -# Localization -from sage.rings.localization import Localization - # c-finite sequences from sage.rings.cfinite_sequence import CFiniteSequence, CFiniteSequences @@ -168,3 +111,4 @@ # Register classes in numbers abc from sage.rings import numbers_abc +del lazy_import diff --git a/src/sage/rings/all__sagemath_brial.py b/src/sage/rings/all__sagemath_brial.py new file mode 100644 index 00000000000..016ca38a057 --- /dev/null +++ b/src/sage/rings/all__sagemath_brial.py @@ -0,0 +1 @@ +# sage_setup: distribution = sagemath-brial diff --git a/src/sage/rings/all__sagemath_categories.py b/src/sage/rings/all__sagemath_categories.py index 4c0efe7b507..85c1414a1af 100644 --- a/src/sage/rings/all__sagemath_categories.py +++ b/src/sage/rings/all__sagemath_categories.py @@ -1,7 +1,92 @@ # sage_setup: distribution = sagemath-categories + +from sage.misc.lazy_import import lazy_import + # Ring base classes -from sage.rings.ring import Ring +from sage.rings.ring import (Ring, Field, CommutativeRing, IntegralDomain, + PrincipalIdealDomain) + +lazy_import("sage.rings.ring", "DedekindDomain") + +# Ring element base classes +from sage.structure.element import (CommutativeAlgebraElement, + RingElement, CommutativeRingElement, IntegralDomainElement, + DedekindDomainElement, PrincipalIdealDomainElement, + EuclideanDomainElement, FieldElement) + +# Integers modulo n. +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod +from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod +Integers = IntegerModRing + +# Quotient +from sage.rings.quotient_ring import QuotientRing + +# Infinities +from sage.rings.infinity import infinity, Infinity, InfinityRing, unsigned_infinity, UnsignedInfinityRing +oo = infinity + +# Rational integers. +from sage.rings.integer_ring import IntegerRing, ZZ, crt_basis +from sage.rings.integer import Integer + +# Rational numbers +from sage.rings.rational import Rational +from sage.rings.rational_field import RationalField, QQ +Rationals = RationalField + +# Integers modulo n. +from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod +from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod +Integers = IntegerModRing + +# Function field +from sage.rings.function_field.all__sagemath_categories import * + +# Double precision floating point numbers +from sage.rings.real_double import RealDoubleField, RDF, RealDoubleElement + +# Lazy reals +from sage.rings.real_lazy import RealLazyField, RLF, ComplexLazyField, CLF + # Ideals from sage.rings.ideal import Ideal - ideal = Ideal + +# Semirings +from sage.rings.semirings.all import * + +from sage.rings.finite_rings.all__sagemath_categories import * +from sage.rings.function_field.all__sagemath_categories import * +from sage.rings.number_field.all__sagemath_categories import * +from sage.rings.padics.all__sagemath_categories import * +from sage.rings.polynomial.all__sagemath_categories import * + +# Power series rings +from sage.rings.power_series_ring import PowerSeriesRing + +# Laurent series ring in one variable +from sage.rings.laurent_series_ring import LaurentSeriesRing + +# Puiseux series ring +from sage.rings.puiseux_series_ring import PuiseuxSeriesRing + +# Big-oh notation +from sage.rings.big_oh import O + +# Fraction field +from sage.rings.fraction_field import FractionField +Frac = FractionField + +# Localization +from sage.rings.localization import Localization + +# continued fractions +from sage.rings.continued_fraction import (continued_fraction, + continued_fraction_list) + +# Preliminary version of real numbers for doctesting without sage.rings.real_mpfr. +# sage.rings.all redefines it. +RealNumber = RR = RDF # used by the preparser to wrap real literals + +del lazy_import diff --git a/src/sage/rings/finite_rings/all.py b/src/sage/rings/finite_rings/all.py index 6d8699c7b25..a3dbfe5764f 100644 --- a/src/sage/rings/finite_rings/all.py +++ b/src/sage/rings/finite_rings/all.py @@ -18,6 +18,4 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** -from sage.rings.finite_rings.finite_field_constructor import FiniteField -from sage.rings.finite_rings.conway_polynomials import conway_polynomial, exists_conway_polynomial -GF = FiniteField +from sage.rings.finite_rings.all__sagemath_categories import * diff --git a/src/sage/rings/finite_rings/all__sagemath_categories.py b/src/sage/rings/finite_rings/all__sagemath_categories.py new file mode 100644 index 00000000000..a2330a07fe4 --- /dev/null +++ b/src/sage/rings/finite_rings/all__sagemath_categories.py @@ -0,0 +1,8 @@ +from sage.rings.finite_rings.finite_field_constructor import FiniteField + +GF = FiniteField + +from sage.rings.finite_rings.conway_polynomials import conway_polynomial, exists_conway_polynomial + +# Finite residue fields +from sage.rings.finite_rings.residue_field import ResidueField diff --git a/src/sage/rings/finite_rings/integer_mod.pyx b/src/sage/rings/finite_rings/integer_mod.pyx index 0b220e81a1e..59248ef391c 100644 --- a/src/sage/rings/finite_rings/integer_mod.pyx +++ b/src/sage/rings/finite_rings/integer_mod.pyx @@ -767,8 +767,8 @@ cdef class IntegerMod_abstract(FiniteRingElement): An example for ``check=True``:: sage: F = GF(127, impl='modn') - sage: t = F.primitive_element() - sage: t.log(t, 57, check=True) + sage: t = F.primitive_element() # needs sage.libs.pari + sage: t.log(t, 57, check=True) # needs sage.libs.pari Traceback (most recent call last): ... ValueError: base does not have the provided order diff --git a/src/sage/rings/fraction_field.py b/src/sage/rings/fraction_field.py index 4e3e923c263..974e725486a 100644 --- a/src/sage/rings/fraction_field.py +++ b/src/sage/rings/fraction_field.py @@ -58,6 +58,7 @@ Test that :issue:`15971` is fixed:: + sage: # needs sage.libs.singular sage: for B in [QQ['t'], QQ['s, t'], ZZ['t'], ZZ['s, t']]: ....: F = B.fraction_field() ....: R = F['x, y'] @@ -251,6 +252,7 @@ def _coerce_map_from_(self, S): Test coercions:: + sage: # needs sage.libs.singular sage: F.coerce(1) 1 sage: F.coerce(int(1)) @@ -260,6 +262,7 @@ def _coerce_map_from_(self, S): :: + sage: # needs sage.libs.singular sage: K = ZZ['x,y'].fraction_field() sage: x,y = K.gens() sage: F.coerce(F.gen()) @@ -563,6 +566,7 @@ def _element_constructor_(self, x, y=None, coerce=True): EXAMPLES:: + sage: # needs sage.libs.singular sage: F = QQ['x,y'].fraction_field() sage: F._element_constructor_(1) 1 @@ -870,6 +874,7 @@ def _is_valid_homomorphism_(self, codomain, im_gens, base_map=None): Test homomorphisms:: + sage: # needs sage.libs.singular sage: phi = F.hom([2*y, x]) sage: phi(x+y) x + 2*y @@ -947,6 +952,7 @@ def _gcd_univariate_polynomial(self, f, g): TESTS:: + sage: # needs sage.libs.singular sage: A. = ZZ[] sage: C. = Frac(A)[] sage: c = (2*y^2 - 11*x - 2*y + 1)/(-x^2 + x*y - 2*y^2) diff --git a/src/sage/rings/fraction_field_element.pyx b/src/sage/rings/fraction_field_element.pyx index 3d14ab66134..a2d7eabd615 100644 --- a/src/sage/rings/fraction_field_element.pyx +++ b/src/sage/rings/fraction_field_element.pyx @@ -140,8 +140,9 @@ cdef class FractionFieldElement(FieldElement): :: + sage: # needs sage.libs.singular sage: phi = F.hom([a + b, a*b], K) - sage: phi(x+y) # indirect doctest + sage: phi(x + y) # indirect doctest a*b + a + b :: @@ -226,6 +227,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: R. = ZZ[] sage: f = x/y + 1; f (x + y)/y @@ -241,6 +243,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: R. = ZZ[] sage: f = x/y + 1; f (x + y)/y @@ -255,6 +258,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: R. = ZZ[] sage: f = x/y + 1; f (x + y)/y @@ -368,21 +372,23 @@ cdef class FractionFieldElement(FieldElement): sage: d={x:1} sage: d[FractionField(R).0] 1 - sage: R.=ZZ[] # this probably has a separate implementation from ZZ[] - sage: hash(R.0)==hash(FractionField(R).0) + + sage: # needs sage.libs.singular + sage: R. = ZZ[] # this probably has a separate implementation from ZZ[] + sage: hash(R.0) == hash(FractionField(R).0) True - sage: d={x:1} + sage: d = {x: 1} sage: d[FractionField(R).0] 1 - sage: R.=QQ[] # this probably has a separate implementation from ZZ[] - sage: hash(R.0)==hash(FractionField(R).0) + sage: R. = QQ[] # this probably has a separate implementation from ZZ[] + sage: hash(R.0) == hash(FractionField(R).0) True - sage: ((x+1)/(x^2+1)).subs({x:1}) + sage: ((x+1)/(x^2+1)).subs({x: 1}) 1 - sage: d={x:1} + sage: d = {x: 1} sage: d[FractionField(R).0] 1 - sage: hash(R(1)/R(2))==hash(1/2) + sage: hash(R(1)/R(2)) == hash(1/2) True Check that :issue:`16268` is fixed:: @@ -437,7 +443,8 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: - sage: x = PolynomialRing(RationalField(),'x',3).gens() + sage: # needs sage.libs.singular + sage: x = PolynomialRing(RationalField(), 'x', 3).gens() sage: f = x[0] + x[1] - 2*x[1]*x[2] sage: f -2*x1*x2 + x0 + x1 @@ -466,7 +473,7 @@ cdef class FractionFieldElement(FieldElement): sage: x, y = PolynomialRing(ZZ, 2, 'xy').gens() sage: f = x^2 + y + x^2*y^2 + 5 - sage: (1/f).subs(x=5) + sage: (1/f).subs(x=5) # needs sage.libs.singular 1/(25*y^2 + y + 30) TESTS: @@ -477,7 +484,7 @@ cdef class FractionFieldElement(FieldElement): sage: PF = P.fraction_field() sage: p = sum(i*P.gen(i) for i in range(5)) / sum(i*P.gen(i) for i in range(8)) sage: v = P.gen(4) - sage: p.subs({v: 100}) + sage: p.subs({v: 100}) # needs sage.libs.singular (x1 + 2*x2 + 3*x3 + 400)/(x1 + 2*x2 + 3*x3 + 5*x5 + 6*x6 + 7*x7 + 400) """ if isinstance(in_dict, dict): @@ -602,13 +609,15 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: K. = Frac(ZZ['x,y']) - sage: x+y # indirect doctest + sage: x + y # indirect doctest x + y sage: 1/x + 1/y (x + y)/(x*y) sage: 1/x + 1/(x*y) (y + 1)/(x*y) + sage: Frac(CDF['x']).gen() + 3 # needs sage.rings.complex_double x + 3.0 @@ -749,6 +758,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: K. = Frac(ZZ['x,y,z']) sage: a = (x+1)*(x+y)/(z-3) # indirect doctest sage: b = (x+y)/(z-1) @@ -792,6 +802,7 @@ cdef class FractionFieldElement(FieldElement): """ EXAMPLES:: + sage: # needs sage.libs.singular sage: K. = Frac(ZZ['x,y']) sage: float(x/x + y/y) 2.0 @@ -908,11 +919,11 @@ cdef class FractionFieldElement(FieldElement): sage: x^0 1 - sage: ((x+y)/(x-y))^2 + sage: ((x+y)/(x-y))^2 # needs sage.libs.singular (x^2 + 2*x*y + y^2)/(x^2 - 2*x*y + y^2) - sage: ((x+y)/(x-y))^-2 + sage: ((x+y)/(x-y))^-2 # needs sage.libs.singular (x^2 - 2*x*y + y^2)/(x^2 + 2*x*y + y^2) - sage: ((x+y)/(x-y))^0 + sage: ((x+y)/(x-y))^0 # needs sage.libs.singular 1 """ snum = ( self)._numerator @@ -985,6 +996,7 @@ cdef class FractionFieldElement(FieldElement): :: + sage: # needs sage.libs.singular sage: K. = Frac(ZZ['x,y']) sage: x > y True @@ -1020,6 +1032,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: F = ZZ['x,y'].fraction_field() sage: x,y = F.gens() sage: t = F(0)/x @@ -1028,7 +1041,7 @@ cdef class FractionFieldElement(FieldElement): :: - sage: bool(1/x) + sage: bool(1/x) # needs sage.libs.singular True """ return not self._numerator.is_zero() @@ -1039,6 +1052,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: F = ZZ['x,y'].fraction_field() sage: x,y = F.gens() sage: t = F(0)/x @@ -1058,6 +1072,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: F = ZZ['x,y'].fraction_field() sage: x,y = F.gens() sage: (x/x).is_one() @@ -1075,6 +1090,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: F = ZZ['x,y'].fraction_field() sage: x,y = F.gens() sage: elt = (2*x + 2*y) / (3*x - 3*y); elt @@ -1092,6 +1108,7 @@ cdef class FractionFieldElement(FieldElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: F = ZZ['x,y'].fraction_field() sage: f = F.random_element() sage: loads(f.dumps()) == f @@ -1125,6 +1142,7 @@ cdef class FractionFieldElement(FieldElement): TESTS:: + sage: # needs sage.libs.singular sage: R. = ZZ[] sage: (~(y+z))._evaluate_polynomial(pol) (y^3 + 3*y^2*z + 3*y*z^2 + z^3 + 1)/(y^3 + 3*y^2*z + 3*y*z^2 + z^3) @@ -1285,6 +1303,7 @@ def make_element(parent, numerator, denominator): EXAMPLES:: + sage: # needs sage.libs.singular sage: from sage.rings.fraction_field_element import make_element sage: R = ZZ['x,y'] sage: x,y = R.gens() diff --git a/src/sage/rings/function_field/all.py b/src/sage/rings/function_field/all.py index b423a0d58f5..1d6db9e4516 100644 --- a/src/sage/rings/function_field/all.py +++ b/src/sage/rings/function_field/all.py @@ -1,5 +1,6 @@ -from sage.rings.function_field.constructor import FunctionField +from sage.rings.function_field.all__sagemath_categories import * from sage.misc.lazy_import import lazy_import lazy_import("sage.rings.function_field.drinfeld_modules.drinfeld_module", "DrinfeldModule") +del lazy_import diff --git a/src/sage/rings/function_field/all__sagemath_categories.py b/src/sage/rings/function_field/all__sagemath_categories.py new file mode 100644 index 00000000000..1cc1f1b8b2f --- /dev/null +++ b/src/sage/rings/function_field/all__sagemath_categories.py @@ -0,0 +1 @@ +from sage.rings.function_field.constructor import FunctionField diff --git a/src/sage/rings/function_field/function_field.py b/src/sage/rings/function_field/function_field.py index 401b2144be9..b13a7414f27 100644 --- a/src/sage/rings/function_field/function_field.py +++ b/src/sage/rings/function_field/function_field.py @@ -1257,6 +1257,7 @@ def hilbert_symbol(self, a, b, P): EXAMPLES:: + sage: # needs sage.libs.pari sage: K. = FunctionField(GF(17)) sage: P = K.places()[0]; P Place (1/x) @@ -1264,7 +1265,6 @@ def hilbert_symbol(self, a, b, P): sage: b = 7/x sage: K.hilbert_symbol(a, b, P) -1 - sage: Q = K.places()[7]; Q Place (x + 6) sage: c = 15*x + 12 @@ -1274,6 +1274,7 @@ def hilbert_symbol(self, a, b, P): Check that the Hilbert symbol is symmetric and bimultiplicative:: + sage: # needs sage.libs.pari sage: K. = FunctionField(GF(5)); R. = PolynomialRing(K) sage: f = ((x^2 + 2*x + 2)*T^5 + (4*x^2 + 2*x + 3)*T^4 + 3*T^3 + 4*T^2 ....: + (2/(x^2 + 4*x + 1))*T + 3*x^2 + 2*x + 4) @@ -1283,7 +1284,6 @@ def hilbert_symbol(self, a, b, P): sage: c = L.random_element() sage: P = L.places_above(K.places()[0])[1] sage: Q = L.places_above(K.places()[1])[0] - sage: hP_a_c = L.hilbert_symbol(a, c, P) sage: hP_a_c == L.hilbert_symbol(c, a, P) True @@ -1291,7 +1291,6 @@ def hilbert_symbol(self, a, b, P): True sage: hP_a_c * L.hilbert_symbol(b, c, P) == L.hilbert_symbol(a*b, c, P) True - sage: hQ_a_c = L.hilbert_symbol(a, c, Q) sage: hQ_a_c == L.hilbert_symbol(c, a, Q) True @@ -1397,6 +1396,7 @@ def jacobian(self, model=None, base_div=None, **kwds): EXAMPLES:: + sage: # needs sage.schemes sage: A. = AffineSpace(GF(5), 2) sage: C = Curve(y^2*(x^3 - 1) - (x^3 - 2)) sage: F = C.function_field() @@ -1405,6 +1405,7 @@ def jacobian(self, model=None, base_div=None, **kwds): TESTS: + sage: # needs sage.schemes sage: A. = AffineSpace(QQ, 2) sage: C = Curve(y^2 - x^3 - 1, A).projective_closure() sage: C.jacobian(model='hess') diff --git a/src/sage/rings/function_field/jacobian_base.py b/src/sage/rings/function_field/jacobian_base.py index 405d90bfc3f..f225b7bc96f 100644 --- a/src/sage/rings/function_field/jacobian_base.py +++ b/src/sage/rings/function_field/jacobian_base.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.schemes r""" Jacobians of function fields diff --git a/src/sage/rings/function_field/jacobian_hess.py b/src/sage/rings/function_field/jacobian_hess.py index a85bc10e256..2e5923e3de6 100644 --- a/src/sage/rings/function_field/jacobian_hess.py +++ b/src/sage/rings/function_field/jacobian_hess.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.schemes r""" Jacobians in Hess model diff --git a/src/sage/rings/function_field/jacobian_khuri_makdisi.py b/src/sage/rings/function_field/jacobian_khuri_makdisi.py index 2c9a2e5da97..a9c743e10f8 100644 --- a/src/sage/rings/function_field/jacobian_khuri_makdisi.py +++ b/src/sage/rings/function_field/jacobian_khuri_makdisi.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.schemes r""" Jacobians in Khuri-Makdisi model diff --git a/src/sage/rings/generic.py b/src/sage/rings/generic.py index bfcb1d2bc50..bc133ae4cb7 100644 --- a/src/sage/rings/generic.py +++ b/src/sage/rings/generic.py @@ -223,6 +223,7 @@ def interpolation(self, xs): EXAMPLES:: + sage: # needs sage.libs.pari sage: from sage.rings.generic import ProductTree sage: vs = prime_range(100) sage: tree = ProductTree(vs) @@ -232,6 +233,7 @@ def interpolation(self, xs): This method is faster than :func:`CRT` for repeated calls with the same moduli:: + sage: # needs sage.libs.pari sage: vs = prime_range(1000,2000) sage: rs = lambda: [randrange(1,100) for _ in vs] sage: tree = ProductTree(vs) diff --git a/src/sage/rings/laurent_series_ring.py b/src/sage/rings/laurent_series_ring.py index 2142f717460..8a2381e525e 100644 --- a/src/sage/rings/laurent_series_ring.py +++ b/src/sage/rings/laurent_series_ring.py @@ -51,6 +51,7 @@ pari_gen = () lazy_import('sage.rings.polynomial.laurent_polynomial_ring_base', 'LaurentPolynomialRing_generic') +lazy_import('sage.rings.lazy_series', ['LazyPowerSeries', 'LazyLaurentSeries']) lazy_import('sage.rings.lazy_series_ring', ('LazyPowerSeriesRing', 'LazyLaurentSeriesRing')) lazy_import('sage.rings.polynomial.polynomial_ring', 'PolynomialRing_general') lazy_import('sage.rings.power_series_ring', 'PowerSeriesRing_generic') @@ -73,8 +74,8 @@ def is_LaurentSeriesRing(x): use 'isinstance(..., (LaurentSeriesRing, LazyLaurentSeriesRing))' instead. See https://github.com/sagemath/sage/issues/38290 for details. True - sage: L. = LazyLaurentSeriesRing(QQ) - sage: is_LaurentSeriesRing(L) + sage: L. = LazyLaurentSeriesRing(QQ) # needs sage.combinat + sage: is_LaurentSeriesRing(L) # needs sage.combinat True """ from sage.misc.superseded import deprecation @@ -459,6 +460,7 @@ def _element_constructor_(self, x, n=0, prec=infinity): Lazy series:: + sage: # needs sage.combinat sage: L. = LazyLaurentSeriesRing(ZZ) sage: R = LaurentSeriesRing(QQ, names='z') sage: R(z^-5 + 1/(1-z)) @@ -517,7 +519,6 @@ def _element_constructor_(self, x, n=0, prec=infinity): x^-3 """ from sage.rings.fraction_field_element import FractionFieldElement - from sage.rings.lazy_series import LazyPowerSeries, LazyLaurentSeries from sage.rings.polynomial.multi_polynomial import MPolynomial from sage.rings.polynomial.polynomial_element import Polynomial from sage.structure.element import parent @@ -655,9 +656,9 @@ def _coerce_map_from_(self, P): True sage: S.has_coerce_map_from(S) True - sage: S.has_coerce_map_from(LazyLaurentSeriesRing(ZZ, 't')) + sage: S.has_coerce_map_from(LazyLaurentSeriesRing(ZZ, 't')) # needs sage.combinat True - sage: S.has_coerce_map_from(LazyPowerSeriesRing(ZZ, 't')) + sage: S.has_coerce_map_from(LazyPowerSeriesRing(ZZ, 't')) # needs sage.combinat True sage: S.has_coerce_map_from(QQ) @@ -682,9 +683,9 @@ def _coerce_map_from_(self, P): False sage: R.has_coerce_map_from(ZZ['x']) True - sage: R.has_coerce_map_from(LazyLaurentSeriesRing(ZZ, 't')) + sage: R.has_coerce_map_from(LazyLaurentSeriesRing(ZZ, 't')) # needs sage.combinat True - sage: R.has_coerce_map_from(LazyLaurentSeriesRing(ZZ['x'], 't')) + sage: R.has_coerce_map_from(LazyLaurentSeriesRing(ZZ['x'], 't')) # needs sage.combinat True """ A = self.base_ring() diff --git a/src/sage/rings/laurent_series_ring_element.pyx b/src/sage/rings/laurent_series_ring_element.pyx index 405752c6191..b059d2dd3f0 100644 --- a/src/sage/rings/laurent_series_ring_element.pyx +++ b/src/sage/rings/laurent_series_ring_element.pyx @@ -1413,6 +1413,7 @@ cdef class LaurentSeries(AlgebraElement): EXAMPLES:: + sage: # needs sage.libs.pari sage: R. = Frac(QQ[['x']]) sage: f = 2*x + 3*x^2 - x^4 + O(x^5) sage: g = f.reverse() @@ -1423,6 +1424,7 @@ cdef class LaurentSeries(AlgebraElement): sage: g(f) x + O(x^5) + sage: # needs sage.libs.pari sage: A. = LaurentSeriesRing(ZZ) sage: a = t - t^2 - 2*t^4 + t^5 + O(t^6) sage: b = a.reverse(); b @@ -1432,6 +1434,7 @@ cdef class LaurentSeries(AlgebraElement): sage: b(a) t + O(t^6) + sage: # needs sage.libs.pari sage: B. = ZZ[ ] sage: A. = LaurentSeriesRing(B) sage: f = t + b*t^2 + c*t^3 + O(t^4) @@ -1442,6 +1445,7 @@ cdef class LaurentSeries(AlgebraElement): sage: g(f) t + O(t^4) + sage: # needs sage.libs.pari sage: A. = PowerSeriesRing(ZZ) sage: B. = LaurentSeriesRing(A) sage: f = (1 - 3*t + 4*t^3 + O(t^4))*s + (2 + t + t^2 + O(t^3))*s^2 + O(s^3) @@ -1456,11 +1460,13 @@ cdef class LaurentSeries(AlgebraElement): If the leading coefficient is not a unit, we pass to its fraction field if possible:: + sage: # needs sage.libs.pari sage: A. = LaurentSeriesRing(ZZ) sage: a = 2*t - 4*t^2 + t^4 - t^5 + O(t^6) sage: a.reverse() 1/2*t + 1/2*t^2 + t^3 + 79/32*t^4 + 437/64*t^5 + O(t^6) + sage: # needs sage.libs.pari sage: B. = PolynomialRing(ZZ) sage: A. = LaurentSeriesRing(B) sage: f = 2*b*t + b*t^2 + 3*b^2*t^3 + O(t^4) @@ -1473,6 +1479,7 @@ cdef class LaurentSeries(AlgebraElement): We can handle some base rings of positive characteristic:: + sage: # needs sage.libs.pari sage: A8. = LaurentSeriesRing(Zmod(8)) sage: a = t - 15*t^2 - 2*t^4 + t^5 + O(t^6) sage: b = a.reverse(); b @@ -1484,6 +1491,7 @@ cdef class LaurentSeries(AlgebraElement): The optional argument ``precision`` sets the precision of the output:: + sage: # needs sage.libs.pari sage: R. = LaurentSeriesRing(QQ) sage: f = 2*x + 3*x^2 - 7*x^3 + x^4 + O(x^5) sage: g = f.reverse(precision=3); g @@ -1497,6 +1505,7 @@ cdef class LaurentSeries(AlgebraElement): output is automatically set to the default precision of the parent ring:: + sage: # needs sage.libs.pari sage: R. = LaurentSeriesRing(QQ, default_prec=20) sage: (x - x^2).reverse() # get some Catalan numbers x + x^2 + 2*x^3 + 5*x^4 + 14*x^5 + 42*x^6 + 132*x^7 + 429*x^8 + 1430*x^9 diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index be1fc217a8d..8ec7808d0c2 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -302,8 +302,8 @@ def _repr_(self): True sage: R. = ZZ[] - sage: L. = R.localization(X - Y) - sage: x*y/(x-y) + sage: L. = R.localization(X - Y) # needs sage.libs.singular + sage: x*y/(x-y) # needs sage.libs.singular x*y/(x - y) """ s = "%s" % self._value @@ -403,7 +403,7 @@ def factor(self, proof=None): sage: P. = QQ['x, y'] sage: L = P.localization(X - Y) - sage: x, y = L.gens() + sage: x, y = L.gens() # needs sage.libs.singular sage: p = (x^2 - y^2)/(x-y)^2 # needs sage.libs.singular sage: p.factor() # needs sage.libs.singular (1/(x - y)) * (x + y) diff --git a/src/sage/rings/morphism.pyx b/src/sage/rings/morphism.pyx index 594e2ff0a3e..8d68fe16a64 100644 --- a/src/sage/rings/morphism.pyx +++ b/src/sage/rings/morphism.pyx @@ -873,12 +873,16 @@ cdef class RingHomomorphism(RingMap): return homset([self(g) for g in right.im_gens()], **kwds) except ValueError: pass - from sage.rings.number_field.morphism import RelativeNumberFieldHomomorphism_from_abs - if isinstance(right, RelativeNumberFieldHomomorphism_from_abs): - try: - return homset(self*right.abs_hom()) - except ValueError: - pass + try: + from sage.rings.number_field.morphism import RelativeNumberFieldHomomorphism_from_abs + except ImportError: + pass + else: + if isinstance(right, RelativeNumberFieldHomomorphism_from_abs): + try: + return homset(self*right.abs_hom()) + except ValueError: + pass return sage.categories.map.Map._composition_(self, right, homset) def pushforward(self, I): diff --git a/src/sage/rings/multi_power_series_ring.py b/src/sage/rings/multi_power_series_ring.py index 35c4d4beb32..e03850f1484 100644 --- a/src/sage/rings/multi_power_series_ring.py +++ b/src/sage/rings/multi_power_series_ring.py @@ -227,6 +227,7 @@ except ImportError: LaurentSeriesRing = () +lazy_import('sage.rings.lazy_series', 'LazyPowerSeries') lazy_import('sage.rings.lazy_series_ring', ('LazyPowerSeriesRing', 'LazyLaurentSeriesRing')) @@ -256,6 +257,8 @@ def is_MPowerSeriesRing(x): True sage: is_MPowerSeriesRing(T) False + + sage: # needs sage.combinat sage: L = LazyPowerSeriesRing(QQ, 'x') sage: is_MPowerSeriesRing(L) True @@ -835,6 +838,7 @@ def _coerce_map_from_(self, P): sage: H._coerce_map_from_(PolynomialRing(ZZ,'z2,f0')) True + sage: # needs sage.combinat sage: L. = LazyPowerSeriesRing(QQ) sage: R = PowerSeriesRing(QQ, names=('x','y','z')) sage: R.has_coerce_map_from(L) @@ -869,6 +873,7 @@ def _element_constructor_(self, f, prec=None): Multivariate Power Series Ring in t0, t1, t2, t3, t4 over Integer Ring + sage: # needs sage.combinat sage: L. = LazyPowerSeriesRing(QQ) sage: R = PowerSeriesRing(QQ, names=('x','y','z')) sage: R(1/(1-x-y), prec=3) @@ -881,7 +886,6 @@ def _element_constructor_(self, f, prec=None): prec = f.prec() except AttributeError: prec = infinity - from sage.rings.lazy_series import LazyPowerSeries if isinstance(f, LazyPowerSeries): if prec is infinity: try: diff --git a/src/sage/rings/number_field/all__sagemath_categories.py b/src/sage/rings/number_field/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/rings/padics/all.py b/src/sage/rings/padics/all.py index 7ece4e00493..297cba75a4e 100644 --- a/src/sage/rings/padics/all.py +++ b/src/sage/rings/padics/all.py @@ -1,6 +1,7 @@ +from sage.rings.padics.all__sagemath_categories import * + from sage.rings.padics.factory import Zp, Zq, Zp as pAdicRing, ZpCR, ZpCA, ZpFM, ZpFP, ZpLC, ZpLF, ZqCR, ZqCA, ZqFM, ZqFP, ZpER from sage.rings.padics.factory import Qp, Qq, Qp as pAdicField, QpCR, QpFP, QpLC, QpLF, QqCR, QqFP, QpER from sage.rings.padics.factory import pAdicExtension -from sage.rings.padics.padic_generic import local_print_mode from sage.rings.padics.pow_computer import PowComputer from sage.rings.padics.pow_computer_ext import PowComputer_ext_maker diff --git a/src/sage/rings/padics/all__sagemath_categories.py b/src/sage/rings/padics/all__sagemath_categories.py new file mode 100644 index 00000000000..fec72979f02 --- /dev/null +++ b/src/sage/rings/padics/all__sagemath_categories.py @@ -0,0 +1 @@ +from sage.rings.padics.padic_generic import local_print_mode diff --git a/src/sage/rings/polynomial/all.py b/src/sage/rings/polynomial/all.py index 853f422bdc7..28832a0da57 100644 --- a/src/sage/rings/polynomial/all.py +++ b/src/sage/rings/polynomial/all.py @@ -18,18 +18,7 @@ from sage.misc.lazy_import import lazy_import -# Quotient of polynomial ring -from sage.rings.polynomial.polynomial_quotient_ring import PolynomialQuotientRing -from sage.rings.polynomial.polynomial_quotient_ring_element import PolynomialQuotientRingElement - -# Univariate Polynomial Rings -from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -from sage.rings.polynomial.polynomial_ring import polygen, polygens -from sage.rings.polynomial.polynomial_element import Polynomial - -# Multivariate Polynomial Rings -from sage.rings.polynomial.term_order import TermOrder -from sage.rings.polynomial.multi_polynomial_element import degree_lowest_rational_function +from sage.rings.polynomial.all__sagemath_categories import * # Generic convolution from sage.rings.polynomial.convolution import convolution @@ -38,19 +27,14 @@ from sage.rings.polynomial.polynomial_ring_constructor import BooleanPolynomialRing_constructor as BooleanPolynomialRing # Laurent Polynomial Rings -from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing lazy_import('sage.rings.polynomial.omega', 'MacMahonOmega') -# Infinite Polynomial Rings -from sage.rings.polynomial.infinite_polynomial_ring import InfinitePolynomialRing +# Integer-valued Univariate Polynomial Ring +lazy_import('sage.rings.polynomial.integer_valued_polynomials', + 'IntegerValuedPolynomialRing') # Ore Polynomial Rings lazy_import('sage.rings.polynomial.ore_polynomial_ring', 'OrePolynomialRing') SkewPolynomialRing = OrePolynomialRing -# Evaluation of cyclotomic polynomials -from sage.rings.polynomial.cyclotomic import cyclotomic_value - -# Integer-valued Univariate Polynomial Ring -lazy_import('sage.rings.polynomial.integer_valued_polynomials', - 'IntegerValuedPolynomialRing') +del lazy_import diff --git a/src/sage/rings/polynomial/all__sagemath_brial.py b/src/sage/rings/polynomial/all__sagemath_brial.py new file mode 100644 index 00000000000..016ca38a057 --- /dev/null +++ b/src/sage/rings/polynomial/all__sagemath_brial.py @@ -0,0 +1 @@ +# sage_setup: distribution = sagemath-brial diff --git a/src/sage/rings/polynomial/all__sagemath_categories.py b/src/sage/rings/polynomial/all__sagemath_categories.py new file mode 100644 index 00000000000..2b79da92a4c --- /dev/null +++ b/src/sage/rings/polynomial/all__sagemath_categories.py @@ -0,0 +1,21 @@ +# Quotient of polynomial ring +from sage.rings.polynomial.polynomial_quotient_ring import PolynomialQuotientRing +from sage.rings.polynomial.polynomial_quotient_ring_element import PolynomialQuotientRingElement + +# Univariate Polynomial Rings +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.polynomial.polynomial_ring import polygen, polygens +from sage.rings.polynomial.polynomial_element import Polynomial + +# Multivariate Polynomial Rings +from sage.rings.polynomial.term_order import TermOrder +from sage.rings.polynomial.multi_polynomial_element import degree_lowest_rational_function + +# Infinite Polynomial Rings +from sage.rings.polynomial.infinite_polynomial_ring import InfinitePolynomialRing + +# Laurent Polynomial Rings +from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing + +# Evaluation of cyclotomic polynomials +from sage.rings.polynomial.cyclotomic import cyclotomic_value diff --git a/src/sage/rings/polynomial/infinite_polynomial_ring.py b/src/sage/rings/polynomial/infinite_polynomial_ring.py index 05735a21cd2..a1ec4375447 100644 --- a/src/sage/rings/polynomial/infinite_polynomial_ring.py +++ b/src/sage/rings/polynomial/infinite_polynomial_ring.py @@ -1381,6 +1381,7 @@ class InfinitePolynomialGen(SageObject): EXAMPLES:: + sage: # needs sage.rings.real_mpfr sage: X. = InfinitePolynomialRing(RR) sage: x1 x1_* diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index 6c4ec02c1b1..da2a79c8fff 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -229,6 +229,7 @@ def _im_gens_(self, codomain, im_gens, base_map=None): You can specify a map on the base ring:: + sage: # needs sage.libs.singular sage: F. = ZZ[] sage: F = F.fraction_field(); x,y = F(x),F(y) sage: cc = F.hom([y,x]) @@ -674,6 +675,7 @@ def degree(self, x=None, std_grading=False): Ensure that :issue:`37603` is fixed:: + sage: # needs sage.rings.number_field sage: R. = PolynomialRing(QQbar) sage: f = 3*x^2 - 2*y + 7*x^2*y^2 + 5 sage: type(f.degree()) @@ -730,12 +732,14 @@ def total_degree(self): TESTS: Ensure that :issue:`37603` is fixed:: - sage: R. = QQbar[] - sage: f = 2*x*y^3*z^2 - sage: f.total_degree() - 6 - sage: type(f.total_degree()) - + + sage: # needs sage.rings.number_field + sage: R. = QQbar[] + sage: f = 2*x*y^3*z^2 + sage: f.total_degree() + 6 + sage: type(f.total_degree()) + """ return self.degree() @@ -1308,6 +1312,7 @@ def is_homogeneous(self): The weight of the parent ring is respected:: + sage: # needs sage.rings.finite_rings sage: term_order = TermOrder("wdegrevlex", [1, 3]) sage: R. = PolynomialRing(Qp(5), order=term_order) sage: (x + y).is_homogeneous() @@ -2089,6 +2094,7 @@ def factor(self, proof=None): Check that the global proof flag for polynomials is honored:: + sage: # needs sage.libs.singular sage: R. = PolynomialRing(QQ['z']) sage: f = x^2 + y^2 sage: with proof.WithProof('polynomial', True): diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index d05760d84cd..3501431a779 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -658,9 +658,9 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): Coercion from boolean polynomials, also by index:: - sage: B. = BooleanPolynomialRing(3) - sage: P. = QQ[] - sage: P(B.gen(0)) + sage: B. = BooleanPolynomialRing(3) # needs sage.rings.polynomial.pbori + sage: P. = QQ[] # needs sage.rings.polynomial.pbori + sage: P(B.gen(0)) # needs sage.rings.polynomial.pbori x If everything else fails, we try to convert to the base ring:: diff --git a/src/sage/rings/polynomial/pbori/PyPolyBoRi.py b/src/sage/rings/polynomial/pbori/PyPolyBoRi.py index aa341f35c5d..193cab95cac 100644 --- a/src/sage/rings/polynomial/pbori/PyPolyBoRi.py +++ b/src/sage/rings/polynomial/pbori/PyPolyBoRi.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori r""" PolyBoRi's interface to libpolybori/BRiAL diff --git a/src/sage/rings/polynomial/pbori/__init__.py b/src/sage/rings/polynomial/pbori/__init__.py index 325ed646516..257a9b7d6a7 100644 --- a/src/sage/rings/polynomial/pbori/__init__.py +++ b/src/sage/rings/polynomial/pbori/__init__.py @@ -1,3 +1,4 @@ +# sage_setup: distribution = sagemath-brial """The PolyBoRi package implements a framework for computations with Polynomials in Boolean Ring. The core of PolyBoRi is a C++ library, which provides high-level data types for Boolean polynomials and monomials, diff --git a/src/sage/rings/polynomial/pbori/blocks.py b/src/sage/rings/polynomial/pbori/blocks.py index dac6ed81303..4125d16f54b 100644 --- a/src/sage/rings/polynomial/pbori/blocks.py +++ b/src/sage/rings/polynomial/pbori/blocks.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori import sys from itertools import chain, islice diff --git a/src/sage/rings/polynomial/pbori/cnf.py b/src/sage/rings/polynomial/pbori/cnf.py index 61d85866013..f94a0687a82 100644 --- a/src/sage/rings/polynomial/pbori/cnf.py +++ b/src/sage/rings/polynomial/pbori/cnf.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from random import Random from sage.rings.polynomial.pbori.pbori import if_then_else as ite from .PyPolyBoRi import Polynomial diff --git a/src/sage/rings/polynomial/pbori/easy_polynomials.py b/src/sage/rings/polynomial/pbori/easy_polynomials.py index 8451e7536ee..e67cbc106b2 100644 --- a/src/sage/rings/polynomial/pbori/easy_polynomials.py +++ b/src/sage/rings/polynomial/pbori/easy_polynomials.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .interpolate import variety_lex_leading_terms, nf_lex_points from .pbori import easy_linear_factors diff --git a/src/sage/rings/polynomial/pbori/fglm.py b/src/sage/rings/polynomial/pbori/fglm.py index 60559b31b85..7512c399728 100644 --- a/src/sage/rings/polynomial/pbori/fglm.py +++ b/src/sage/rings/polynomial/pbori/fglm.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .pbori import BooleSet, FGLMStrategy from .PyPolyBoRi import BoolePolynomialVector, Polynomial diff --git a/src/sage/rings/polynomial/pbori/frontend.py b/src/sage/rings/polynomial/pbori/frontend.py index b0072cd5abf..c09f1d2073d 100644 --- a/src/sage/rings/polynomial/pbori/frontend.py +++ b/src/sage/rings/polynomial/pbori/frontend.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori # Import basic functionality r""" This module defines an initial ring, and patches the declare_ring to use diff --git a/src/sage/rings/polynomial/pbori/gbcore.py b/src/sage/rings/polynomial/pbori/gbcore.py index 8371577157d..666441a134e 100644 --- a/src/sage/rings/polynomial/pbori/gbcore.py +++ b/src/sage/rings/polynomial/pbori/gbcore.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori import contextlib from copy import copy from itertools import chain diff --git a/src/sage/rings/polynomial/pbori/gbrefs.py b/src/sage/rings/polynomial/pbori/gbrefs.py index 4ac92f359c2..14f70fea32e 100644 --- a/src/sage/rings/polynomial/pbori/gbrefs.py +++ b/src/sage/rings/polynomial/pbori/gbrefs.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori import gzip from io import StringIO import base64 as uu diff --git a/src/sage/rings/polynomial/pbori/heuristics.py b/src/sage/rings/polynomial/pbori/heuristics.py index 5dcfca16f87..30a4bb3b3a2 100644 --- a/src/sage/rings/polynomial/pbori/heuristics.py +++ b/src/sage/rings/polynomial/pbori/heuristics.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .PyPolyBoRi import Polynomial, gauss_on_polys diff --git a/src/sage/rings/polynomial/pbori/interpolate.py b/src/sage/rings/polynomial/pbori/interpolate.py index 783e1209e2a..c370d6d9d4b 100644 --- a/src/sage/rings/polynomial/pbori/interpolate.py +++ b/src/sage/rings/polynomial/pbori/interpolate.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori # Copyright (c) 2005-2007 by The PolyBoRi Team from time import process_time as clock from random import Random diff --git a/src/sage/rings/polynomial/pbori/interred.py b/src/sage/rings/polynomial/pbori/interred.py index 9ecb705057f..ca997faf452 100644 --- a/src/sage/rings/polynomial/pbori/interred.py +++ b/src/sage/rings/polynomial/pbori/interred.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .pbori import ReductionStrategy from .PyPolyBoRi import Polynomial diff --git a/src/sage/rings/polynomial/pbori/ll.py b/src/sage/rings/polynomial/pbori/ll.py index 9ec3a57bb4c..a480732b339 100644 --- a/src/sage/rings/polynomial/pbori/ll.py +++ b/src/sage/rings/polynomial/pbori/ll.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .pbori import (top_index, if_then_else, substitute_variables, BooleSet, ll_red_nf_redsb, ll_red_nf_noredsb, diff --git a/src/sage/rings/polynomial/pbori/nf.py b/src/sage/rings/polynomial/pbori/nf.py index 004abef5243..f34d281e319 100644 --- a/src/sage/rings/polynomial/pbori/nf.py +++ b/src/sage/rings/polynomial/pbori/nf.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from sage.rings.polynomial.pbori.pbori import mod_mon_set from .pbori import (BooleSet, GroebnerStrategy, ReductionStrategy, parallel_reduce, easy_linear_factors) diff --git a/src/sage/rings/polynomial/pbori/parallel.py b/src/sage/rings/polynomial/pbori/parallel.py index 134ee6b2adb..3c27ae5a52c 100644 --- a/src/sage/rings/polynomial/pbori/parallel.py +++ b/src/sage/rings/polynomial/pbori/parallel.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori r""" parallel.py PolyBoRi diff --git a/src/sage/rings/polynomial/pbori/pbori.pxd b/src/sage/rings/polynomial/pbori/pbori.pxd index ae4ac1353d2..1cb2e136f8b 100644 --- a/src/sage/rings/polynomial/pbori/pbori.pxd +++ b/src/sage/rings/polynomial/pbori/pbori.pxd @@ -1,3 +1,4 @@ +# sage_setup: distribution = sagemath-brial from libcpp.memory cimport unique_ptr, shared_ptr, make_shared from sage.rings.polynomial.multi_polynomial_ring_base cimport MPolynomialRing_base, BooleanPolynomialRing_base diff --git a/src/sage/rings/polynomial/pbori/pbori.pyx b/src/sage/rings/polynomial/pbori/pbori.pyx index 686edf8892d..6222711d56b 100644 --- a/src/sage/rings/polynomial/pbori/pbori.pyx +++ b/src/sage/rings/polynomial/pbori/pbori.pyx @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori # distutils: libraries = brial brial_groebner M4RI_LIBRARIES LIBPNG_LIBRARIES # distutils: library_dirs = M4RI_LIBDIR LIBPNG_LIBDIR # distutils: include_dirs = M4RI_INCDIR LIBPNG_INCDIR diff --git a/src/sage/rings/polynomial/pbori/randompoly.py b/src/sage/rings/polynomial/pbori/randompoly.py index 34cc53d5dd4..350bd4198e5 100644 --- a/src/sage/rings/polynomial/pbori/randompoly.py +++ b/src/sage/rings/polynomial/pbori/randompoly.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from random import Random from pprint import pformat diff --git a/src/sage/rings/polynomial/pbori/rank.py b/src/sage/rings/polynomial/pbori/rank.py index 98d0a1727c9..0d2fb165b70 100644 --- a/src/sage/rings/polynomial/pbori/rank.py +++ b/src/sage/rings/polynomial/pbori/rank.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori def input_signals(p): return list((p + p.lex_lead()).vars_as_monomial().variables()) diff --git a/src/sage/rings/polynomial/pbori/specialsets.py b/src/sage/rings/polynomial/pbori/specialsets.py index 9c5b4bdefc8..5c97b84ebf1 100644 --- a/src/sage/rings/polynomial/pbori/specialsets.py +++ b/src/sage/rings/polynomial/pbori/specialsets.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .pbori import (top_index, if_then_else, mod_mon_set, BooleSet, BooleConstant) from .PyPolyBoRi import (Polynomial, Monomial, Variable) diff --git a/src/sage/rings/polynomial/pbori/statistics.py b/src/sage/rings/polynomial/pbori/statistics.py index efd49fcd005..58991cd0b6a 100644 --- a/src/sage/rings/polynomial/pbori/statistics.py +++ b/src/sage/rings/polynomial/pbori/statistics.py @@ -1,3 +1,5 @@ +# sage_setup: distribution = sagemath-brial +# sage.doctest: needs sage.rings.polynomial.pbori from .pbori import top_index, BooleConstant from .PyPolyBoRi import Monomial, Polynomial diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 53bb07c2fc4..0cf0ad2ec29 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -2348,6 +2348,7 @@ cdef class Polynomial(CommutativePolynomial): Also works for extension fields and even characteristic:: + sage: # needs sage.rings.finite_rings sage: F. = GF(2^4) sage: R. = F[] sage: f = (x + z4^3 + z4^2)^4 * (x^2 + z4*x + z4) * (x^2 + (z4^3 + z4^2 + z4)*x + z4^2 + z4 + 1) @@ -9655,6 +9656,8 @@ cdef class Polynomial(CommutativePolynomial): ... NotImplementedError: Univariate Polynomial Ring in x over Rational Field does not provide an xgcd implementation for univariate polynomials + + sage: # needs sage.libs.singular sage: T. = QQ[] sage: def poor_xgcd(f, g): ....: ret = S(T(f).gcd(g)) @@ -10233,6 +10236,7 @@ cdef class Polynomial(CommutativePolynomial): sage: R(0).is_squarefree() False + sage: # needs sage.libs.singular sage: S. = QQ[] sage: R. = S[] sage: (2*x*y).is_squarefree() @@ -11142,6 +11146,7 @@ cdef class Polynomial(CommutativePolynomial): ... ValueError: not a 17th power + sage: # needs sage.libs.singular sage: R1. = QQ[] sage: R2. = R1[] sage: R3. = R2[] @@ -12774,9 +12779,10 @@ cdef class Polynomial_generic_dense_inexact(Polynomial_generic_dense): Ensure that :issue:`37621` is fixed:: + sage: # needs sage.rings.padics sage: k. = QQ[] - sage: K = Qp(11,5) - sage: L. = K.extension(x^20-11) + sage: K = Qp(11, 5) + sage: L. = K.extension(x^20 - 11) sage: R. = L[] sage: f = R.random_element() sage: type(f.degree()) diff --git a/src/sage/rings/polynomial/polynomial_element_generic.py b/src/sage/rings/polynomial/polynomial_element_generic.py index c3df26200e2..b697f4edc54 100644 --- a/src/sage/rings/polynomial/polynomial_element_generic.py +++ b/src/sage/rings/polynomial/polynomial_element_generic.py @@ -954,9 +954,9 @@ def gcd(self, other, algorithm=None): Check that :issue:`19676` is fixed:: sage: S. = R[] - sage: x.gcd(y) + sage: x.gcd(y) # needs sage.libs.singular 1 - sage: (6*x).gcd(9) + sage: (6*x).gcd(9) # needs sage.libs.singular 3 Check that :issue:`36427` is fixed:: diff --git a/src/sage/rings/polynomial/polynomial_ring.py b/src/sage/rings/polynomial/polynomial_ring.py index 2bda9f6f9c3..3d7f3d1b1e3 100644 --- a/src/sage/rings/polynomial/polynomial_ring.py +++ b/src/sage/rings/polynomial/polynomial_ring.py @@ -2558,7 +2558,7 @@ def fraction_field(self): EXAMPLES:: - sage: QQbar['x'].fraction_field() + sage: QQbar['x'].fraction_field() # needs sage.rings.number_field Fraction Field of Univariate Polynomial Ring in x over Algebraic Field diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py index 1bdca3af614..bbe11bb41a8 100644 --- a/src/sage/rings/polynomial/polynomial_singular_interface.py +++ b/src/sage/rings/polynomial/polynomial_singular_interface.py @@ -257,7 +257,7 @@ def _singular_(self, singular=None): // : names x // block 2 : ordering C - sage: R = Frac(ZZ['a,b'])['x,y'] + sage: R = Frac(ZZ['a,b'])['x,y'] # needs sage.libs.singular sage: singular(R) # needs sage.libs.singular polynomial ring, over a field, global ordering // coefficients: QQ(a, b) diff --git a/src/sage/rings/polynomial/toy_variety.py b/src/sage/rings/polynomial/toy_variety.py index ba67a1ece2e..d07056e6416 100644 --- a/src/sage/rings/polynomial/toy_variety.py +++ b/src/sage/rings/polynomial/toy_variety.py @@ -170,7 +170,7 @@ def is_linearly_dependent(polys) -> bool: ....: 2*x^123 + x^75, ....: x^147 + 2*x^123 + 2*x^75, ....: 2*x^147 + x^99 + x^75] - sage: is_linearly_dependent(B) + sage: is_linearly_dependent(B) # needs sage.modules True """ if not polys: diff --git a/src/sage/rings/power_series_poly.pyx b/src/sage/rings/power_series_poly.pyx index 309d72c8f6a..4911ccad8bc 100644 --- a/src/sage/rings/power_series_poly.pyx +++ b/src/sage/rings/power_series_poly.pyx @@ -1080,7 +1080,7 @@ cdef class PowerSeries_poly(PowerSeries): f2 = f.__pari__() g = f2.serreverse() return PowerSeries_poly(f.parent(), g.Vec(-out_prec), out_prec) - except (TypeError,ValueError,AttributeError,PariError): + except (TypeError, ValueError, AttributeError, PariError, ImportError): # if pari fails, continue with Lagrange inversion from sage.misc.verbose import verbose verbose("passing to pari failed; trying Lagrange inversion") diff --git a/src/sage/rings/power_series_ring.py b/src/sage/rings/power_series_ring.py index e6c932aadff..1e560f0ae82 100644 --- a/src/sage/rings/power_series_ring.py +++ b/src/sage/rings/power_series_ring.py @@ -175,6 +175,7 @@ LaurentSeriesRing = () LaurentSeries = () +lazy_import('sage.rings.lazy_series', 'LazyPowerSeries') lazy_import('sage.rings.lazy_series_ring', 'LazyPowerSeriesRing') @@ -476,6 +477,8 @@ def is_PowerSeriesRing(R): False sage: is_PowerSeriesRing(QQ[['x']]) True + + sage: # needs sage.combinat sage: is_PowerSeriesRing(LazyPowerSeriesRing(QQ, 'x')) True sage: is_PowerSeriesRing(LazyPowerSeriesRing(QQ, 'x, y')) @@ -712,7 +715,7 @@ def _coerce_map_from_(self, S): False sage: A.has_coerce_map_from(ZZ[['x']]) True - sage: A.has_coerce_map_from(LazyPowerSeriesRing(ZZ, 'x')) + sage: A.has_coerce_map_from(LazyPowerSeriesRing(ZZ, 'x')) # needs sage.combinat True """ if self.base_ring().has_coerce_map_from(S): @@ -816,6 +819,7 @@ def _element_constructor_(self, f, prec=infinity, check=True): From lazy series:: + sage: # needs sage.combinat sage: L. = LazyPowerSeriesRing(QQ) sage: R = PowerSeriesRing(QQ, 'x') sage: R(1 / (1 + x^3)) @@ -853,7 +857,6 @@ def _element_constructor_(self, f, prec=infinity, check=True): else: raise TypeError("Can only convert series into ring with same variable name.") else: - from sage.rings.lazy_series import LazyPowerSeries if isinstance(f, LazyPowerSeries): if prec is infinity: try: diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py index 4cf3979265f..c6bab8a767c 100644 --- a/src/sage/rings/quotient_ring.py +++ b/src/sage/rings/quotient_ring.py @@ -1364,7 +1364,7 @@ def random_element(self): sage: R. = QQ[] sage: S = R.quotient([x^3, y^2]) - sage: S.random_element() # random + sage: S.random_element() # random # needs sage.libs.singular -8/5*xbar^2 + 3/2*xbar*ybar + 2*xbar - 4/23 TESTS: @@ -1373,7 +1373,7 @@ def random_element(self): ring (which would be the case if the default implementation of this method was inherited from generic rings):: - sage: any(S.random_element() not in ZZ for _ in range(999)) + sage: any(S.random_element() not in ZZ for _ in range(999)) # needs sage.libs.singular True """ return self.retract(self.cover_ring().random_element()) diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx index 272650abeef..62708c6cbd5 100644 --- a/src/sage/rings/rational.pyx +++ b/src/sage/rings/rational.pyx @@ -598,7 +598,7 @@ cdef class Rational(sage.structure.element.FieldElement): elif isinstance(x, integer.Integer): set_from_Integer(self, x) - elif isinstance(x, sage.rings.real_mpfr.RealNumber): + elif isinstance(x, RealNumber_classes): if x == 0: mpq_set_si(self.value, 0, 1) @@ -674,14 +674,23 @@ cdef class Rational(sage.structure.element.FieldElement): mpq_set(self.value, temp_rational.value) elif isinstance(x, (float, sage.rings.real_double.RealDoubleElement)): - self.__set_value(sage.rings.real_mpfr.RealNumber(sage.rings.real_mpfr.RR, x), base) + try: + from sage.rings.real_mpfr import RR, RealNumber + except ImportError: + if base: + raise + from fractions import Fraction + self.__set_value(Fraction.from_float(float(x)), 0) + else: + self.__set_value(RealNumber(RR, x), base) elif is_numpy_type(type(x)): import numpy if isinstance(x, numpy.integer): self.__set_value(integer.Integer(x), base) elif isinstance(x, numpy.floating): - self.__set_value(sage.rings.real_mpfr.RR(x), base) + from sage.rings.real_mpfr import RR + self.__set_value(RR(x), base) else: raise TypeError("unable to convert {!r} to a rational".format(x)) diff --git a/src/sage/rings/semirings/tropical_mpolynomial.py b/src/sage/rings/semirings/tropical_mpolynomial.py index d8df667530b..039cc295764 100644 --- a/src/sage/rings/semirings/tropical_mpolynomial.py +++ b/src/sage/rings/semirings/tropical_mpolynomial.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.symbolic r""" Multivariate Tropical Polynomials diff --git a/src/sage/rings/semirings/tropical_polynomial.py b/src/sage/rings/semirings/tropical_polynomial.py index c0dff405ac9..2b9d04ffaea 100644 --- a/src/sage/rings/semirings/tropical_polynomial.py +++ b/src/sage/rings/semirings/tropical_polynomial.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.symbolic r""" Univariate Tropical Polynomials diff --git a/src/sage/rings/semirings/tropical_variety.py b/src/sage/rings/semirings/tropical_variety.py index 3eb04372d13..3f7ed1c43d8 100644 --- a/src/sage/rings/semirings/tropical_variety.py +++ b/src/sage/rings/semirings/tropical_variety.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.symbolic r""" Tropical Varieties diff --git a/src/sage/sat/converters/polybori.py b/src/sage/sat/converters/polybori.py index 27437c472ec..18fc7c6fb75 100644 --- a/src/sage/sat/converters/polybori.py +++ b/src/sage/sat/converters/polybori.py @@ -29,13 +29,15 @@ ############################################################################## from random import Random -from sage.rings.polynomial.pbori.pbori import if_then_else as ite from sage.rings.integer_ring import ZZ from sage.functions.other import ceil from sage.misc.cachefunc import cached_method, cached_function +from sage.misc.lazy_import import lazy_import from sage.combinat.permutation import Permutations from sage.sat.converters import ANF2CNFConverter +lazy_import('sage.rings.polynomial.pbori.pbori', 'if_then_else', as_='ite') + class CNFEncoder(ANF2CNFConverter): """ diff --git a/src/sage/schemes/affine/affine_subscheme.py b/src/sage/schemes/affine/affine_subscheme.py index a6b550c6ec8..4da93325d64 100755 --- a/src/sage/schemes/affine/affine_subscheme.py +++ b/src/sage/schemes/affine/affine_subscheme.py @@ -510,6 +510,7 @@ def _morphism(self, *args, **kwds): TESTS:: + sage: # needs sage.libs.singular sage: A2. = AffineSpace(QQ, 2) sage: X = A2.subscheme(x - y) sage: H = X.Hom(A2) diff --git a/src/sage/schemes/all.py b/src/sage/schemes/all.py index f5126a0dee1..b6f24bb287e 100644 --- a/src/sage/schemes/all.py +++ b/src/sage/schemes/all.py @@ -20,6 +20,8 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** +from sage.schemes.all__sagemath_categories import * + from sage.schemes.jacobians.all import * from sage.schemes.hyperelliptic_curves.all import * @@ -32,16 +34,8 @@ from sage.schemes.plane_quartics.all import * -from sage.schemes.generic.all import * - from sage.schemes.toric.all import * -from sage.schemes.affine.all import * - -from sage.schemes.projective.all import * - -from sage.schemes.product_projective.all import * - from sage.schemes.cyclic_covers.all import * from sage.schemes.berkovich.all import * diff --git a/src/sage/schemes/all__sagemath_categories.py b/src/sage/schemes/all__sagemath_categories.py new file mode 100644 index 00000000000..02c6722874e --- /dev/null +++ b/src/sage/schemes/all__sagemath_categories.py @@ -0,0 +1,4 @@ +from sage.schemes.generic.all import * +from sage.schemes.affine.all import * +from sage.schemes.projective.all import * +from sage.schemes.product_projective.all import * diff --git a/src/sage/schemes/generic/divisor_group.py b/src/sage/schemes/generic/divisor_group.py index 0b11b1d0982..d8a99a93985 100755 --- a/src/sage/schemes/generic/divisor_group.py +++ b/src/sage/schemes/generic/divisor_group.py @@ -202,6 +202,7 @@ def _coerce_map_from_(self, other): TESTS:: + sage: # needs sage.schemes sage: C = EllipticCurve([2, 1]) sage: E = EllipticCurve([1, 2]) sage: C.divisor_group()._coerce_map_from_(E.divisor_group()) diff --git a/src/sage/schemes/generic/glue.py b/src/sage/schemes/generic/glue.py index 7733030a2ab..1f486f5362e 100755 --- a/src/sage/schemes/generic/glue.py +++ b/src/sage/schemes/generic/glue.py @@ -31,6 +31,7 @@ class GluedScheme(Scheme): EXAMPLES:: + sage: # needs sage.libs.singular sage: R. = QQ[] sage: S. = R.quotient(x * y - 1) sage: Rx = QQ["x"] @@ -62,6 +63,7 @@ def gluing_maps(self): EXAMPLES:: + sage: # needs sage.libs.singular sage: R. = QQ[] sage: S. = R.quotient(x * y - 1) sage: Rx = QQ["x"] diff --git a/src/sage/schemes/generic/homset.py b/src/sage/schemes/generic/homset.py index 370049d2238..54ca19c0e0d 100755 --- a/src/sage/schemes/generic/homset.py +++ b/src/sage/schemes/generic/homset.py @@ -673,6 +673,7 @@ def __iter__(self): TESTS:: + sage: # needs sage.schemes sage: E = EllipticCurve(GF(19), [1, 0]) sage: list(E.point_homset()) [(0 : 1 : 0), (0 : 0 : 1), (3 : 7 : 1), (3 : 12 : 1), (4 : 7 : 1), @@ -700,6 +701,7 @@ def __iter__(self): :: + sage: # needs sage.geometry.polyhedron sage: P1 = toric_varieties.P1(base_ring=GF(3)) sage: list(P1.point_homset()) [[0 : 1], [1 : 0], [1 : 1], [1 : 2]] diff --git a/src/sage/schemes/generic/scheme.py b/src/sage/schemes/generic/scheme.py index 5cae30dae3a..102d6253da6 100755 --- a/src/sage/schemes/generic/scheme.py +++ b/src/sage/schemes/generic/scheme.py @@ -330,8 +330,7 @@ def point(self, v, check=True): (0 : 0 : 1) """ # todo: update elliptic curve stuff to take point_homset as argument - from sage.schemes.elliptic_curves.ell_generic import EllipticCurve_generic - if isinstance(self, EllipticCurve_generic): + if isinstance(self, EllipticCurve): try: return self._point(self.point_homset(), v, check=check) except AttributeError: # legacy code without point_homset diff --git a/src/sage/schemes/projective/projective_subscheme.py b/src/sage/schemes/projective/projective_subscheme.py index a0c571de25b..5ff38e2a0ea 100755 --- a/src/sage/schemes/projective/projective_subscheme.py +++ b/src/sage/schemes/projective/projective_subscheme.py @@ -115,8 +115,7 @@ def point(self, v, check=True): raise ValueError("%s not well defined in dimension > 1" % v) v = [1, 0] # todo: update elliptic curve stuff to take point_homset as argument - from sage.schemes.elliptic_curves.ell_generic import EllipticCurve_generic - if isinstance(self, EllipticCurve_generic): + if isinstance(self, EllipticCurve): try: return self._point(self.point_homset(), v, check=check) except AttributeError: # legacy code without point_homset diff --git a/src/sage/sets/disjoint_set.pyx b/src/sage/sets/disjoint_set.pyx index ddd9a95a310..768bb9ec5e8 100644 --- a/src/sage/sets/disjoint_set.pyx +++ b/src/sage/sets/disjoint_set.pyx @@ -109,6 +109,7 @@ cpdef DisjointSet(arg): From a set partition (see :issue:`38693`):: + sage: # needs sage.combinat sage: SP = SetPartition(DisjointSet(5)) sage: DisjointSet(SP) {{0}, {1}, {2}, {3}, {4}} @@ -961,8 +962,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class): sage: d.union(3, 4) sage: d {{0}, {1, 2, 3, 4}} - sage: g = d.to_digraph() - sage: g # needs sage.graphs + sage: g = d.to_digraph(); g # needs sage.graphs Looped digraph on 5 vertices sage: g.edges(sort=True) # needs sage.graphs [(0, 0, None), (1, 2, None), (2, 2, None), (3, 2, None), (4, 2, None)] diff --git a/src/sage/structure/coerce_actions.pyx b/src/sage/structure/coerce_actions.pyx index b25abdf328a..6b4dc18c704 100644 --- a/src/sage/structure/coerce_actions.pyx +++ b/src/sage/structure/coerce_actions.pyx @@ -316,6 +316,7 @@ cdef class ModuleAction(Action): If there is a coercion from ``G`` to ``S``, we do not create the module action of ``G`` on the pushout of ``G`` and ``S``:: + sage: # needs sage.modules sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(MatrixSpace(QQ, 2), "x") sage: G.gen() * S.gen() @@ -325,6 +326,7 @@ cdef class ModuleAction(Action): Contrast the previous example with the following, where we have no coercion from ``G`` to ``S``:: + sage: # needs sage.modules sage: S = PolynomialRing(MatrixSpace(QQ, 2), "y") sage: G.gen() * S.gen() [x 0] diff --git a/src/sage/structure/element.pxd b/src/sage/structure/element.pxd index cc1bf225710..cd7db400b3b 100644 --- a/src/sage/structure/element.pxd +++ b/src/sage/structure/element.pxd @@ -132,6 +132,7 @@ cpdef inline bint have_same_parent(left, right) noexcept: These have different types but the same parent:: + sage: # needs sage.rings.real_mpfr sage: a = RLF(2) sage: b = exp(a) sage: type(a) diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx index 18a58f46103..70e201c8506 100644 --- a/src/sage/structure/element.pyx +++ b/src/sage/structure/element.pyx @@ -805,7 +805,7 @@ cdef class Element(SageObject): 25*y^2 + y + 30 sage: f.subs(x=5) 25*y^2 + y + 30 - sage: (1/f).subs(x=5) + sage: (1/f).subs(x=5) # needs sage.libs.singular 1/(25*y^2 + y + 30) sage: Integer(5).subs(x=4) 5 @@ -844,7 +844,7 @@ cdef class Element(SageObject): 25*y^2 + y + 30 sage: f.substitute(x=5) 25*y^2 + y + 30 - sage: (1/f).substitute(x=5) + sage: (1/f).substitute(x=5) # needs sage.libs.singular 1/(25*y^2 + y + 30) sage: Integer(5).substitute(x=4) 5 @@ -4494,15 +4494,15 @@ def is_AlgebraElement(x): TESTS:: sage: from sage.structure.element import is_AlgebraElement - sage: R. = FreeAlgebra(QQ, 2) # needs sage.combinat sage.modules - sage: is_AlgebraElement(x * y) # needs sage.combinat sage.modules + sage: is_AlgebraElement(1) doctest:warning... DeprecationWarning: The function is_AlgebraElement is deprecated; use 'isinstance(..., AlgebraElement)' instead. See https://github.com/sagemath/sage/issues/38077 for details. + False + sage: R. = FreeAlgebra(QQ, 2) # needs sage.combinat sage.modules + sage: is_AlgebraElement(x * y) # needs sage.combinat sage.modules True - sage: is_AlgebraElement(1) - False """ from sage.misc.superseded import deprecation_cython deprecation_cython(38077, "The function is_AlgebraElement is deprecated; use 'isinstance(..., AlgebraElement)' instead.") diff --git a/src/sage/structure/parent.pyx b/src/sage/structure/parent.pyx index 8e8940b5846..5bdade7eae2 100644 --- a/src/sage/structure/parent.pyx +++ b/src/sage/structure/parent.pyx @@ -1151,9 +1151,9 @@ cdef class Parent(sage.structure.category_object.CategoryObject): Check that :issue:`32078` is fixed:: sage: P = Frac(ZZ['x,y']) - sage: P(1) in ZZ + sage: P(1) in ZZ # needs sage.libs.singular True - sage: P(1/2) in ZZ + sage: P(1/2) in ZZ # needs sage.libs.singular False Check that :issue:`24209` is fixed:: @@ -2644,6 +2644,7 @@ cdef class Parent(sage.structure.category_object.CategoryObject): on elliptic curves over Finite Fields, was not used if an ``int`` multiplied a point, resulting in a 10x slowdown for large characteristic:: + sage: # needs sage.schemes sage: E = EllipticCurve(GF(17),[1,1]) sage: coercion_model.discover_action(ZZ, E, operator.mul) Left action by Integer Ring on Elliptic Curve defined by y^2 = x^3 + x + 1 over Finite Field of size 17 diff --git a/src/sage/structure/sequence.py b/src/sage/structure/sequence.py index cc9fcedadfe..2da0c8c4265 100644 --- a/src/sage/structure/sequence.py +++ b/src/sage/structure/sequence.py @@ -70,10 +70,17 @@ # https://www.gnu.org/licenses/ # **************************************************************************** - import sage.structure.sage_object import sage.structure.coerce +from sage.misc.lazy_import import lazy_import + +lazy_import('sage.rings.polynomial.multi_polynomial_ideal', 'MPolynomialIdeal') +lazy_import('sage.rings.polynomial.multi_polynomial_ring', 'MPolynomialRing_base') +lazy_import('sage.rings.polynomial.multi_polynomial_sequence', 'PolynomialSequence') +lazy_import('sage.rings.polynomial.pbori.pbori', 'BooleanMonomialMonoid') +lazy_import('sage.rings.quotient_ring', 'QuotientRing_nc') + def Sequence(x, universe=None, check=True, immutable=False, cr=False, cr_str=None, use_sage_types=False): """ @@ -215,14 +222,9 @@ def Sequence(x, universe=None, check=True, immutable=False, cr=False, cr_str=Non universe = x.universe() x = list(x) else: - try: - from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal - except ImportError: - pass - else: - if isinstance(x, MPolynomialIdeal): - universe = x.ring() - x = x.gens() + if isinstance(x, MPolynomialIdeal): + universe = x.ring() + x = x.gens() if universe is None: orig_x = x @@ -249,16 +251,8 @@ def Sequence(x, universe=None, check=True, immutable=False, cr=False, cr_str=Non if universe is None: # no type errors raised. universe = sage.structure.element.parent(x[len(x)-1]) - try: - from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence - from sage.rings.polynomial.pbori.pbori import BooleanMonomialMonoid - from sage.rings.polynomial.multi_polynomial_ring import MPolynomialRing_base - from sage.rings.quotient_ring import QuotientRing_nc - except ImportError: - pass - else: - if isinstance(universe, MPolynomialRing_base) or isinstance(universe, BooleanMonomialMonoid) or (isinstance(universe, QuotientRing_nc) and isinstance(universe.cover_ring(), MPolynomialRing_base)): - return PolynomialSequence(x, universe, immutable=immutable, cr=cr, cr_str=cr_str) + if isinstance(universe, (MPolynomialRing_base, BooleanMonomialMonoid)) or (isinstance(universe, QuotientRing_nc) and isinstance(universe.cover_ring(), MPolynomialRing_base)): + return PolynomialSequence(x, universe, immutable=immutable, cr=cr, cr_str=cr_str) return Sequence_generic(x, universe, check, immutable, cr, cr_str, use_sage_types) diff --git a/src/sage/symbolic/all__sagemath_categories.py b/src/sage/symbolic/all__sagemath_categories.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index 406bf1befab..a0f740897b8 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -552,6 +552,7 @@ def test_executable(args, input='', timeout=100.0, pydebug_ignore_warnings=False Some programs of which we check functionality using only ``--version``:: + sage: # needs sage.symbolic sage: (out, err, ret) = test_executable(["sage", "--maxima", "--version"]) sage: out.find("Maxima ") >= 0 True diff --git a/src/sage_setup/__init__.py b/src/sage_setup/__init__.py index e69de29bb2d..4ee00ace2e4 100644 --- a/src/sage_setup/__init__.py +++ b/src/sage_setup/__init__.py @@ -0,0 +1,156 @@ +def sage_setup(distributions, *, + interpreters=(), + required_modules=(), optional_modules=(), + recurse_packages=(), + package_data=None): + r""" + Replacement for :func:`setuptools.setup` for building distribution packages of the Sage library + + INPUT: + + - ``distributions`` -- (typically one-element) sequence of strings, the distribution names + shipped with this distribution package. + + - ``interpreters`` -- sequence of strings, the interpreters to build with :mod:`sage_setup.autogen`. + + - ``required_modules`` -- sequence of strings, pkgconfig modules that are required for the build. + + - ``optional_modules`` -- sequence of strings, pkgconfig modules to checked for the build. + + - ``package_data`` -- ``None`` or a dictionary mapping package names to lists of filename + glob patterns, the package data to install. + + * If ``None``, all of ``package_data`` is taken from ``pyproject.toml``. + + * If a dictionary, use it as package data and ignore ``package_data`` in ``pyproject.toml``. + """ + import time + + from setuptools import setup, find_namespace_packages + from distutils import log + from setuptools.dist import Distribution + from sage_setup.command.sage_build_ext_minimal import sage_build_ext_minimal + from sage_setup.command.sage_build_py import sage_build_py + from sage_setup.cython_options import compiler_directives, compile_time_env_variables + from sage_setup.extensions import create_extension + from sage_setup.find import find_python_sources, find_extra_files + + # Work around a Cython problem in Python 3.8.x on macOS + # https://github.com/cython/cython/issues/3262 + import os + if os.uname().sysname == 'Darwin': + import multiprocessing + multiprocessing.set_start_method('fork', force=True) + + # setuptools plugins considered harmful: + # If build isolation is not in use and setuptools_scm is installed, + # then its file_finders entry point is invoked, which we don't need. + # Workaround from ​https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286 + try: + import setuptools_scm.integration + setuptools_scm.integration.find_files = lambda _: [] + except ImportError: + pass + + # And with setuptools_scm 8, we get more trouble: + # LookupError: pyproject.toml does not contain a tool.setuptools_scm section + # LookupError: setuptools-scm was unable to detect version ... + # We just remove all handling of "setuptools.finalize_distribution_options" entry points. + Distribution._removed = staticmethod(lambda ep: True) + + # Different workaround: disable `walk_revctrl` in setuptools + # This is needed for setuptools_scm >= 8, should work for any version + import setuptools.command.egg_info + setuptools.command.egg_info.walk_revctrl = lambda: () + + import sys + + from sage_setup.excepthook import excepthook + sys.excepthook = excepthook + + from sage_setup.setenv import setenv + setenv() + + import sage.env + sage.env.default_required_modules = required_modules + sage.env.default_optional_modules = optional_modules + + cmdclass = dict(build_ext=sage_build_ext_minimal, + build_py=sage_build_py) + + sdist = len(sys.argv) > 1 and (sys.argv[1] in ["sdist", "egg_info", "dist_info"]) + + # ######################################################## + # ## Discovering Sources + # ######################################################## + if sdist: + extensions = [] + python_modules = [] + python_packages = [] + else: + if interpreters: + log.info("Generating auto-generated sources") + # from sage_setup.autogen import autogen_all + # autogen_all() + from sage_setup.autogen.interpreters.internal import rebuild + rebuild(os.path.join("sage", "ext", "interpreters"), + interpreters=interpreters, + distribution=distributions[0], force=True) + + log.info("Discovering Python/Cython source code....") + t = time.time() + + python_packages, python_modules, cython_modules = find_python_sources( + '.', ['sage'], distributions=distributions) + extra_files = find_extra_files( + '.', ['sage'], '/doesnotexist', distributions=distributions) + + python_packages += find_namespace_packages(where='.', include=recurse_packages) + + if package_data is not None: + package_data.update({"": [f + for pkg, files in extra_files.items() + for f in files]}) + python_packages += list(package_data) + + log.warn('python_packages = {0}'.format(sorted(python_packages))) + log.warn('python_modules = {0}'.format(sorted(m if isinstance(m, str) else m.name for m in python_modules))) + log.warn('cython_modules = {0}'.format(sorted(m if isinstance(m, str) else m.name for m in cython_modules))) + log.warn('package_data = {0}'.format(package_data)) + + log.info(f"Discovered Python/Cython sources, time: {(time.time() - t):.2f} seconds.") + + # from sage_build_cython: + import Cython.Compiler.Options + Cython.Compiler.Options.embed_pos_in_docstring = True + gdb_debug = os.environ.get('SAGE_DEBUG', None) != 'no' + + try: + from Cython.Build import cythonize + from sage.env import cython_aliases, sage_include_directories + from sage.misc.package_dir import cython_namespace_package_support + with cython_namespace_package_support(): + extensions = cythonize( + cython_modules, + include_path=sage_include_directories(use_sources=True) + ['.'], + compile_time_env=compile_time_env_variables(), + compiler_directives=compiler_directives(False), + aliases=cython_aliases(), + create_extension=create_extension, + gdb_debug=gdb_debug, + nthreads=4) + except Exception as exception: + log.warn(f"Exception while cythonizing source files: {repr(exception)}") + raise + + kwds = {} + + if package_data is not None: + kwds['package_data'] = package_data + + setup(cmdclass=cmdclass, + packages=python_packages, + py_modules=python_modules, + ext_modules=extensions, + **kwds + ) diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 969793209c8..edc9f39b89d 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -131,6 +131,7 @@ sage = [options.extras_require] R = SPKG_INSTALL_REQUIRES_rpy2 bliss = SPKG_INSTALL_REQUIRES_sagemath_bliss +brial = SPKG_INSTALL_REQUIRES_sagemath_brial coxeter3 = SPKG_INSTALL_REQUIRES_sagemath_coxeter3 mcqd = SPKG_INSTALL_REQUIRES_sagemath_mcqd meataxe = SPKG_INSTALL_REQUIRES_sagemath_meataxe diff --git a/src/setup.py b/src/setup.py index dfa2e59b2e1..a50b60f2ab1 100755 --- a/src/setup.py +++ b/src/setup.py @@ -76,7 +76,7 @@ log.info("Discovering Python/Cython source code...") - optional_packages = ['mcqd', 'bliss', 'tdlib', + optional_packages = ['mcqd', 'bliss', 'brial', 'tdlib', 'coxeter3', 'sirocco', 'meataxe'] distributions_to_exclude = [f"sagemath-{pkg}" for pkg in optional_packages]