diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..91c31923f2e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/debian +{ + "name": "Conda", + "image": "mcr.microsoft.com/vscode/devcontainers/base:0-bullseye", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + + // Setup conda environment + "onCreateCommand": ".devcontainer/onCreate-conda.sh", + + // Install additional features. + "features": { + // For config options, see https://github.com/devcontainers/features/tree/main/src/conda + "ghcr.io/devcontainers/features/conda": { + "version": "latest", + "addCondaForge": "true" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "guyskk.language-cython", + "ms-python.isort", + "ms-toolsai.jupyter", + "ms-python.vscode-pylance", + "ms-python.pylint", + "ms-python.python", + "lextudio.restructuredtext", + "trond-snekvik.simple-rst" + ] + } + } +} diff --git a/.devcontainer/onCreate-conda.sh b/.devcontainer/onCreate-conda.sh new file mode 100755 index 00000000000..eaa045cd27b --- /dev/null +++ b/.devcontainer/onCreate-conda.sh @@ -0,0 +1,14 @@ +# Do not keep running on errors +set -e + +# Create conda environment +./bootstrap-conda +conda install mamba -n base -c conda-forge -y +mamba env create --file src/environment-dev.yml || mamba env update --file src/environment-dev.yml +conda init bash + +# Build sage +conda run -n sage-dev ./bootstrap +conda run -n sage-dev ./configure --with-python=/opt/conda/envs/sage-dev/bin/python --prefix=/opt/conda/envs/sage-dev +conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup +conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src diff --git a/.devcontainer/portability-updateContent.sh b/.devcontainer/portability-updateContent.sh index a923fc0d106..41033933911 100755 --- a/.devcontainer/portability-updateContent.sh +++ b/.devcontainer/portability-updateContent.sh @@ -5,14 +5,14 @@ # The script assumes that it is run from SAGE_ROOT. # # If "config.log" or "logs" are symlinks (for example, created by 'tox -e local-...', -# or after https://trac.sagemath.org/ticket/33262), they might point outside of +# or after https://github.com/sagemath/sage/issues/33262), they might point outside of # the dev container, so remove them. Likewise for upstream. for f in config.log logs upstream; do if [ -L $f ]; then rm -f $f fi done -# If possible (ensured after https://trac.sagemath.org/ticket/33262), keep the +# If possible (ensured after https://github.com/sagemath/sage/issues/33262), keep the # logs in the container. if [ ! -d logs ]; then ln -s /sage/logs logs diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..a279ad0bda2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci-cygwin-minimal.yml b/.github/workflows/ci-cygwin-minimal.yml deleted file mode 100644 index fa8f5db4f81..00000000000 --- a/.github/workflows/ci-cygwin-minimal.yml +++ /dev/null @@ -1,1042 +0,0 @@ -name: CI cygwin-minimal - -on: - push: - tags: - - '*' - workflow_dispatch: - # Allow to run manually - -env: - MAKE: make -j8 - SAGE_NUM_THREADS: 3 - CYGWIN: winsymlinks:native - EXTRA_CONFIGURE_ARGS: --enable-fat-binary - SAGE_LOCAL: /opt/sage-${{ github.sha }} - -jobs: - -############################################## stage-i ########################################## - - cygwin-stage-i-a: - env: - STAGE: i-a - # builds openblas - TARGETS: iml gsl - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-i-b: - env: - STAGE: i-b - TARGETS: cython setuptools_scm kiwisolver dateutil cycler pyparsing certifi pkgconfig pplpy - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-ii ########################################## - - cygwin-stage-ii-a: - env: - STAGE: ii-a - PREVIOUS_STAGES: i-* - TARGETS: cvxopt rpy2 - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-b: - env: - STAGE: ii-b - PREVIOUS_STAGES: i-* - TARGETS: singular maxima gap pari gfan palp flintqs arb ecm givaro - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-c: - env: - STAGE: ii-c - PREVIOUS_STAGES: i-* - TARGETS: cypari eclib fplll linbox giac - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-d: - env: - STAGE: ii-d - PREVIOUS_STAGES: i-* - TARGETS: ipython ipywidgets notebook - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-e: - env: - STAGE: ii-e - PREVIOUS_STAGES: i-* - TARGETS: threejs tachyon pillow jmol m4rie sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs sympow - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-iii ########################################## - - cygwin-stage-iii-a: - env: - STAGE: iii-a - PREVIOUS_STAGES: ii-* - TARGETS: sagelib - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-ii-a, cygwin-stage-ii-b, cygwin-stage-ii-c, cygwin-stage-ii-d, cygwin-stage-ii-e] - - runs-on: windows-latest - - continue-on-error: true - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-iii-b: - env: - STAGE: iii-b - PREVIOUS_STAGES: ii-* - TARGETS: networkx - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-ii-a, cygwin-stage-ii-b, cygwin-stage-ii-c, cygwin-stage-ii-d, cygwin-stage-ii-e] - - runs-on: windows-latest - - continue-on-error: true - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-iv ########################################## - - cygwin-stage-iv: - env: - STAGE: iv - PREVIOUS_STAGES: iii-* - TARGETS: build - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iii-a, cygwin-stage-iii-b] - - runs-on: windows-latest - - continue-on-error: true - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-v ########################################### - - cygwin-stage-v-a: - env: - STAGE: v-a - PREVIOUS_STAGES: iv - TARGETS: ptest-nodoc - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iv] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-v-b: - env: - STAGE: v-b - PREVIOUS_STAGES: iv - TARGETS: 4ti2 pynormaliz topcom lrslib latte_int cryptominisat - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iv] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-v-c: - env: - STAGE: v-c - PREVIOUS_STAGES: iv - TARGETS: sage_numerical_backends_coin - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iv] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-v-d: - env: - STAGE: v-d - PREVIOUS_STAGES: iv - TARGETS: qepcad barvinok isl qhull primecount plantri kenzo libsemigroups mcqd meataxe mpfrcx openssl p_group_cohomology rst2ipynb sirocco tdlib tides - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iv] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-v-e: - env: - STAGE: v-e - PREVIOUS_STAGES: iv - TARGETS: doc-html - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iv] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [minimal] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and test prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES="python39 python39-pip" - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"' - - name: tox - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.8 -m pip install tox' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" tox -e local-cygwin-choco-${{ matrix.pkgs }} -- $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename "$a").tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() diff --git a/.github/workflows/ci-cygwin-standard.yml b/.github/workflows/ci-cygwin-standard.yml index 32efd7f8a4a..53c674028ef 100644 --- a/.github/workflows/ci-cygwin-standard.yml +++ b/.github/workflows/ci-cygwin-standard.yml @@ -59,13 +59,11 @@ jobs: needs: [cygwin-stage-i-a, cygwin-stage-i-b] cygwin-stage-ii-e: - env: - STAGE: ii-e - PREVIOUS_STAGES: i-* - TARGETS: threejs tachyon pillow jmol m4rie sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs sympow - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - + uses: ./.github/workflows/cygwin.yml + with: + stage: ii-e + previous_stages: i-* + targets: threejs tachyon pillow jmol m4rie sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs sympow needs: [cygwin-stage-i-a, cygwin-stage-i-b] ############################################## stage-iii ########################################## diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 015f1c8fb4f..c07c6968095 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -38,7 +38,7 @@ jobs: matrix: stage: ["1", "2", "2-optional-0-o", "2-optional-p-z", "2-experimental-0-o", "2-experimental-p-z"] # python3_xcode is only accepted if enough packages are available from the system - # --> to test "minimal", we would need https://trac.sagemath.org/ticket/30949 + # --> to test "minimal", we would need https://github.com/sagemath/sage/issues/30949 tox_env: [homebrew-macos-usrlocal-minimal, homebrew-macos-usrlocal-standard, homebrew-macos-usrlocal-maximal, homebrew-macos-usrlocal-python3_xcode-standard, conda-forge-macos-minimal, conda-forge-macos-standard, conda-forge-macos-maximal] xcode_version_factor: [default] os: [ macos-11, macos-12 ] diff --git a/.github/workflows/ci-wsl.yml b/.github/workflows/ci-wsl.yml index 4093af802b0..e6d4d30cfc3 100644 --- a/.github/workflows/ci-wsl.yml +++ b/.github/workflows/ci-wsl.yml @@ -13,7 +13,7 @@ jobs: windows: runs-on: windows-latest name: Ubuntu 20.04 - # Following https://trac.sagemath.org/ticket/25206#comment:63 + # Following https://github.com/sagemath/sage/issues/25206#comment:63 steps: - name: Configure git run: git config --global core.symlinks true diff --git a/.gitignore b/.gitignore index e62fa805ecd..2faf325a44c 100644 --- a/.gitignore +++ b/.gitignore @@ -187,7 +187,7 @@ build/bin/sage-build-env-config /pkgs/sagemath-repl/requirements.txt /pkgs/sagemath-categories/MANIFEST.in -# same for old locations - before Trac #31577 +# same for old locations - before Issue #31577 /build/pkgs/*/src/build /build/pkgs/*/src/dist /build/pkgs/*/src/MANIFEST @@ -221,9 +221,6 @@ src/ENV/ src/env.bak/ src/venv.bak/ -# devcontainer -/.devcontainer/devcontainer.json - # mypy **/.mypy_cache/ diff --git a/.zenodo.json b/.zenodo.json index da76244bfa7..165f5ccb2d1 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,10 +1,10 @@ { "description": "Mirror of the Sage https://sagemath.org/ source tree", "license": "other-open", - "title": "sagemath/sage: 10.0.beta0", - "version": "10.0.beta0", + "title": "sagemath/sage: 10.0.beta2", + "version": "10.0.beta2", "upload_type": "software", - "publication_date": "2023-02-12", + "publication_date": "2023-02-23", "creators": [ { "affiliation": "SageMath.org", @@ -15,7 +15,7 @@ "related_identifiers": [ { "scheme": "url", - "identifier": "https://github.com/sagemath/sage/tree/10.0.beta0", + "identifier": "https://github.com/sagemath/sage/tree/10.0.beta2", "relation": "isSupplementTo" }, { diff --git a/Makefile b/Makefile index 414398ddf0d..008d6ff2221 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ SAGE_ROOT_LOGS = logs # The --stop flag below is just a random flag to induce graceful # breakage with non-GNU versions of make. -# See https://trac.sagemath.org/ticket/24617 +# See https://github.com/sagemath/sage/issues/24617 # Defer unknown targets to build/make/Makefile %:: @@ -259,8 +259,8 @@ TEST_FILES = --all TEST_FLAGS = # When the documentation is installed, "optional" also includes all tests marked 'sagemath_doc_html', -# see https://trac.sagemath.org/ticket/25345, https://trac.sagemath.org/ticket/26110, and -# https://trac.sagemath.org/ticket/32759 +# see https://github.com/sagemath/sage/issues/25345, https://github.com/sagemath/sage/issues/26110, and +# https://github.com/sagemath/sage/issues/32759 TEST_OPTIONAL = sage,optional # Keep track of the top-level *test* Makefile target for logging. diff --git a/README.md b/README.md index 1a0582d87c5..1233f17de73 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ in the Installation Guide. manager. For a large [list of Sage - packages](https://trac.sagemath.org/ticket/27330), Sage is able to + packages](https://github.com/sagemath/sage/issues/27330), Sage is able to detect whether an installed system package is suitable for use with Sage; in that case, Sage will not build another copy from source. diff --git a/VERSION.txt b/VERSION.txt index ec675a255a2..ef59effc672 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 10.0.beta0, Release Date: 2023-02-12 +SageMath version 10.0.beta2, Release Date: 2023-02-23 diff --git a/bootstrap b/bootstrap index 75bd9c78b9d..48c4801d4b5 100755 --- a/bootstrap +++ b/bootstrap @@ -47,17 +47,17 @@ AS_VAR_SET_IF([SAGE_ENABLE_$pkgname], [], [AS_VAR_SET([SAGE_ENABLE_$pkgname], [y done # --enable-SPKG options for pkgname in $(sage-package list :optional: :experimental: | sort); do - # Trac #29629: Temporary solution for Sage 9.1: Do not provide + # Issue #29629: Temporary solution for Sage 9.1: Do not provide # --enable-SPKG options for installing pip packages if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then pkgtype="$(cat build/pkgs/$pkgname/type)" - # Trac #29124: Do not provide --enable-_recommended and similar + # Issue #29124: Do not provide --enable-_recommended and similar case "$pkgname" in _*) ;; *) spkg_configures="$spkg_configures AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])" if [ -f build/pkgs/$pkgname/spkg-install -o -f build/pkgs/$pkgname/spkg-install.in ]; then - # Trac #31163: Not just an optional dummy package + # Issue #31163: Not just an optional dummy package spkg_configures="$spkg_configures SAGE_SPKG_ENABLE([$pkgname], [$pkgtype], [$(grep -v ^= build/pkgs/$pkgname/SPKG.rst | head -n1 2>/dev/null || echo $pkgname)])" fi diff --git a/build/bin/sage-bootstrap-python b/build/bin/sage-bootstrap-python index db4cea35dfd..1fa3ea565b1 100755 --- a/build/bin/sage-bootstrap-python +++ b/build/bin/sage-bootstrap-python @@ -30,7 +30,7 @@ SAGE_ORIG_PATH=${NEW_PATH%%':'} # Also, Trac #20023 removed the vendored argparse library from sage_bootstrap, # so we test that python is new enough (>= 2.7) to run it. # -# See https://trac.sagemath.org/ticket/29090 +# See https://github.com/sagemath/sage/issues/29090 # Trac #29890: Our first choice is "python", not "python3". This is to avoid # a defect of sage_bootstrap on macOS regarding SSL URLs. diff --git a/build/bin/sage-build-num-threads b/build/bin/sage-build-num-threads index 5dbdc5d5029..1ba165b1a21 100755 --- a/build/bin/sage-build-num-threads +++ b/build/bin/sage-build-num-threads @@ -10,7 +10,7 @@ # 3) The number of CPU cores in the system, as determined by # multiprocessing.cpu_count() # -# AUTHOR: Jeroen Demeyer (2011-12-08): Trac ticket #12016 +# AUTHOR: Jeroen Demeyer (2011-12-08): Github issue #12016 # from __future__ import print_function diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index 24769ebfffc..4eac9626ffa 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -98,7 +98,7 @@ # (Linux only--no-op on other platforms.) Check shared libraries loaded by # EXECUTABLE (may be a program or another library) for a library starting # with SONAME, and if found appends SONAME to the LD_PRELOAD environment -# variable. See https://trac.sagemath.org/24885. +# variable. See https://github.com/sagemath/sage/issues/24885. set -o allexport @@ -166,7 +166,7 @@ sdh_configure() { echo "Configuring $PKG_NAME" # Run all configure scripts with bash to work around bugs with # non-portable scripts. - # See https://trac.sagemath.org/ticket/24491 + # See https://github.com/sagemath/sage/issues/24491 if [ -z "$CONFIG_SHELL" ]; then export CONFIG_SHELL=`command -v bash` fi @@ -290,7 +290,7 @@ sdh_pip_install() { sdh_pip_editable_install() { echo "Installing $PKG_NAME (editable mode)" - # Until https://trac.sagemath.org/ticket/34209 switches us to PEP 660 editable wheels + # Until https://github.com/sagemath/sage/issues/34209 switches us to PEP 660 editable wheels export SETUPTOOLS_ENABLE_FEATURES=legacy-editable python3 -m pip install --verbose --no-deps --no-index --no-build-isolation --isolated --editable "$@" || \ sdh_die "Error installing $PKG_NAME" diff --git a/build/bin/sage-flock b/build/bin/sage-flock index d10eaf55091..9611cfde80b 100755 --- a/build/bin/sage-flock +++ b/build/bin/sage-flock @@ -11,7 +11,7 @@ # This is originally motivated by pip, but has since been generalized. We # should avoid running pip while uninstalling a package because that is prone # to race conditions. This script can be used to run pip under a lock. For -# details, see https://trac.sagemath.org/ticket/21672 +# details, see https://github.com/sagemath/sage/issues/21672 try: import sage_bootstrap diff --git a/build/bin/sage-site b/build/bin/sage-site index f9d13d53047..f36eb4d415d 100755 --- a/build/bin/sage-site +++ b/build/bin/sage-site @@ -184,7 +184,7 @@ if [ "$1" = '-i' ]; then for PKG in $PACKAGES; do echo # Check that $PKG is actually a Makefile target - # See https://trac.sagemath.org/ticket/25078 + # See https://github.com/sagemath/sage/issues/25078 if ! echo "$ALL_TARGETS" | grep "^${PKG}$" >/dev/null; then echo >&2 "Error: package '$PKG' not found" echo >&2 "Note: if it is an old-style package, installing these is no longer supported" diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 53835babf27..9b38ed6afc7 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -686,7 +686,7 @@ echo "Copying package files from temporary location $SAGE_DESTDIR to $SAGE_INST_ if [ -d "$SAGE_DESTDIR" ]; then # Some `find` implementations will put superfluous slashes in the # output if we give them a directory name with a slash; so make sure - # any trailing slash is removed; https://trac.sagemath.org/ticket/26013 + # any trailing slash is removed; https://github.com/sagemath/sage/issues/26013 PREFIX="${SAGE_DESTDIR_LOCAL%/}" rm -f "$PREFIX"/lib/*.la diff --git a/build/bin/sage-spkg-info b/build/bin/sage-spkg-info index ffc864320ed..4e53139fa7e 100755 --- a/build/bin/sage-spkg-info +++ b/build/bin/sage-spkg-info @@ -116,10 +116,10 @@ else echo "However, these system packages will not be used for building Sage" if [ -f "$PKG_SCRIPTS"/install-requires.txt ]; then echo "because using Python site-packages is not supported by the Sage distribution;" - echo "see https://trac.sagemath.org/ticket/29023" + echo "see https://github.com/sagemath/sage/issues/29023" else echo "because spkg-configure.m4 has not been written for this package;" - echo "see https://trac.sagemath.org/ticket/27330" + echo "see https://github.com/sagemath/sage/issues/27330" fi fi fi diff --git a/build/bin/sage-venv b/build/bin/sage-venv index 9ee9fc794be..c2728ba1143 100755 --- a/build/bin/sage-venv +++ b/build/bin/sage-venv @@ -38,7 +38,7 @@ if options.upgrade and options.clear: raise ValueError('you cannot supply --upgrade and --clear together.') if sys.platform == 'cygwin': - # default for Cygwin; see https://trac.sagemath.org/ticket/30149 + # default for Cygwin; see https://github.com/sagemath/sage/issues/30149 use_symlinks = False else: # default for posix diff --git a/build/make/Makefile.in b/build/make/Makefile.in index e971def2416..84f6f877e3d 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -78,7 +78,7 @@ DUMMY_PACKAGES = @SAGE_DUMMY_PACKAGES@ # Set to the path to Sage's GCC (if GCC is installed) to force rebuilds # of packages if GCC changed. -# See m4/sage_spkg_collect.m4 and https://trac.sagemath.org/ticket/24703 +# See m4/sage_spkg_collect.m4 and https://github.com/sagemath/sage/issues/24703 GCC_DEP = @SAGE_GCC_DEP@ # Versions of all the packages, in the format diff --git a/build/pkgs/_prereq/distros/cygwin.txt b/build/pkgs/_prereq/distros/cygwin.txt index 115d2555745..2bf3164005b 100644 --- a/build/pkgs/_prereq/distros/cygwin.txt +++ b/build/pkgs/_prereq/distros/cygwin.txt @@ -12,14 +12,14 @@ binutils make m4 -# a system python is needed for downloading the sage packages, https://trac.sagemath.org/ticket/29090 +# a system python is needed for downloading the sage packages, https://github.com/sagemath/sage/issues/29090 python39-urllib3 python39 perl perl-ExtUtils-MakeMaker tar gcc-core gcc-g++ -# Needed according to embray at https://trac.sagemath.org/ticket/26964: +# Needed according to embray at https://github.com/sagemath/sage/issues/26964: # The need for which comes [...] from MPIR's configure script findutils which diff --git a/build/pkgs/_prereq/distros/fedora.txt b/build/pkgs/_prereq/distros/fedora.txt index a82e29abc30..79919eef51b 100644 --- a/build/pkgs/_prereq/distros/fedora.txt +++ b/build/pkgs/_prereq/distros/fedora.txt @@ -15,7 +15,7 @@ binutils make m4 -# a system python is needed for downloading the sage packages, https://trac.sagemath.org/ticket/29090 +# a system python is needed for downloading the sage packages, https://github.com/sagemath/sage/issues/29090 python3 perl perl-ExtUtils-MakeMaker @@ -26,11 +26,11 @@ gcc # configure: error: in `/sage': # configure: error: C++ preprocessor "/lib/cpp" fails sanity check gcc-c++ -# Needed according to embray at https://trac.sagemath.org/ticket/26964: +# Needed according to embray at https://github.com/sagemath/sage/issues/26964: # The need for which comes [...] from MPIR's configure script findutils which -# Needed for pcre configure, see https://trac.sagemath.org/ticket/29129: +# Needed for pcre configure, see https://github.com/sagemath/sage/issues/29129: diffutils # Needed for openssl 3.0 perl-IPC-Cmd diff --git a/build/pkgs/cddlib/spkg-configure.m4 b/build/pkgs/cddlib/spkg-configure.m4 index 8508f28512d..b18cd879b00 100644 --- a/build/pkgs/cddlib/spkg-configure.m4 +++ b/build/pkgs/cddlib/spkg-configure.m4 @@ -16,7 +16,7 @@ SAGE_SPKG_CONFIGURE([cddlib], [ AC_CHECK_PROGS(SCDD, [scdd_gmp scdd]) AS_IF([test x$SCDD = x], [sage_spkg_install_cddlib=yes]) - dnl https://trac.sagemath.org/ticket/30319 + dnl https://github.com/sagemath/sage/issues/30319 AS_IF([test -n "$CDDEXEC"], [ AC_MSG_CHECKING([whether $CDDEXEC --redcheck works correctly for real input]) cat > conftest.ine <&2 "Warning: Disabling debug symbols on MacOS X 10.5" \ "PowerPC because of a linker (?) bug." - echo >&2 "See http://trac.sagemath.org/sage_trac/ticket/5847#comment:35" \ + echo >&2 "See https://github.com/sagemath/sage/issues/5847#comment:35" \ "ff. for details." echo >&2 CFLAGS="-O3 $ORIGINAL_CFLAGS" diff --git a/build/pkgs/elliptic_curves/spkg-install.py b/build/pkgs/elliptic_curves/spkg-install.py index 79b6c423446..c6e9bbcffa9 100644 --- a/build/pkgs/elliptic_curves/spkg-install.py +++ b/build/pkgs/elliptic_curves/spkg-install.py @@ -60,7 +60,7 @@ def install_ellcurves(): ellcurves_root = os.path.join(SAGE_SHARE, 'ellcurves') # Remove previous installs (possibly with bad permissions, see - # https://trac.sagemath.org/ticket/21641) + # https://github.com/sagemath/sage/issues/21641) import shutil try: shutil.rmtree(ellcurves_root) diff --git a/build/pkgs/fflas_ffpack/spkg-install.in b/build/pkgs/fflas_ffpack/spkg-install.in index 55684dd8a5f..b9dd851875f 100644 --- a/build/pkgs/fflas_ffpack/spkg-install.in +++ b/build/pkgs/fflas_ffpack/spkg-install.in @@ -24,13 +24,13 @@ if [ "$SAGE_FAT_BINARY" = yes ]; then fi # Need to use 'bash' for configure, see -# https://trac.sagemath.org/ticket/23451 +# https://github.com/sagemath/sage/issues/23451 if [ -z "$CONFIG_SHELL" ]; then export CONFIG_SHELL=`command -v bash` fi # We disable openmp because of build failures, see -# http://trac.sagemath.org/ticket/17635#comment:67 +# https://github.com/sagemath/sage/issues/17635#comment:67 sdh_configure --with-default="$SAGE_LOCAL" --with-blas-libs="$LINBOX_BLAS" \ "$LINBOX_BLAS_CFLAGS" --disable-static \ --enable-precompilation $FFLAS_FFPACK_CONFIGURE diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in index 2ceadf99db4..30320027274 100644 --- a/build/pkgs/gap/spkg-install.in +++ b/build/pkgs/gap/spkg-install.in @@ -53,7 +53,7 @@ sdh_install pkg/GAPDoc-* pkg/primgrp-* pkg/SmallGrp-* pkg/transgrp "$GAP_ROOT"/p # typically "expected" to be loaded: These are the default packages that are # autoloaded at GAP startup (via the PackagesToLoad UserPreference) with an # out-of-the-box GAP installation; see -# https://trac.sagemath.org/ticket/22626#comment:393 for discussion on this +# https://github.com/sagemath/sage/issues/22626#comment:393 for discussion on this # # Also include atlasrep which is a dependency of tomlib sdh_install \ @@ -96,7 +96,7 @@ done # be going away. This breaks the build toolchain for some compiled GAP # packages. We need to replace these paths with the final GAP_ROOT path. The # below will work so long as neither of these paths contain '|', and if they do -# then god help you. https://trac.sagemath.org/ticket/27218 +# then god help you. https://github.com/sagemath/sage/issues/27218 sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \ "$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \ "$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \ diff --git a/build/pkgs/gc/spkg-install.in b/build/pkgs/gc/spkg-install.in index e5d254c86fe..4acf5cf8b19 100644 --- a/build/pkgs/gc/spkg-install.in +++ b/build/pkgs/gc/spkg-install.in @@ -3,9 +3,9 @@ cd src GC_CONFIGURE="--enable-large-config" if [ "$UNAME" = "CYGWIN" ]; then - # See https://trac.sagemath.org/ticket/22694 + # See https://github.com/sagemath/sage/issues/22694 GC_CONFIGURE="$GC_CONFIGURE --enable-threads=posix --enable-handle-fork --enable-shared --disable-static" - # Force use of mmap on Cygwin https://trac.sagemath.org/ticket/23973 + # Force use of mmap on Cygwin https://github.com/sagemath/sage/issues/23973 export CFLAGS="$CFLAGS -DUSE_MMAP -DUSE_MUNMAP" fi diff --git a/build/pkgs/gcc/dependencies b/build/pkgs/gcc/dependencies index 9af2c9534bb..34a0cdf783d 100644 --- a/build/pkgs/gcc/dependencies +++ b/build/pkgs/gcc/dependencies @@ -5,5 +5,5 @@ NOTE: all dependencies of GCC must be order-only dependencies (appearing after the | symbol). This is to prevent rebuilds of GCC even if the dependencies are updated. There is logic in the top-level configure file to ensure that GCC is rebuilt anyway if required. See -https://trac.sagemath.org/ticket/24907 +https://github.com/sagemath/sage/issues/24907 ------------------------------------------------------------------------ diff --git a/build/pkgs/gcc/spkg-configure.m4 b/build/pkgs/gcc/spkg-configure.m4 index 63335eb7357..fe4d220a189 100644 --- a/build/pkgs/gcc/spkg-configure.m4 +++ b/build/pkgs/gcc/spkg-configure.m4 @@ -78,7 +78,7 @@ SAGE_SPKG_CONFIGURE_BASE([gcc], [ SAGE_MUST_INSTALL_GCC([gcc is already installed in SAGE_LOCAL]) # Check whether it actually works... - # See https://trac.sagemath.org/ticket/24599 + # See https://github.com/sagemath/sage/issues/24599 SAGE_CHECK_BROKEN_GCC() if test x$SAGE_BROKEN_GCC = xyes; then # Prentend that GCC is not installed. @@ -167,7 +167,7 @@ SAGE_SPKG_CONFIGURE_BASE([gcc], [ ], [1[[3-9]].*], [ # Install our own GCC if the system-provided one is newer than 12.x. - # See https://trac.sagemath.org/ticket/29456 + # See https://github.com/sagemath/sage/issues/29456 SAGE_SHOULD_INSTALL_GCC([$CXX is g++ version $GXX_VERSION, which is too recent for this version of Sage]) ]) fi @@ -181,7 +181,7 @@ SAGE_SPKG_CONFIGURE_BASE([gcc], [ fi # Check that the assembler and linker used by $CXX match $AS and $LD. - # See http://trac.sagemath.org/sage_trac/ticket/14296 + # See https://github.com/sagemath/sage/issues/14296 if test -n "$AS"; then CXX_as=`$CXX -print-prog-name=as 2>/dev/null` CXX_as=`command -v $CXX_as 2>/dev/null` diff --git a/build/pkgs/gdb/distros/conda.txt b/build/pkgs/gdb/distros/conda.txt index 5d13af10681..b7a56f9afb3 100644 --- a/build/pkgs/gdb/distros/conda.txt +++ b/build/pkgs/gdb/distros/conda.txt @@ -1,2 +1,2 @@ -# Disabled for now because of https://trac.sagemath.org/ticket/30845#comment:269 +# Disabled for now because of https://github.com/sagemath/sage/issues/30845#comment:269 # gdb diff --git a/build/pkgs/gfan/patches/fix-int64-for-32bit-archs.patch b/build/pkgs/gfan/patches/fix-int64-for-32bit-archs.patch index 0d1baf45cec..773b71d08c0 100644 --- a/build/pkgs/gfan/patches/fix-int64-for-32bit-archs.patch +++ b/build/pkgs/gfan/patches/fix-int64-for-32bit-archs.patch @@ -3,7 +3,7 @@ On 32-bit architectures, longs are only 32 bits. The resulting overflow was causing an infinite loop in the 0602ResultantFanProjection test. References: -https://trac.sagemath.org/ticket/32088 +https://github.com/sagemath/sage/issues/32088 https://salsa.debian.org/math-team/gfan/-/commit/acaaa70 https://github.com/void-linux/void-packages/pull/34182 diff --git a/build/pkgs/gfan/spkg-install.in b/build/pkgs/gfan/spkg-install.in index f3224735e4f..5c31e18ec54 100644 --- a/build/pkgs/gfan/spkg-install.in +++ b/build/pkgs/gfan/spkg-install.in @@ -8,7 +8,7 @@ cd src find src -type f -print0 | xargs -0 sed -i.bak "s/log2/logger2/g" # To let testsuite/0009RenderStairCase pass on 32bit machines -# See https://trac.sagemath.org/ticket/32088 +# See https://github.com/sagemath/sage/issues/32088 case "$($CC -dumpmachine)" in i[3456]86*) CXXFLAGS+=" -ffloat-store" diff --git a/build/pkgs/gfortran/spkg-configure.m4 b/build/pkgs/gfortran/spkg-configure.m4 index db7c4e7bc14..1a2d6ba767c 100644 --- a/build/pkgs/gfortran/spkg-configure.m4 +++ b/build/pkgs/gfortran/spkg-configure.m4 @@ -88,7 +88,7 @@ SAGE_SPKG_CONFIGURE([gfortran], [ ], [1[[3-9]].*], [ # Install our own gfortran if the system-provided one is newer than 12.x. - # See https://trac.sagemath.org/ticket/29456, https://trac.sagemath.org/ticket/31838 + # See https://github.com/sagemath/sage/issues/29456, https://github.com/sagemath/sage/issues/31838 SAGE_MUST_INSTALL_GFORTRAN([$FC is version $GFORTRAN_VERSION, which is too recent for this version of Sage]) ]) ]) diff --git a/build/pkgs/giac/patches/cygwin-icas.patch b/build/pkgs/giac/patches/cygwin-icas.patch index 88669806647..56321e78b26 100644 --- a/build/pkgs/giac/patches/cygwin-icas.patch +++ b/build/pkgs/giac/patches/cygwin-icas.patch @@ -1,6 +1,6 @@ Disable threaded eval function on Cygwin since it's currently buggy, and not strictly needed in the first place since we don't -build giac with FLTK support; see https://trac.sagemath.org/ticket/27385 +build giac with FLTK support; see https://github.com/sagemath/sage/issues/27385 --- a/src/icas.cc 2018-12-22 17:08:24.000000000 +0100 +++ b/src/icas.cc 2019-03-06 14:38:19.814030200 +0100 @@ -160,7 +160,7 @@ diff --git a/build/pkgs/giac/patches/isnan-conflict.patch b/build/pkgs/giac/patches/isnan-conflict.patch index 88ca5f715a6..20af63aa806 100644 --- a/build/pkgs/giac/patches/isnan-conflict.patch +++ b/build/pkgs/giac/patches/isnan-conflict.patch @@ -1,7 +1,7 @@ Just always use std::isnan and std::isinf so there is no risk of conflicting with the libc math.h equivalents thereof. -See https://trac.sagemath.org/ticket/27263 +See https://github.com/sagemath/sage/issues/27263 --- a/src/global.cc 2019-02-12 15:49:03.082594000 +0000 +++ b/src/global.cc 2019-02-12 15:49:43.438594000 +0000 @@ -4139,11 +4139,7 @@ diff --git a/build/pkgs/giac/patches/pari_2_11.patch b/build/pkgs/giac/patches/pari_2_11.patch index 24142257a34..27de3f12fac 100644 --- a/build/pkgs/giac/patches/pari_2_11.patch +++ b/build/pkgs/giac/patches/pari_2_11.patch @@ -1,6 +1,6 @@ Change test output for PARI 2.11 -See https://trac.sagemath.org/ticket/25567 +See https://github.com/sagemath/sage/issues/25567 and https://xcas.univ-grenoble-alpes.fr/forum/viewtopic.php?f=4&t=2102 diff -ru a/check/TP11-sol.cas.out1 b/check/TP11-sol.cas.out1 diff --git a/build/pkgs/glpk/patches/error_recovery.patch b/build/pkgs/glpk/patches/error_recovery.patch index f040f4b4a19..a383e25769b 100644 --- a/build/pkgs/glpk/patches/error_recovery.patch +++ b/build/pkgs/glpk/patches/error_recovery.patch @@ -1,6 +1,6 @@ From: Jeroen Demeyer Allow error recovery. See discussion at -http://trac.sagemath.org/ticket/20710#comment:18 +https://github.com/sagemath/sage/issues/20710#comment:18 diff --git a/src/env/error.c b/src/env/error.c index a898b76..154de0f 100644 diff --git a/build/pkgs/glpk/spkg-install.in b/build/pkgs/glpk/spkg-install.in index cdb4b4a168e..a911c46f024 100644 --- a/build/pkgs/glpk/spkg-install.in +++ b/build/pkgs/glpk/spkg-install.in @@ -1,6 +1,6 @@ cd src/ -# Use newer version of config.guess and config.sub (see Trac #19713) +# Use newer version of config.guess and config.sub (see Github issue #19713) cp "$SAGE_ROOT"/config/config.* . # Note: The following doesn't work with spaces in `$SAGE_LOCAL`, but we don't @@ -26,7 +26,7 @@ sdh_configure --with-gmp --disable-static sdh_make # Remove old libraries to make sure we can downgrade it if needed. -# See https://trac.sagemath.org/ticket/23596#comment:4 and later. +# See https://github.com/sagemath/sage/issues/23596#comment:4 and later. rm -f "$SAGE_LOCAL"/lib/libglpk.* sdh_make_install diff --git a/build/pkgs/glucose/spkg-install.in b/build/pkgs/glucose/spkg-install.in index 8dabc6458fb..f99cca1ae18 100644 --- a/build/pkgs/glucose/spkg-install.in +++ b/build/pkgs/glucose/spkg-install.in @@ -8,7 +8,7 @@ sdh_make sdh_install glucose ${SAGE_LOCAL}/bin/ cd .. -# Possible license issue, see warning below and discussion on https://trac.sagemath.org/ticket/26361 +# Possible license issue, see warning below and discussion on https://github.com/sagemath/sage/issues/26361 cd parallel sdh_make sdh_install glucose-syrup ${SAGE_LOCAL}/bin/ diff --git a/build/pkgs/iconv/spkg-check.in b/build/pkgs/iconv/spkg-check.in index 4ae5a6c622d..c0e91eff164 100644 --- a/build/pkgs/iconv/spkg-check.in +++ b/build/pkgs/iconv/spkg-check.in @@ -7,7 +7,7 @@ SunOS) # We must test iconv, but on Solaris some tests will always fail. echo "If you see 3 core dumps, don't be too alarmed." echo "This is a known Solaris bug and can safely be ignored. See" - echo " http://trac.sagemath.org/sage_trac/ticket/8270" + echo " https://github.com/sagemath/sage/issues/8270" echo "It will probably be fixed in later releases of Solaris 10," echo "and was fixed in build 66 of OpenSolaris:" echo " http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6550204" diff --git a/build/pkgs/iconv/spkg-install.in b/build/pkgs/iconv/spkg-install.in index 9dc19c7bdab..89b401c70e9 100644 --- a/build/pkgs/iconv/spkg-install.in +++ b/build/pkgs/iconv/spkg-install.in @@ -1,6 +1,6 @@ # Only build iconv on Solaris, HP-UX and Cygwin. See -# http://trac.sagemath.org/sage_trac/ticket/8567 and -# http://trac.sagemath.org/sage_trac/ticket/9603 +# https://github.com/sagemath/sage/issues/8567 and +# https://github.com/sagemath/sage/issues/9603 # for details. case "$UNAME" in @@ -8,8 +8,8 @@ CYGWIN|HP-UX|SunOS) echo "iconv will be installed as the operating system is Cygwin, HP-UX or Solaris." echo "These systems either lack iconv, or do not have a sufficiently capable" echo "version of iconv. See:" - echo " http://trac.sagemath.org/sage_trac/ticket/8567" - echo " http://trac.sagemath.org/sage_trac/ticket/9603" + echo " https://github.com/sagemath/sage/issues/8567" + echo " https://github.com/sagemath/sage/issues/9603" # Disable NLS on Cygwin to be able to build libiconv without the Cygwin # libiconv package. @@ -29,8 +29,8 @@ CYGWIN|HP-UX|SunOS) echo "Solaris, HP-UX and Cygwin, as the system's iconv will be used" echo "on other platforms, rather than the one shipped with Sage." echo "See:" - echo " http://trac.sagemath.org/sage_trac/ticket/8567" - echo " http://trac.sagemath.org/sage_trac/ticket/9603" + echo " https://github.com/sagemath/sage/issues/8567" + echo " https://github.com/sagemath/sage/issues/9603" exit 0 esac diff --git a/build/pkgs/jupyterlab/requirements.txt b/build/pkgs/jupyterlab/requirements.txt index 802d33d22f1..f03a26674fd 100644 --- a/build/pkgs/jupyterlab/requirements.txt +++ b/build/pkgs/jupyterlab/requirements.txt @@ -1,3 +1,3 @@ jupyterlab ~= 3.3 -# See https://trac.sagemath.org/ticket/33607 +# See https://github.com/sagemath/sage/issues/33607 jupyterlab-server < 2.11 diff --git a/build/pkgs/libgd/spkg-install.in b/build/pkgs/libgd/spkg-install.in index dc73d868fa5..d291869a923 100644 --- a/build/pkgs/libgd/spkg-install.in +++ b/build/pkgs/libgd/spkg-install.in @@ -6,7 +6,7 @@ if [ "$UNAME" = "CYGWIN" ]; then # Compiling with vpx support creates a broken library in some cases # because the vpx package itself is broken on some older Cygwin versions; # we don't need this feature so safer to just disable - # https://trac.sagemath.org/ticket/27970 + # https://github.com/sagemath/sage/issues/27970 LIBGD_CONFIGURE="--without-vpx $LIBGD_CONFIGURE" fi if [ -n "$SAGE_FREETYPE_PREFIX" ]; then diff --git a/build/pkgs/linbox/spkg-install.in b/build/pkgs/linbox/spkg-install.in index a2ad194837a..8d415e81fd8 100644 --- a/build/pkgs/linbox/spkg-install.in +++ b/build/pkgs/linbox/spkg-install.in @@ -20,13 +20,13 @@ fi # Disable fplll as version 5.x is not supported by linbox <= 1.5.0. # This is harmless as no functionality using fplll is exposed in Sage. -# See trac ticket #21221. +# See github issue #21221. LINBOX_CONFIGURE="--without-fplll $LINBOX_CONFIGURE" # We disable openmp because of build failures, see -# http://trac.sagemath.org/ticket/17635#comment:67 +# https://github.com/sagemath/sage/issues/17635#comment:67 # We disable ocl because of build failures, see -# https://trac.sagemath.org/ticket/32076 +# https://github.com/sagemath/sage/issues/32076 sdh_configure --with-default="$SAGE_LOCAL" \ --disable-static --disable-openmp --without-ocl \ $LINBOX_CONFIGURE diff --git a/build/pkgs/matplotlib/make-setup-config.py b/build/pkgs/matplotlib/make-setup-config.py index 4f9acf1f04c..61f61806810 100644 --- a/build/pkgs/matplotlib/make-setup-config.py +++ b/build/pkgs/matplotlib/make-setup-config.py @@ -11,7 +11,7 @@ config.set('libs', 'system_qhull', 'True') # lto is problematic if we mix libraries from the OS with our own libraries, # which are not necessarily compiled with the same gcc version -# https://trac.sagemath.org/ticket/27754 +# https://github.com/sagemath/sage/issues/27754 config.set('libs', 'enable_lto', 'False') ##################################################################### diff --git a/build/pkgs/maxima/spkg-install.in b/build/pkgs/maxima/spkg-install.in index 3516e1b3146..3ae6382f9ba 100644 --- a/build/pkgs/maxima/spkg-install.in +++ b/build/pkgs/maxima/spkg-install.in @@ -1,6 +1,6 @@ # Sometimes, ECL gives interactive prompts when something goes wrong # during the build. Avoid this by redirecting stdin from /dev/null. -# See http://trac.sagemath.org/sage_trac/ticket/11884#comment:34 +# See https://github.com/sagemath/sage/issues/11884#comment:34 exec Date: Tue, 6 Mar 2018 00:18:41 +0100 Don't rely on pandoc for the readme -See https://trac.sagemath.org/ticket/24901 +See https://github.com/sagemath/sage/issues/24901 and https://github.com/aaren/notedown/issues/76 diff --git a/setup.py b/setup.py diff --git a/build/pkgs/numpy/spkg-install.in b/build/pkgs/numpy/spkg-install.in index 2b555d8b871..e28660f393f 100644 --- a/build/pkgs/numpy/spkg-install.in +++ b/build/pkgs/numpy/spkg-install.in @@ -7,7 +7,7 @@ if [ `uname` = "Darwin" ]; then unset ATLAS unset BLAS unset LAPACK - # https://trac.sagemath.org/ticket/34110#comment:35 + # https://github.com/sagemath/sage/issues/34110#comment:35 # The fix for "reciprocal" (affected by a clang compiler bug) in # https://github.com/numpy/numpy/pull/19926 relies on -ftrapping-math # being used when Apple clang v12+ is used. diff --git a/build/pkgs/openblas/spkg-install.in b/build/pkgs/openblas/spkg-install.in index f6ac7753838..00413ca517d 100644 --- a/build/pkgs/openblas/spkg-install.in +++ b/build/pkgs/openblas/spkg-install.in @@ -34,7 +34,7 @@ fi echo "Building OpenBLAS: $MAKE $OPENBLAS_CONFIGURE" -# Ensure USE_TLS=1 ; see https://trac.sagemath.org/ticket/27256 +# Ensure USE_TLS=1 ; see https://github.com/sagemath/sage/issues/27256 OPENBLAS_CONFIGURE="$OPENBLAS_CONFIGURE USE_TLS=1" if ! (sdh_make libs netlib shared $OPENBLAS_CONFIGURE); then @@ -51,7 +51,7 @@ if ! (sdh_make libs netlib shared $OPENBLAS_CONFIGURE); then fi fi -# See https://trac.sagemath.org/ticket/30335 +# See https://github.com/sagemath/sage/issues/30335 rm -f "$SAGE_LOCAL/lib/pkgconfig/cblas.pc" "$SAGE_LOCAL/lib/pkgconfig/blas.pc" "$SAGE_LOCAL/lib/pkgconfig/lapack.pc" sdh_make_install PREFIX="$SAGE_LOCAL" NO_STATIC=1 $OPENBLAS_CONFIGURE diff --git a/build/pkgs/pcre/patches/8.39-cygwin-jit.patch b/build/pkgs/pcre/patches/8.39-cygwin-jit.patch index e581623b0c5..ca1ea43c435 100644 --- a/build/pkgs/pcre/patches/8.39-cygwin-jit.patch +++ b/build/pkgs/pcre/patches/8.39-cygwin-jit.patch @@ -1,5 +1,5 @@ Patch from Cygwin to fix segfault when using the JIT compiler; see -https://trac.sagemath.org/ticket/23291 +https://github.com/sagemath/sage/issues/23291 --- a/sljit/sljitConfigInternal.h 2016-04-06 03:05:43.000000000 -0500 +++ b/sljit/sljitConfigInternal.h 2016-08-11 14:33:58.201820000 -0500 @@ -564,7 +564,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free diff --git a/build/pkgs/pcre/spkg-install.in b/build/pkgs/pcre/spkg-install.in index 892e1aa84f7..fb0c49272fe 100644 --- a/build/pkgs/pcre/spkg-install.in +++ b/build/pkgs/pcre/spkg-install.in @@ -8,7 +8,7 @@ sdh_make # The JIT feature of pcre is known to be broken on some systems, in # particular on Solaris. We run the testsuite of pcre (this takes only # a few seconds). It the testsuite fails, we rebuild pcre without JIT -# support. See https://trac.sagemath.org/ticket/24628 +# support. See https://github.com/sagemath/sage/issues/24628 if ! $MAKE check; then echo >&2 "*** Rebuilding pcre without JIT support ***" $MAKE clean diff --git a/build/pkgs/ppl/patches/cygwin-weak-symbols.patch b/build/pkgs/ppl/patches/cygwin-weak-symbols.patch index 81215ea432c..535a009f82d 100644 --- a/build/pkgs/ppl/patches/cygwin-weak-symbols.patch +++ b/build/pkgs/ppl/patches/cygwin-weak-symbols.patch @@ -1,6 +1,6 @@ weak symbols don't work properly in 64-bit Cygwin and should not be used (even though it will compile with __attribute__((weak)), -it will not linke; see https://trac.sagemath.org/ticket/16152 +it will not linke; see https://github.com/sagemath/sage/issues/16152 --- a/src/assertions.hh 2016-07-26 16:21:22.591434100 +0200 +++ b/src/assertions.hh 2016-07-26 16:35:09.500888200 +0200 @@ -98,7 +98,7 @@ diff --git a/build/pkgs/ppl/spkg-install.in b/build/pkgs/ppl/spkg-install.in index bc570b95cfc..1f3162a6269 100644 --- a/build/pkgs/ppl/spkg-install.in +++ b/build/pkgs/ppl/spkg-install.in @@ -19,7 +19,7 @@ fi # Workaround to disable PPL's "watchdog timer", preventing it from clobbering # Cysignals' SIGALRM handler on Cygwin; see -# https://trac.sagemath.org/ticket/21190 +# https://github.com/sagemath/sage/issues/21190 if [ "$UNAME" = "CYGWIN" ]; then sed -i 's/#define HAVE_DECL_SETITIMER 1/#define HAVE_DECL_SETITIMER 0/' config.h fi diff --git a/build/pkgs/prompt_toolkit/install-requires.txt b/build/pkgs/prompt_toolkit/install-requires.txt index fe90872577d..30d49fc8454 100644 --- a/build/pkgs/prompt_toolkit/install-requires.txt +++ b/build/pkgs/prompt_toolkit/install-requires.txt @@ -1,2 +1,2 @@ -# https://trac.sagemath.org/ticket/33428 - prompt_toolkit 3.0.25+ breaks Ctrl-C +# https://github.com/sagemath/sage/issues/33428 - prompt_toolkit 3.0.25+ breaks Ctrl-C prompt_toolkit >=3.0.5, <3.0.25 diff --git a/build/pkgs/ptyprocess/install-requires.txt b/build/pkgs/ptyprocess/install-requires.txt index de89260872b..a89be777b4a 100644 --- a/build/pkgs/ptyprocess/install-requires.txt +++ b/build/pkgs/ptyprocess/install-requires.txt @@ -1,3 +1,3 @@ ptyprocess ==0.5.1 -# https://trac.sagemath.org/ticket/31280#comment:42 and following +# https://github.com/sagemath/sage/issues/31280#comment:42 and following # sagelib is not compatible with ptyprocess 0.5.2, 0.6, and 0.7 diff --git a/build/pkgs/python3/spkg-build.in b/build/pkgs/python3/spkg-build.in index 3cb837b3be6..0c08814a242 100644 --- a/build/pkgs/python3/spkg-build.in +++ b/build/pkgs/python3/spkg-build.in @@ -52,7 +52,7 @@ elif [ "$UNAME" = SunOS ]; then # Enable some C99 features on Solaris. This in particular enables # the isinf() and isfinite() functions. It works both for C and # C++ code (which is not true for -std=c99). See - # http://trac.sagemath.org/sage_trac/ticket/14265 + # https://github.com/sagemath/sage/issues/14265 export CFLAGS="-D__C99FEATURES__ $CFLAGS" fi @@ -69,14 +69,14 @@ rm -f "$SAGE_LOCAL/lib/python" # Remove old libraries. We really need to do this before building Python # since Python tries to import some modules (e.g. ctypes) at build-time. # We need to make sure that the old installed libraries in local/lib are -# not used for that. See https://trac.sagemath.org/ticket/24605 +# not used for that. See https://github.com/sagemath/sage/issues/24605 rm -f "$SAGE_LOCAL"/lib/lib"$PKG_BASE"* # Note: --without-ensurepip ensures that setuptools+pip are *not* installed # automatically when installing python3. They will be installed instead by # the separate setuptools and pip packages; see - # https://trac.sagemath.org/ticket/23398 + # https://github.com/sagemath/sage/issues/23398 PYTHON_CONFIGURE="$PYTHON_CONFIGURE --without-ensurepip" sdh_configure --enable-shared $PYTHON_CONFIGURE diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index 19642b59dd9..d8ece39683a 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -33,7 +33,7 @@ SAGE_SPKG_CONFIGURE([python3], [ MIN_VERSION, LT_VERSION, $check_modules, [ AS_IF([[conftest_venv/bin/python3 -m sysconfig | grep '^\sw*\(C\|LD\)FLAGS *=.*[" ]-[IL] *[^.]' ]] [>& AS_MESSAGE_LOG_FD 2>&1 ], [ - AC_MSG_WARN([this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://trac.sagemath.org/ticket/31132]) + AC_MSG_WARN([this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://github.com/sagemath/sage/issues/31132]) ]) dnl It is good ac_cv_path_PYTHON3="$ac_path_PYTHON3" @@ -52,7 +52,7 @@ SAGE_SPKG_CONFIGURE([python3], [ MIN_VERSION, LT_VERSION, $check_modules, [ AS_IF([[conftest_venv/bin/python3 -m sysconfig | grep '^\sw*\(C\|LD\)FLAGS *=.*[" ]-[IL] *[^.]' ]] [>& AS_MESSAGE_LOG_FD 2>&1 ], [ - AC_MSG_RESULT([no, this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://trac.sagemath.org/ticket/31132; to use it anyway, use ./configure --with-python=$ac_path_PYTHON3]) + AC_MSG_RESULT([no, this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://github.com/sagemath/sage/issues/31132; to use it anyway, use ./configure --with-python=$ac_path_PYTHON3]) ], [ dnl It is good ac_cv_path_PYTHON3="$ac_path_PYTHON3" diff --git a/build/pkgs/python3/spkg-install.in b/build/pkgs/python3/spkg-install.in index 20c039cc81a..eae0f39647a 100644 --- a/build/pkgs/python3/spkg-install.in +++ b/build/pkgs/python3/spkg-install.in @@ -60,7 +60,7 @@ if [ "$UNAME" = "Darwin" ] && \ [ `uname -r | cut '-d.' -f1` -gt 9 ]; then rm -f "${SAGE_DESTDIR}${PYTHON_CONFIG_DIR}/libpython${PYTHON_LDVERSION}.a" elif [ "$UNAME" = "CYGWIN" ]; then - # See http://trac.sagemath.org/ticket/20437 + # See https://github.com/sagemath/sage/issues/20437 ln -sf "${PYTHON_CONFIG_DIR}/libpython${PYTHON_LDVERSION}.dll.a" \ "${SAGE_DESTDIR_LOCAL}/lib/libpython${PYTHON_LDVERSION}.dll.a" fi diff --git a/build/pkgs/qepcad/patches/0002-WIP-Don-t-add-lrt.patch b/build/pkgs/qepcad/patches/0002-WIP-Don-t-add-lrt.patch index 54282fbf8f0..08e2d8644df 100644 --- a/build/pkgs/qepcad/patches/0002-WIP-Don-t-add-lrt.patch +++ b/build/pkgs/qepcad/patches/0002-WIP-Don-t-add-lrt.patch @@ -18,7 +18,7 @@ index d184650..f13113b 100644 +LIBS = -lreadline + +# On macOS, librt is not available, -+# see https://trac.sagemath.org/ticket/28388 ++# see https://github.com/sagemath/sage/issues/28388 +#ifeq ($(findstring darwin,${OSTYPE}),) +#LIBS += -lrt +#endif diff --git a/build/pkgs/qepcad/spkg-install.in b/build/pkgs/qepcad/spkg-install.in index 11fbea86b16..4287c3e4f1a 100644 --- a/build/pkgs/qepcad/spkg-install.in +++ b/build/pkgs/qepcad/spkg-install.in @@ -5,11 +5,11 @@ export saclib="$SAGE_LOCAL/lib/saclib" export qe=$(pwd -P) # * Override SHELL: use /bin/sh instead of /bin/csh, see -# https://trac.sagemath.org/ticket/10224 +# https://github.com/sagemath/sage/issues/10224 # * Add rpath to compiler flags, see -# https://trac.sagemath.org/ticket/22653 +# https://github.com/sagemath/sage/issues/22653 # * Use ARFLAGS that also work on macOS, avoiding the U option, see -# https://trac.sagemath.org/ticket/28388 +# https://github.com/sagemath/sage/issues/28388 LIBS=-lreadline if [ "$UNAME" = "Linux" ]; then LIBS="$LIBS -lrt" diff --git a/build/pkgs/sage_conf/install-requires.txt b/build/pkgs/sage_conf/install-requires.txt index 819432d90ff..460c9d389f2 100644 --- a/build/pkgs/sage_conf/install-requires.txt +++ b/build/pkgs/sage_conf/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-conf ~= 10.0b0 +sage-conf ~= 10.0b2 diff --git a/build/pkgs/sage_docbuild/install-requires.txt b/build/pkgs/sage_docbuild/install-requires.txt index 73f499affef..f7a958d2a26 100644 --- a/build/pkgs/sage_docbuild/install-requires.txt +++ b/build/pkgs/sage_docbuild/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-docbuild ~= 10.0b0 +sage-docbuild ~= 10.0b2 diff --git a/build/pkgs/sage_setup/install-requires.txt b/build/pkgs/sage_setup/install-requires.txt index 169a4c5d9cc..4fe90492ae9 100644 --- a/build/pkgs/sage_setup/install-requires.txt +++ b/build/pkgs/sage_setup/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-setup ~= 10.0b0 +sage-setup ~= 10.0b2 diff --git a/build/pkgs/sage_sws2rst/install-requires.txt b/build/pkgs/sage_sws2rst/install-requires.txt index e2b85444aca..2c538e2d974 100644 --- a/build/pkgs/sage_sws2rst/install-requires.txt +++ b/build/pkgs/sage_sws2rst/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sage-sws2rst ~= 10.0b0 +sage-sws2rst ~= 10.0b2 diff --git a/build/pkgs/sagelib/install-requires.txt b/build/pkgs/sagelib/install-requires.txt index 565dfde8395..1992637fb55 100644 --- a/build/pkgs/sagelib/install-requires.txt +++ b/build/pkgs/sagelib/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagelib ~= 10.0b0 +sagelib ~= 10.0b2 diff --git a/build/pkgs/sagelib/spkg-install b/build/pkgs/sagelib/spkg-install index ad8b2ed43fc..ed6bb969f31 100755 --- a/build/pkgs/sagelib/spkg-install +++ b/build/pkgs/sagelib/spkg-install @@ -29,7 +29,7 @@ fi ## Building takes places in the build/ subdirectory. ## ## As a special exception, we feed SAGE_PKGS. -## They are needed by src/sage/misc/package.py. See meta-ticket #28815 for planned changes to this. +## They are needed by src/sage/misc/package.py. See github issue #28815 for planned changes to this. export SAGE_PKGS="$SAGE_ROOT"/build/pkgs export SAGE_ROOT=/doesnotexist diff --git a/build/pkgs/sagemath_categories/install-requires.txt b/build/pkgs/sagemath_categories/install-requires.txt index 15c1dfbcc42..02b1c5bbdb2 100644 --- a/build/pkgs/sagemath_categories/install-requires.txt +++ b/build/pkgs/sagemath_categories/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-categories ~= 10.0b0 +sagemath-categories ~= 10.0b2 diff --git a/build/pkgs/sagemath_environment/install-requires.txt b/build/pkgs/sagemath_environment/install-requires.txt index 73ef51c4e92..6c258939a07 100644 --- a/build/pkgs/sagemath_environment/install-requires.txt +++ b/build/pkgs/sagemath_environment/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-environment ~= 10.0b0 +sagemath-environment ~= 10.0b2 diff --git a/build/pkgs/sagemath_objects/install-requires.txt b/build/pkgs/sagemath_objects/install-requires.txt index a03b35802fe..0ecdca99435 100644 --- a/build/pkgs/sagemath_objects/install-requires.txt +++ b/build/pkgs/sagemath_objects/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-objects ~= 10.0b0 +sagemath-objects ~= 10.0b2 diff --git a/build/pkgs/sagemath_repl/install-requires.txt b/build/pkgs/sagemath_repl/install-requires.txt index 306890d9db9..d0525ea50ea 100644 --- a/build/pkgs/sagemath_repl/install-requires.txt +++ b/build/pkgs/sagemath_repl/install-requires.txt @@ -1,2 +1,2 @@ # This file is updated on every release by the sage-update-version script -sagemath-repl ~= 10.0b0 +sagemath-repl ~= 10.0b2 diff --git a/build/pkgs/setuptools/distros/conda.txt b/build/pkgs/setuptools/distros/conda.txt index 0a486bd850f..2602d0f6344 100644 --- a/build/pkgs/setuptools/distros/conda.txt +++ b/build/pkgs/setuptools/distros/conda.txt @@ -1,4 +1,4 @@ -# Set this bound until https://trac.sagemath.org/ticket/34209 adds support for PEP660 editable builds +# Set this bound until https://github.com/sagemath/sage/issues/34209 adds support for PEP660 editable builds # By setting this version bound, we avoid having to include the following in our installation instructions. # export SETUPTOOLS_ENABLE_FEATURES=legacy-editable "setuptools<64" diff --git a/build/pkgs/snappy/dependencies b/build/pkgs/snappy/dependencies index 8e4fca87caa..db96ccc42e0 100644 --- a/build/pkgs/snappy/dependencies +++ b/build/pkgs/snappy/dependencies @@ -7,4 +7,4 @@ The dependency cypari above is actually cypari2. An installed sagelib is needed when snappy is installed from source (instead of a wheel) because snappy's setup.py tests its presence to adjust dependencies. -https://trac.sagemath.org/ticket/31180 +https://github.com/sagemath/sage/issues/31180 diff --git a/build/pkgs/snappy/requirements.txt b/build/pkgs/snappy/requirements.txt index 33e93e66a1a..0799f0eac11 100644 --- a/build/pkgs/snappy/requirements.txt +++ b/build/pkgs/snappy/requirements.txt @@ -2,9 +2,9 @@ # if installed as a wheel but will actually use Sage's cypari2. # cypari contains a statically linked copy of pari and other libraries # and will remain completely unused (wastes 30M). Snappy is about 165M. -# See https://trac.sagemath.org/ticket/31180 +# See https://github.com/sagemath/sage/issues/31180 snappy -# cypari 2.4.0 has a broken sdist, https://trac.sagemath.org/ticket/31180 +# cypari 2.4.0 has a broken sdist, https://github.com/sagemath/sage/issues/31180 cypari !=2.4.0 # An optional database (110M uncompressed) snappy_15_knots diff --git a/build/pkgs/sympow/SPKG.rst b/build/pkgs/sympow/SPKG.rst index c1f33b6a00c..1a436e3b7ba 100644 --- a/build/pkgs/sympow/SPKG.rst +++ b/build/pkgs/sympow/SPKG.rst @@ -43,7 +43,7 @@ Special Update/Build Instructions that might show up. I (David Kirkby) would personally not trust this code much at all. -- This is a difficult package to maintain. A trac ticket (#9758) has +- This is a difficult package to maintain. A github issue (#9758) has been opened to implement Watkins-Delaunay's algorithm for computing modular @@ -58,7 +58,7 @@ Special Update/Build Instructions This has been fixed in the Gentoo Linux distribution. Some information from Christopher can be seen on - http://trac.sagemath.org/sage_trac/ticket/9703 + https://github.com/sagemath/sage/issues/9703 This package will generate binary versions of all shipped datafiles, so these will work. However, creating totally new datafiles from scratch diff --git a/build/pkgs/wheel/install-requires.txt b/build/pkgs/wheel/install-requires.txt index fb07166d42c..43f74ab0144 100644 --- a/build/pkgs/wheel/install-requires.txt +++ b/build/pkgs/wheel/install-requires.txt @@ -1,2 +1,2 @@ -# https://trac.sagemath.org/ticket/31050 - version constraint for macOS Big Sur support +# https://github.com/sagemath/sage/issues/31050 - version constraint for macOS Big Sur support wheel >=0.36.2 diff --git a/build/sage_bootstrap/flock.py b/build/sage_bootstrap/flock.py index ee723113b5e..483482a6edf 100644 --- a/build/sage_bootstrap/flock.py +++ b/build/sage_bootstrap/flock.py @@ -8,7 +8,7 @@ # This is originally motivated by pip, but has since been generalized. We # should avoid running pip while uninstalling a package because that is prone # to race conditions. This script runs pip under a lock. For details, see -# https://trac.sagemath.org/ticket/21672 +# https://github.com/sagemath/sage/issues/21672 import fcntl import os diff --git a/build/sage_bootstrap/uncompress/action.py b/build/sage_bootstrap/uncompress/action.py index 9655f76860c..8d8af71da5e 100644 --- a/build/sage_bootstrap/uncompress/action.py +++ b/build/sage_bootstrap/uncompress/action.py @@ -74,8 +74,8 @@ def unpack_archive(archive, dirname=None): retry(rename, OSError, tries=len(archive.names)) # Apply typical umask to the top-level directory in case it wasn't - # already; see https://trac.sagemath.org/ticket/24567 - # and later https://trac.sagemath.org/ticket/28596 + # already; see https://github.com/sagemath/sage/issues/24567 + # and later https://github.com/sagemath/sage/issues/28596 os.chmod(dirname, os.stat(dirname).st_mode & ~0o022) finally: os.chdir(prev_cwd) diff --git a/build/sage_bootstrap/uncompress/tar_file.py b/build/sage_bootstrap/uncompress/tar_file.py index 9777d265b4d..fdfa8d240e8 100644 --- a/build/sage_bootstrap/uncompress/tar_file.py +++ b/build/sage_bootstrap/uncompress/tar_file.py @@ -41,8 +41,8 @@ class SageBaseTarFile(tarfile.TarFile): time (the current time), not the timestamps stored in the tarball. This is meant to work around https://bugs.python.org/issue32773 - See http://trac.sagemath.org/ticket/20218#comment:16 and - https://trac.sagemath.org/ticket/24567 for more background. + See https://github.com/sagemath/sage/issues/20218#comment:16 and + https://github.com/sagemath/sage/issues/24567 for more background. """ umask = 0o022 diff --git a/build/sage_bootstrap/uninstall.py b/build/sage_bootstrap/uninstall.py index 1ce039921fc..7cd808d0fe7 100644 --- a/build/sage_bootstrap/uninstall.py +++ b/build/sage_bootstrap/uninstall.py @@ -186,7 +186,7 @@ def rmdir(dirname): # from it, remove the directory too. for filename in files: # Just in case: use lstrip to remove leading "/" from - # filename. See https://trac.sagemath.org/ticket/26013. + # filename. See https://github.com/sagemath/sage/issues/26013. filename = pth.join(sage_local, filename.lstrip(os.sep)) dirname = pth.dirname(filename) if pth.lexists(filename): diff --git a/docker/Dockerfile b/docker/Dockerfile index bf14547cd38..9d56b10b9c5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -196,7 +196,7 @@ ENV MAKEFLAGS $MAKEFLAGS ARG SAGE_NUM_THREADS="2" ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS RUN make configure -# Old default before https://trac.sagemath.org/ticket/32406 +# Old default before https://github.com/sagemath/sage/issues/32406 RUN ./configure --disable-editable RUN make build diff --git a/docker/README.md b/docker/README.md index eb0f1ba344d..14c49b5d4fe 100644 --- a/docker/README.md +++ b/docker/README.md @@ -26,7 +26,7 @@ There are several flavours of this image. ``` docker run -p8888:8888 sagemath/sagemath:latest sage-jupyter ``` -* [`sagemath/sagemath-dev`![image size](https://img.shields.io/microbadger/image-size/sagemath/sagemath-dev.svg)](https://hub.docker.com/r/sagemath/sagemath-dev) contains all the build artifacts to rebuild Sage quickly (currently, this is broken, see [#34241](https://trac.sagemath.org/ticket/34241).) This version is probably only relevant for Sage developers. Run this image with: +* [`sagemath/sagemath-dev`![image size](https://img.shields.io/microbadger/image-size/sagemath/sagemath-dev.svg)](https://hub.docker.com/r/sagemath/sagemath-dev) contains all the build artifacts to rebuild Sage quickly (currently, this is broken, see [#34241](https://github.com/sagemath/sage/issues/34241).) This version is probably only relevant for Sage developers. Run this image with: ``` docker run -it sagemath/sagemath-dev:develop ``` diff --git a/m4/sage_spkg_collect.m4 b/m4/sage_spkg_collect.m4 index 75903603c49..d52dc6205ee 100644 --- a/m4/sage_spkg_collect.m4 +++ b/m4/sage_spkg_collect.m4 @@ -81,7 +81,7 @@ AC_DEFUN([SAGE_SPKG_COLLECT_INIT], [ dnl Intialize the collection variables. # To deal with ABI incompatibilities when gcc is upgraded, every package # (except gcc) should depend on gcc if gcc is already installed. -# See https://trac.sagemath.org/ticket/24703 +# See https://github.com/sagemath/sage/issues/24703 if test x$SAGE_INSTALL_GCC = xexists; then SAGE_GCC_DEP='$(SAGE_LOCAL)/bin/gcc' else diff --git a/pkgs/sage-conf/README.rst b/pkgs/sage-conf/README.rst index ec4ba0dd631..c968612aef2 100644 --- a/pkgs/sage-conf/README.rst +++ b/pkgs/sage-conf/README.rst @@ -22,7 +22,7 @@ sage_conf sdist on PyPI ----------------------- This implementation of the ``sage_conf`` distribution package comes from -https://trac.sagemath.org/ticket/29039, which added the directory +https://github.com/sagemath/sage/issues/29039, which added the directory `pkgs/sage-conf_pypi `_. To install, use ``pip install -v sage_conf``. Using ``-v`` ensures that diagnostic @@ -48,7 +48,7 @@ sage_conf wheels Prebuilt binary wheels of the ``sage_conf`` distribution package are available at https://github.com/sagemath/sage-wheels/releases/ -This implementation of ``sage_conf`` comes from https://trac.sagemath.org/ticket/31396, +This implementation of ``sage_conf`` comes from https://github.com/sagemath/sage/issues/31396, which adds the directory ``pkgs/sage-conf_relocatable/``. On building a wheel, it invokes ``sage_bootstrap`` to establish a diff --git a/pkgs/sage-conf/VERSION.txt b/pkgs/sage-conf/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sage-conf/VERSION.txt +++ b/pkgs/sage-conf/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sage-conf_pypi/VERSION.txt +++ b/pkgs/sage-conf_pypi/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sage-docbuild/VERSION.txt b/pkgs/sage-docbuild/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sage-docbuild/VERSION.txt +++ b/pkgs/sage-docbuild/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sage-setup/VERSION.txt b/pkgs/sage-setup/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sage-setup/VERSION.txt +++ b/pkgs/sage-setup/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sage-sws2rst/README.rst b/pkgs/sage-sws2rst/README.rst index 8098507fff4..f20d3e636cf 100644 --- a/pkgs/sage-sws2rst/README.rst +++ b/pkgs/sage-sws2rst/README.rst @@ -8,4 +8,4 @@ Provides a script `sage-sws2rst`, which translates a Sage worksheet file (.sws) Sage worksheet files (.sws) are a file format that was used by the now-obsolete Sage notebook (https://github.com/sagemath/sagenb), superseded by the Jupyter notebook. SageNB was dropped in the course of the transition of SageMath to Python 3. -This package was extracted from the SageNB sources in https://trac.sagemath.org/ticket/28838 to provide a way to convert pedagogical material written available in Sage worksheet format. +This package was extracted from the SageNB sources in https://github.com/sagemath/sage/issues/28838 to provide a way to convert pedagogical material written available in Sage worksheet format. diff --git a/pkgs/sage-sws2rst/VERSION.txt b/pkgs/sage-sws2rst/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sage-sws2rst/VERSION.txt +++ b/pkgs/sage-sws2rst/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sagemath-categories/MANIFEST.in.m4 b/pkgs/sagemath-categories/MANIFEST.in.m4 index 98d10a91fef..361132e0cfa 100644 --- a/pkgs/sagemath-categories/MANIFEST.in.m4 +++ b/pkgs/sagemath-categories/MANIFEST.in.m4 @@ -35,7 +35,7 @@ exclude sage/categories/__init__.py include sage/rings/ideal.* include sage/rings/ring.* graft sage/typeset # dep of sage.categories.tensor -# include sage/rings/integer*.* # depends on cypari, flint - https://trac.sagemath.org/ticket/30022 +# include sage/rings/integer*.* # depends on cypari, flint - https://github.com/sagemath/sage/issues/30022 # include sage/rings/rational*.* # include sage/rings/infinity.* diff --git a/pkgs/sagemath-categories/VERSION.txt b/pkgs/sagemath-categories/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sagemath-categories/VERSION.txt +++ b/pkgs/sagemath-categories/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sagemath-environment/VERSION.txt b/pkgs/sagemath-environment/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sagemath-environment/VERSION.txt +++ b/pkgs/sagemath-environment/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sagemath-objects/VERSION.txt b/pkgs/sagemath-objects/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sagemath-objects/VERSION.txt +++ b/pkgs/sagemath-objects/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sagemath-repl/VERSION.txt b/pkgs/sagemath-repl/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/pkgs/sagemath-repl/VERSION.txt +++ b/pkgs/sagemath-repl/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/pkgs/sagemath-standard/README.rst b/pkgs/sagemath-standard/README.rst index 5709c22249b..f624d1414a7 100644 --- a/pkgs/sagemath-standard/README.rst +++ b/pkgs/sagemath-standard/README.rst @@ -28,4 +28,4 @@ for partial lists for various systems. The connection to the system environment is facilitated through the https://pypi.org/project/sage-conf/ distribution package. -A modularization effort is in progress with the goal of making it possible to install parts of the Sage Library with fewer prerequisites. https://trac.sagemath.org/ticket/29705 +A modularization effort is in progress with the goal of making it possible to install parts of the Sage Library with fewer prerequisites. https://github.com/sagemath/sage/issues/29705 diff --git a/src/.relint.yml b/src/.relint.yml index 2b49c758dc0..86684ad1040 100644 --- a/src/.relint.yml +++ b/src/.relint.yml @@ -35,7 +35,7 @@ # From various typo tickets -# https://trac.sagemath.org/ticket/30585 +# https://github.com/sagemath/sage/issues/30585 - name: 'typo "homogenous" detected' hint: | in mathematics it should be "homogeneous" diff --git a/src/VERSION.txt b/src/VERSION.txt index 39516ebfda0..a29f7140ff6 100644 --- a/src/VERSION.txt +++ b/src/VERSION.txt @@ -1 +1 @@ -10.0.beta0 +10.0.beta2 diff --git a/src/bin/sage b/src/bin/sage index 03aec9cfbfc..97f6b2d540b 100755 --- a/src/bin/sage +++ b/src/bin/sage @@ -77,7 +77,7 @@ resolvelinks() { } # Resolve the links in $0 so that local/bin/sage can be executed from -# a symlink (Trac #30888). +# a symlink (Issue #30888). SELF=$(resolvelinks "${0}") # Display the current version of Sage @@ -173,7 +173,7 @@ if [ -z "$SAGE_VENV" -a -x "${SELF}-venv-config" ]; then export SAGE_VENV=$("${SELF}-venv-config" SAGE_VENV) fi if [ -f "${SELF}-env-config" ]; then - # As of Trac #22731, sage-env-config is optional. + # As of Issue #22731, sage-env-config is optional. . "${SELF}-env-config" >&2 fi @@ -577,7 +577,7 @@ fi if [ "$1" = '-c' ]; then shift sage_setup - unset TERM # See Trac #12263 + unset TERM # See Issue #12263 exec sage-eval "$@" fi @@ -1028,7 +1028,7 @@ fi if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then shift - # Trac #30002: ensure an English locale so that it is possible to + # Issue #30002: ensure an English locale so that it is possible to # scrape out warnings by pattern matching. export LANG=C export LANGUAGE=C @@ -1039,7 +1039,7 @@ if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then export OMP_NUM_THREADS=1 fi - # Trac #33650: Make sure that user configuration of Jupyter does not + # Issue #33650: Make sure that user configuration of Jupyter does not # shadow our sagemath kernel when jupyter-sphinx is invoked export JUPYTER_CONFIG_DIR=/doesnotexist export JUPYTER_CONFIG_PATH=/doesnotexist @@ -1153,7 +1153,7 @@ if [ $# -ge 1 ]; then exit 1 fi sage_setup - unset TERM # See Trac #12263 + unset TERM # See Issue #12263 # sage-run rejects all command line options as the first argument. exec sage-run "$@" fi diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner index 7fe6784ee26..e2e578eec60 100755 --- a/src/bin/sage-cleaner +++ b/src/bin/sage-cleaner @@ -169,7 +169,7 @@ def fix_old_mistakes(): """ Experience is simply the name we give our mistakes. """ - # inconsistently escaped hyphens with underscores (http://trac.sagemath.org/14055) + # inconsistently escaped hyphens with underscores (https://github.com/sagemath/sage/issues/14055) wrong_hostname = HOSTNAME.replace('-','_').replace('/','_').replace('\\','_') wrong_sage_tmp_root = os.path.join(DOT_SAGE, 'temp', wrong_hostname) if wrong_sage_tmp_root != SAGE_TMP_ROOT and os.path.exists(wrong_sage_tmp_root): diff --git a/src/bin/sage-coverage b/src/bin/sage-coverage index 45c4073a18c..f4920600528 100755 --- a/src/bin/sage-coverage +++ b/src/bin/sage-coverage @@ -37,7 +37,7 @@ def coverage_all(directory): print(''.join(s)) - # Trac #5859: Don't crash if there isn't anything to test. + # Issue #5859: Don't crash if there isn't anything to test. score = 100.0 if total != 0: score = (float(scr) / total) diff --git a/src/bin/sage-cython b/src/bin/sage-cython index 157cf76a23f..a52a729dd02 100755 --- a/src/bin/sage-cython +++ b/src/bin/sage-cython @@ -1,7 +1,7 @@ #!/usr/bin/env sage-python # This script is a deprecated wrapper around the "cython" program. -# It is deprecated since Trac #27041 (Sage 8.7) because one should +# It is deprecated since Issue #27041 (Sage 8.7) because one should # simply use "cython" directly. We display deprecation messages whenever # "sage-cython" does something different from plain "cython". # diff --git a/src/bin/sage-env b/src/bin/sage-env index 3a02640bc97..28f86bc52ef 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -31,7 +31,7 @@ # absolute path (a relative path remains relative), nor does it treat # "." or ".." specially. # -# AUTHOR: Jeroen Demeyer (2011-08-23): Trac tickets #5852 and #11704 +# AUTHOR: Jeroen Demeyer (2011-08-23): Github issues #5852 and #11704 # resolvelinks() { # $in is what still needs to be converted (normally has no starting slash) @@ -278,7 +278,7 @@ if [ "$UNAME" = "Darwin" ]; then export MACOSX_VERSION=`uname -r | awk -F. '{print $1}'` # Work around problems on recent OS X crashing with an error message # "... may have been in progress in another thread when fork() was called" - # when objective-C functions are called after fork(). See Trac #25921. + # when objective-C functions are called after fork(). See Issue #25921. # Most likely, these errors are false positives, so we disable them: export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES fi @@ -355,12 +355,12 @@ if [ "$PYTHON_EGG_CACHE" = "" ]; then fi # Set PYTHONUSERBASE to avoid picking up non-Sage versions of -# Matplotlib, numpy, etc. See http://trac.sagemath.org/ticket/19612. +# Matplotlib, numpy, etc. See https://github.com/sagemath/sage/issues/19612. # # For more history (it used to be PYTHONNOUSERSITE=yes which killed # the ability to do "sage -pip install PACKAGE --user"), see -# http://trac.sagemath.org/ticket/14243 and -# http://trac.sagemath.org/ticket/18955. +# https://github.com/sagemath/sage/issues/14243 and +# https://github.com/sagemath/sage/issues/18955. if [ "$PYTHONUSERBASE" = "" ]; then PYTHONUSERBASE="$DOT_SAGE/local" @@ -449,7 +449,7 @@ if [ -n "$SAGE_LOCAL" ]; then PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB fi -# Allow SAGE_BROWSER to override BROWSER (Trac #22449) +# Allow SAGE_BROWSER to override BROWSER (Issue #22449) if [ -n "$SAGE_BROWSER" ]; then export BROWSER="$SAGE_BROWSER" fi @@ -558,7 +558,7 @@ case "$SAGE_NUM_THREADS,$SAGE_NUM_THREADS_PARALLEL" in # sage-num-threads.py would just recompute them ;; *) - # See Trac Ticket #12016 + # See Issue Ticket #12016 # First, figure out the right values for SAGE_NUM_THREADS (default # number of threads) and SAGE_NUM_THREADS_PARALLEL (default number of # threads when parallel execution is asked explicitly). @@ -615,7 +615,7 @@ fi if [ -n "$SAGE_LOCAL" ]; then # If we move the Sage tree then ncurses cannot find terminfo, hence, we - # tell it where to find it. See Trac Ticket #15091 + # tell it where to find it. See Issue Ticket #15091 export TERMINFO="$SAGE_LOCAL/share/terminfo" # If nodejs is installed, activate the nodeenv containing it. diff --git a/src/bin/sage-num-threads.py b/src/bin/sage-num-threads.py index 1b920182690..7c70a3cbe3a 100755 --- a/src/bin/sage-num-threads.py +++ b/src/bin/sage-num-threads.py @@ -11,7 +11,7 @@ # 3) The number of CPU cores in the system, as determined by # multiprocessing.cpu_count() # -# AUTHOR: Jeroen Demeyer (2011-12-08): Trac ticket #12016 +# AUTHOR: Jeroen Demeyer (2011-12-08): Github issue #12016 # import os import multiprocessing diff --git a/src/bin/sage-runtests b/src/bin/sage-runtests index 81dff8d5bf3..ed1e56953ff 100755 --- a/src/bin/sage-runtests +++ b/src/bin/sage-runtests @@ -8,7 +8,7 @@ import sys DOT_SAGE = os.environ.get('DOT_SAGE', os.path.join(os.environ.get('HOME'), '.sage')) -# Override to not pick up user configuration, see Trac #20270 +# Override to not pick up user configuration, see Issue #20270 os.environ['SAGE_STARTUP_FILE'] = os.path.join(DOT_SAGE, 'init-doctests.sage') @@ -41,8 +41,8 @@ if __name__ == "__main__": type=float, default=-1.0, const=1.0, metavar="SECONDS", help="warn if tests take more time than SECONDS") # By default, include all tests marked 'sagemath_doc_html' -- see - # https://trac.sagemath.org/ticket/25345 and - # https://trac.sagemath.org/ticket/26110: + # https://github.com/sagemath/sage/issues/25345 and + # https://github.com/sagemath/sage/issues/26110: parser.add_argument("--optional", metavar="FEATURES", default=_get_optional_defaults(), help='only run tests including one of the "# optional" tags listed in FEATURES (separated by commas); ' 'if "sage" is listed, will also run the standard doctests; ' @@ -141,7 +141,7 @@ if __name__ == "__main__": sys.exit(2) # Limit the number of threads to 2 to save system resources. - # See Trac #23713, #23892, #30351 + # See Issue #23713, #23892, #30351 if sys.platform == 'darwin': os.environ["OMP_NUM_THREADS"] = "1" else: @@ -153,7 +153,7 @@ if __name__ == "__main__": DC = DocTestController(args, args.filenames) err = DC.run() - # Trac #33521: Do not run pytest if the pytest configuration is not available. + # Issue #33521: Do not run pytest if the pytest configuration is not available. # This happens when the source tree is not available and SAGE_SRC falls back # to SAGE_LIB. from sage.env import SAGE_SRC diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index 127b827342d..4d2a5124035 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -4,6 +4,6 @@ # which stops "setup.py develop" from rewriting it as a Python file. : # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='10.0.beta0' -SAGE_RELEASE_DATE='2023-02-12' -SAGE_VERSION_BANNER='SageMath version 10.0.beta0, Release Date: 2023-02-12' +SAGE_VERSION='10.0.beta2' +SAGE_RELEASE_DATE='2023-02-23' +SAGE_VERSION_BANNER='SageMath version 10.0.beta2, Release Date: 2023-02-23' diff --git a/src/conftest.py b/src/conftest.py index f12f0aa0cbc..9448087cc7a 100644 --- a/src/conftest.py +++ b/src/conftest.py @@ -25,7 +25,7 @@ from _pytest.pathlib import import_path, ImportMode # Import sage.all is necessary to: -# - avoid cyclic import errors, see Trac #33580 +# - avoid cyclic import errors, see Issue #33580 # - inject it into globals namespace for doctests import sage.all from sage.doctest.parsing import SageDocTestParser, SageOutputChecker diff --git a/src/doc/bootstrap b/src/doc/bootstrap index 6b44bc828d8..6dd50fd5cec 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -155,8 +155,8 @@ for PKG_BASE in $(sage-package list --has-file SPKG.rst | sort); do PKG_SCRIPTS=build/pkgs/$PKG_BASE # Instead of just copying, we may want to call # a version of sage-spkg-info to format extra information. - # for sphinx 4.4 we need to replace all direct links by some "extlink" (ticket 33272) + # for sphinx 4.4 we need to replace all direct links by some "extlink" (issue 33272) - (echo ".. _spkg_$PKG_BASE:" && echo && OUTPUT_RST=1 sage-spkg-info $PKG_BASE) | sed -e "s|https://trac.sagemath.org/ticket/\([0-9]*\)|:trac:\`\1\`|g" -e "s|https://arxiv.org/abs/cs/\([0-9]*\)|:arxiv:\`cs/\1\`|g" > "$OUTPUT_DIR"/$PKG_BASE.rst + (echo ".. _spkg_$PKG_BASE:" && echo && OUTPUT_RST=1 sage-spkg-info $PKG_BASE) | sed -e "s|https://github.com/sagemath/sage/issues/\([0-9]*\)|:issue:\`\1\`|g" -e "s|https://arxiv.org/abs/cs/\([0-9]*\)|:arxiv:\`cs/\1\`|g" > "$OUTPUT_DIR"/$PKG_BASE.rst echo >> "$OUTPUT_INDEX" " $PKG_BASE" done diff --git a/src/doc/en/constructions/contributions.rst b/src/doc/en/constructions/contributions.rst index 66bff2b74f5..c6324e3459e 100644 --- a/src/doc/en/constructions/contributions.rst +++ b/src/doc/en/constructions/contributions.rst @@ -36,4 +36,4 @@ documentation were made by Gary Zablackis. [SAGE] {SJ} William Stein, David Joyner, SAGE: System for Algebra and Geometry Experimentation, Comm. Computer Algebra 39(2005)61-64. (SIGSAM Bull. June 2005) https://sagemath.org/ - https://trac.sagemath.org/ + https://github.com/sagemath/sage/issues/ diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 54facbfd1ce..f1a3e5c49fa 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1164,23 +1164,7 @@ provides sample ``devcontainer.json`` configuration files `_ for this purpose. -To get started, symlink (or copy) one of the sample files to -``$SAGE_ROOT/.devcontainer/devcontainer.json``. For example, choose -`$SAGE_ROOT/.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json -`_, which uses the Docker image based on ``ubuntu-jammy-standard``, -the most recent -development version of Sage (``dev`` tag), and a full installation of -the Sage distribution (``with-targets``). - -In macOS for example, you can do this using the shell as follows:: - - [mkoeppe@sage sage] $ (cd .devcontainer && ln -s portability-ubuntu-jammy-standard/devcontainer.json .) - -Now start VS Code:: - - [mkoeppe@sage sage] $ code . - -Then VS Code may prompt you whether you would like to open the current +If you open the sage folder in VS Code, it may prompt you whether you would like to open the current directory in the dev container (yes). If it does not, use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the command "Remote-Containers: Reopen Folder in Container" , and hit :kbd:`Enter`. @@ -1190,6 +1174,14 @@ application, then in the command palette of VS Code, enter "Remote-Containers: Open Folder in Container", and hit :kbd:`Enter`, and choose the directory ``$SAGE_ROOT`` of your local Sage repository. +VS Code then prompts you to choose a dev container configuration. +For example, choose "Ubuntu jammy" `.devcontainer/portability-ubuntu-jammy-standard/devcontainer.json +`_, +which uses the Docker image based on ``ubuntu-jammy-standard``, the most recent +development version of Sage (``dev`` tag), and a full installation of +the Sage distribution (``with-targets``). Other dev container configurations +are described below. + Once VS Code starts configuring the dev container, by clicking on "show log", you can see what it does: @@ -1225,8 +1217,7 @@ in a terminal, `open a new terminal in VS Code ``configure`` script. You can edit a copy of the configuration file to change to a different platform, another -version, or build stage. After editing the configuration file (or changing the -symlink), run "Remote-Containers: Rebuild Container" from the command +version, or build stage. After editing the configuration file, run "Remote-Containers: Rebuild Container" from the command palette. See the `VS Code devcontainer.json reference `_ and the `GitHub introduction to dev containers @@ -1248,8 +1239,7 @@ installation of SageMath in this container by building from the current source t project `_, providing SnapPy, Regina, PHCPack, etc. -If you want to use one of these ``devcontainer.json`` files, symlink (or copy) -it and start VS Code as explained above. After VS Code finished configuring the +After VS Code finished configuring the dev container, to use Sage in a terminal, `open a new terminal in VS Code `_, type ``./sage`` and hit :kbd:`Enter`. @@ -1284,8 +1274,7 @@ work without change) or to adapt them to your needs. project `_, providing SnapPy, Regina, PHCPack, etc. -If you want to use one of these ``devcontainer.json`` files, symlink (or copy) -it and start VS Code as explained above. After VS Code finished configuring the +After VS Code finished configuring the dev container, to use Sage in a terminal, `open a new terminal in VS Code `_, type ``sage`` and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source diff --git a/src/doc/en/prep/Advanced-2DPlotting.rst b/src/doc/en/prep/Advanced-2DPlotting.rst index 633e33d68b3..4ac7465ccf7 100644 --- a/src/doc/en/prep/Advanced-2DPlotting.rst +++ b/src/doc/en/prep/Advanced-2DPlotting.rst @@ -239,7 +239,7 @@ to put together. ....: graph += arrow( [0,0], [360, 0], color = "#000" ) ....: # let's set tics ....: # or http://aghitza.org/posts/tweak_labels_and_ticks_in_2d_plots_using_matplotlib/ - ....: # or wayt for http://trac.sagemath.org/sage_trac/ticket/1431 + ....: # or wayt for https://github.com/sagemath/sage/issues/1431 ....: # ['$-\pi/3$', '$2\pi/3$', '$5\pi/3$'] ....: for x in range(0, 361, 30): ....: graph += point( [x, 0] ) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 5a7eb0a163c..9f0c6c2b964 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -624,7 +624,7 @@ REFERENCES: and variants*. :arxiv:`1810.00789` -.. [BDKR2013] \D. Best, D.Z. Dokovic, H. Kharaghani and H. Ramp. +.. [BDKR2013] \D. Best, D.Ž. Đoković, H. Kharaghani and H. Ramp. *Turyn-Type Sequences: Classification, Enumeration, and Construction*, Journal of Combinatorial Designs 21(1) (2013): 24-35. :doi:`10.1002/jcd.21318` @@ -1216,6 +1216,11 @@ REFERENCES: Proc. London Math. Soc. (3) **77** (1998), 551–581. :mathscinet:`MR1643413` +.. [BS1969] \D. Blatt, G. Szekeres. + *A Skew Hadamard Matrix of Order 52*, + Canadian Journal of Mathematics 21 (1969): 1319-1322. + :doi:`10.4153/CJM-1969-144-2` + .. [BS1996] Eric Bach, Jeffrey Shallit. *Algorithmic Number Theory, Vol. 1: Efficient Algorithms*. MIT Press, 1996. ISBN 978-0262024051. @@ -1794,6 +1799,11 @@ REFERENCES: *Tracking p-adic precision*, LMS J. Comput. Math. **17** (2014), 274-294. +.. [Connell1999] Ian Connell. + *Elliptic Curve Handbook*. + Online lecture notes, available at + https://git.hackade.org/ben/tinycrypt/raw/branch/master/docs/Elliptic%20Curve%20Handbook.pdf + .. [CS1986] \J. Conway and N. Sloane. *Lexicographic codes: error-correcting codes from game theory*, IEEE Trans. Infor. Theory **32** (1986) 337-348. @@ -2041,15 +2051,40 @@ REFERENCES: and some constructions of de Luca and Rauzy*, Theoret. Comput. Sci. 255 (2001) 539--553. -.. [Djo1992] \D. Đoković. +.. [Djo1992a] \D. Đoković. *Construction of some new Hadamard matrices*, Bulletin of the Australian Mathematical Society 45(2) (1992): 327-332. :doi:`10.1017/S0004972700030185` +.. [Djo1992b] \D. Đoković. + *Skew Hadamard matrices of order 4 x 37 and 4 x 43*, + Journal of Combinatorial Theory, Series A 61(2) (1992): 319-321. + :doi:`10.1016/0097-3165(92)90029-T` + +.. [Djo1992c] \D. Đoković. + *Ten New Orders for Hadamard Matrices of Skew Type*, + Publikacije Elektrotehničkog fakulteta. Serija Matematika 2 (1992): 47-59. + .. [Djo1994] \D. Đoković. *Five New Orders for Hadamard Matrices of Skew Type*, Australasian Journal of Combinatorics 10 (1994): 259-264. +.. [Djo2008a] \D. Đoković. + *Skew-Hadamard matrices of orders 188 and 388 exist*, + International Mathematical Forum 3 no.22 (2008): 1063-1068. + :arxiv:`0704.0640` + +.. [Djo2008b] \D. Đoković. + *Skew-Hadamard matrices of orders 436, 580 and 988 exist*, + Journal of Combinatorial Designs 16 (2008): 493-498. + :arxiv:`0706.1973` + +.. [Djo2023a] \D. Đoković. + *Skew-Hadamard matrices of order 276*. + :arxiv:`10.48550/ARXIV.2301.02751` + +.. [Djo2023b] \D. Đoković, Email Communication. 26 January 2023. + .. [DK2013] John R. Doyle and David Krumm, *Computing algebraic numbers of bounded height*, :arxiv:`1111.4963v4` (2013). @@ -2183,6 +2218,11 @@ REFERENCES: .. [Duv1983] J.-P. Duval, Factorizing words over an ordered alphabet, J. Algorithms 4 (1983) 363--381. +.. [Duv1988] \A. Duval. + *A directed graph version of strongly regular graphs*, + Journal of Combinatorial Theory, Series A 47(1) (1988): 71-100. + :doi:`10.1016/0097-3165(88)90043-X` + .. [DW1995] Andreas W.M. Dress and Walter Wenzel, *A Simple Proof of an Identity Concerning Pfaffians of Skew Symmetric Matrices*, Advances in Mathematics, volume 112, Issue 1, @@ -2392,6 +2432,11 @@ REFERENCES: code, by I.A.Faradjev (with contributions by A.E.Brouwer, D.V.Pasechnik). https://github.com/dimpase/coco +.. [FKS2004] \R. J. Fletcher, C. Koukouvinos and J. Seberry. + *New skew-Hadamard matrices of order 4·59 and new D-optimal designs of order 2·59*, + Discrete Mathematics 286(3) (2004): 251-253. + :doi:`10.1016/j.disc.2004.05.009` + .. [FL2001] David Forge and Michel Las Vergnas. *Orlik-Solomon type algebras*. European J. Combin. **22** (5), (2001). pp. 699-704. @@ -3821,6 +3866,10 @@ REFERENCES: *Bethe ansatz and inverse scattering transform in a periodic box-ball system*, Nuclear Phys. B **747**, no. 3 (2006), 354--397. +.. [KTZ1987] Kierstead, H.A., Trotter, W.T. & Zhou, B. Representing an ordered + set as the intersection of super greedy linear extensions. Order 4, + 293-311 (1987). + :doi:`10.1007/BF00337892` .. [Kuh1987] \W. Kühnel, "Minimal triangulations of Kummer varieties", Abh. Math. Sem. Univ. Hamburg 57 (1987), 7-20. @@ -5484,6 +5533,11 @@ REFERENCES: :doi:`10.1007/978-1-4684-9322-1`, ISBN 978-1-4684-9322-1. +.. [Spe1977] \E. Spence. + *Skew-Hadamard matrices of order 2(q + 1)*, + Discrete Mathematics 18(1) (1977): 79-85. + :doi:`10.1016/0012-365X(77)90009-7` + .. [Spe2013] \D. Speyer, *An infinitely generated upper cluster algebra*, :arxiv:`1305.6867`. @@ -5833,6 +5887,10 @@ REFERENCES: Hall-Littlewood vertex operators and generalized Kostka polynomials. Adv. Math. 158 (2001), no. 1, 66-85. +.. [Sze1988] \G. Szekeres. + *A note on skew type orthogonal ±1 matrices*, + Combinatorics, Colloquia Mathematica Societatis, Janos Bolyai, 52 (1988): 489-498. + .. _ref-T: **T** @@ -6113,6 +6171,11 @@ REFERENCES: pages 150--168, 1932, `available on JSTOR `_ +.. [Whi1971] \A. Whiteman. + *An infinite family of skew Hadamard matrices*, + Pacific Journal of Mathematics 38(3) (1971): 817-822. + :doi:`10.2140/pjm.1971.38.817` + .. [White2015] Noah White. *The monodromy of real Bethe vectors for the Gaudin model*. J. Combin. Algebra, **2** no. 3 (2018). pp. 259-300. diff --git a/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/nf_galois_groups.rst b/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/nf_galois_groups.rst index 4832272f1cb..fb7697587c5 100644 --- a/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/nf_galois_groups.rst +++ b/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/nf_galois_groups.rst @@ -41,7 +41,7 @@ Some more advanced number-theoretical tools are available via G: sage: P = K.primes_above(2)[0] sage: G.inertia_group(P) Subgroup generated by [(1,4,6)(2,5,3)] of (Galois group 6T2 ([3]2) with order 6 of x^6 + 40*x^3 + 1372) - sage: sorted([G.artin_symbol(Q) for Q in K.primes_above(5)]) # random order, see Trac #18308 + sage: sorted([G.artin_symbol(Q) for Q in K.primes_above(5)]) # random order, see Issue #18308 [(1,3)(2,6)(4,5), (1,2)(3,4)(5,6), (1,5)(2,4)(3,6)] If the number field is not Galois over `\QQ`, then the ``galois_group`` diff --git a/src/sage/algebras/free_algebra_element.py b/src/sage/algebras/free_algebra_element.py index 378f06479db..559df673fbf 100644 --- a/src/sage/algebras/free_algebra_element.py +++ b/src/sage/algebras/free_algebra_element.py @@ -92,7 +92,7 @@ def _repr_(self): sage: repr(-x+3*y*z) # indirect doctest '-x + 3*y*z' - Trac ticket :trac:`11068` enables the use of local variable names:: + Github issue :trac:`11068` enables the use of local variable names:: sage: from sage.structure.parent_gens import localvars sage: with localvars(A, ['a','b','c']): diff --git a/src/sage/algebras/fusion_rings/fusion_ring.py b/src/sage/algebras/fusion_rings/fusion_ring.py index d36faae2b34..915ca62e73b 100644 --- a/src/sage/algebras/fusion_rings/fusion_ring.py +++ b/src/sage/algebras/fusion_rings/fusion_ring.py @@ -1349,7 +1349,7 @@ def get_braid_generators(self, set_start_method('fork') except RuntimeError: pass - # Turn off multiprocessing when field is QQbar due to pickling issues introduced by PARI upgrade in trac ticket #30537 + # Turn off multiprocessing when field is QQbar due to pickling issues introduced by PARI upgrade in github issue #30537 pool = Pool() if use_mp and self.fvars_field() != QQbar else None # Set up computational basis and compute generators one at a time diff --git a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx index 41444812c49..80ac48b202c 100644 --- a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx +++ b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx @@ -3,7 +3,7 @@ Weighted homogeneous elements of free algebras, in letterplace implementation AUTHOR: -- Simon King (2011-03-23): Trac ticket :trac:`7797` +- Simon King (2011-03-23): Github issue :trac:`7797` """ diff --git a/src/sage/algebras/lie_algebras/free_lie_algebra.py b/src/sage/algebras/lie_algebras/free_lie_algebra.py index 79df5a5d90b..207f8d63a8c 100644 --- a/src/sage/algebras/lie_algebras/free_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/free_lie_algebra.py @@ -59,7 +59,7 @@ def __init__(self, lie, basis_name): doctest:warning ... FutureWarning: The Hall basis has not been fully proven correct, but currently no bugs are known - See http://trac.sagemath.org/16823 for details. + See https://github.com/sagemath/sage/issues/16823 for details. Free Lie algebra generated by (x, y) over Rational Field in the Hall basis """ self._basis_name = basis_name diff --git a/src/sage/algebras/lie_algebras/lie_algebra.py b/src/sage/algebras/lie_algebras/lie_algebra.py index 0aa08d2a823..87b1a8cee37 100644 --- a/src/sage/algebras/lie_algebras/lie_algebra.py +++ b/src/sage/algebras/lie_algebras/lie_algebra.py @@ -273,7 +273,7 @@ class LieAlgebra(Parent, UniqueRepresentation): # IndexedGenerators): sage: H = L.Hall() doctest:warning...: FutureWarning: The Hall basis has not been fully proven correct, but currently no bugs are known - See http://trac.sagemath.org/16823 for details. + See https://github.com/sagemath/sage/issues/16823 for details. sage: H Free Lie algebra generated by (x, y, z) over Rational Field in the Hall basis sage: Lyn = L.Lyndon() diff --git a/src/sage/algebras/lie_algebras/lie_algebra_element.pyx b/src/sage/algebras/lie_algebras/lie_algebra_element.pyx index ffe27c69797..d0a1f70510a 100644 --- a/src/sage/algebras/lie_algebras/lie_algebra_element.pyx +++ b/src/sage/algebras/lie_algebras/lie_algebra_element.pyx @@ -95,7 +95,7 @@ cdef class LieAlgebraElement(IndexedFreeModuleElement): sage: H = L.Hall() doctest:warning...: FutureWarning: The Hall basis has not been fully proven correct, but currently no bugs are known - See http://trac.sagemath.org/16823 for details. + See https://github.com/sagemath/sage/issues/16823 for details. sage: elt = Lyn.an_element() sage: elt._im_gens_(H, H.gens()) x + y + z diff --git a/src/sage/algebras/lie_algebras/morphism.py b/src/sage/algebras/lie_algebras/morphism.py index ca65bb162aa..f71001ce98f 100644 --- a/src/sage/algebras/lie_algebras/morphism.py +++ b/src/sage/algebras/lie_algebras/morphism.py @@ -54,7 +54,7 @@ class LieAlgebraHomomorphism_im_gens(Morphism): sage: H = L.Hall() doctest:warning...: FutureWarning: The Hall basis has not been fully proven correct, but currently no bugs are known - See http://trac.sagemath.org/16823 for details. + See https://github.com/sagemath/sage/issues/16823 for details. sage: phi = Lyn.coerce_map_from(H); phi Lie algebra morphism: From: Free Lie algebra generated by (x, y, z) over Rational Field in the Hall basis diff --git a/src/sage/algebras/quatalg/quaternion_algebra.py b/src/sage/algebras/quatalg/quaternion_algebra.py index 185fd3f4baf..a6d080d8cd7 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra.py +++ b/src/sage/algebras/quatalg/quaternion_algebra.py @@ -2202,7 +2202,7 @@ def quaternion_order(self): sage: R = QuaternionAlgebra(-11,-1).maximal_order() sage: R.unit_ideal().quaternion_order() is R doctest:...: DeprecationWarning: quaternion_order() is deprecated, please use left_order() or right_order() - See https://trac.sagemath.org/31583 for details. + See https://github.com/sagemath/sage/issues/31583 for details. True """ from sage.misc.superseded import deprecation @@ -2234,7 +2234,7 @@ def ring(self): sage: R = QuaternionAlgebra(-11,-1).maximal_order() sage: R.unit_ideal().ring() is R doctest:...: DeprecationWarning: ring() will return the quaternion algebra in the future, please use left_order() or right_order() - See https://trac.sagemath.org/31583 for details. + See https://github.com/sagemath/sage/issues/31583 for details. True """ from sage.misc.superseded import deprecation diff --git a/src/sage/arith/constants.pxd b/src/sage/arith/constants.pxd index ec6f59074ce..6e5e713707f 100644 --- a/src/sage/arith/constants.pxd +++ b/src/sage/arith/constants.pxd @@ -3,7 +3,7 @@ # float. We use these instead of decimal constants like 3.1415... # because the hex floats are exactly representable as "double", so there # shouldn't be any rounding issues in the compiler. -# See https://trac.sagemath.org/ticket/23919#comment:15 +# See https://github.com/sagemath/sage/issues/23919#comment:15 # # Hex floats are standardized in C99, but GCC accepts them # unconditionally, also for C++ code. diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd index 1c9a53387a0..eda9d8c1f48 100644 --- a/src/sage/arith/long.pxd +++ b/src/sage/arith/long.pxd @@ -1,3 +1,4 @@ +# sage.doctest: optional - sage.misc.cython r""" Fast conversion of Python objects to C long """ @@ -113,7 +114,7 @@ cdef inline bint integer_check_long(x, long* value, int* err) except -1: We create a pure Python wrapper of this function:: - sage: cython(''' # optional - sage.misc.cython + sage: cython(''' ....: from sage.arith.long cimport * ....: from sage.rings.integer cimport smallInteger ....: def check_long(x): @@ -246,7 +247,7 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): We create a pure Python wrapper of this function:: - sage: cython(''' # optional - sage.misc.cython + sage: cython(''' ....: from sage.arith.long cimport * ....: def check_long_py(x): ....: cdef long value @@ -270,6 +271,17 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): sage: L += [-x for x in L] + [0, long_min()] sage: for v in L: ....: assert check_long_py(int(v)) == v + sage: check_long_py(int(2^60)) + 1152921504606846976 # 64-bit + 'Overflow (...)' # 32-bit + sage: check_long_py(int(2^61)) + 2305843009213693952 # 64-bit + 'Overflow (...)' # 32-bit + sage: check_long_py(int(2^62)) + 4611686018427387904 # 64-bit + 'Overflow (...)' # 32-bit + sage: check_long_py(int(2^63)) + 'Overflow (...)' sage: check_long_py(int(2^100)) 'Overflow (...)' sage: check_long_py(int(long_max() + 1)) @@ -296,7 +308,7 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): # - BITS_IN_LONG = 63, PyLong_SHIFT = 30 # - BITS_IN_LONG = 31, PyLong_SHIFT = 15 (python <= 3.10) # - BITS_IN_LONG = 31, PyLong_SHIFT = 30 (new in python 3.11) - # cf. https://trac.sagemath.org/ticket/33842#comment:130 + # cf. https://github.com/sagemath/sage/issues/33842#comment:130 # # This way, we know that 1 digit certainly fits in a C long # and 4 or more digits never fit. @@ -309,7 +321,12 @@ cdef inline bint integer_check_long_py(x, long* value, int* err): cdef long lead cdef long lead_2_overflow = (1) << (BITS_IN_LONG - PyLong_SHIFT) - cdef long lead_3_overflow = (1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) + cdef long lead_3_overflow + if BITS_IN_LONG < 2 * PyLong_SHIFT: + # in this case 3 digit is always overflow + lead_3_overflow = 0 + else: + lead_3_overflow = (1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) if size == 0: value[0] = 0 err[0] = 0 @@ -371,7 +388,7 @@ cdef inline bint is_small_python_int(obj): EXAMPLES:: - sage: cython(''' # optional - sage.misc.cython + sage: cython(''' ....: from sage.arith.long cimport is_small_python_int ....: def is_small_wrapper(x): ....: return is_small_python_int(x) diff --git a/src/sage/calculus/wester.py b/src/sage/calculus/wester.py index 10a64d25471..0a2a374cd5f 100644 --- a/src/sage/calculus/wester.py +++ b/src/sage/calculus/wester.py @@ -390,7 +390,7 @@ sage: # domain. sage: # To stick with the behaviour of previous versions, the domain is set sage: # to 'real' in the following. - sage: # See Trac #10682 for further details. + sage: # See Issue #10682 for further details. sage: n = var('n') sage: f = x^(1/n)*y^(1/n)-(x*y)^(1/n) sage: assume(real(x) > 0, real(y) > 0) diff --git a/src/sage/categories/bialgebras.py b/src/sage/categories/bialgebras.py index e70914295af..441d924c964 100644 --- a/src/sage/categories/bialgebras.py +++ b/src/sage/categories/bialgebras.py @@ -10,7 +10,8 @@ # ***************************************************************************** from sage.categories.category_types import Category_over_base_ring -from sage.categories.all import Algebras, Coalgebras +from sage.categories.algebras import Algebras +from sage.categories.coalgebras import Coalgebras from sage.categories.super_modules import SuperModulesCategory from sage.misc.lazy_import import LazyImport diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py index f70455cf1a0..0db7aa21a65 100644 --- a/src/sage/categories/category.py +++ b/src/sage/categories/category.py @@ -153,7 +153,7 @@ class Category(UniqueRepresentation, SageObject): This is achieved as follows:: - sage: from sage.categories.all import Category + sage: from sage.categories.category import Category sage: class EuclideanDomains(Category): ....: # operations on the category itself ....: def super_categories(self): @@ -201,7 +201,7 @@ class inheritance from ``C.parent_class``. :: - sage: from sage.categories.all import Category + sage: from sage.categories.category import Category sage: from sage.misc.lazy_attribute import lazy_attribute sage: class As (Category): ....: def super_categories(self): diff --git a/src/sage/categories/category_with_axiom.py b/src/sage/categories/category_with_axiom.py index e8811e9f25e..9850f4d4c85 100644 --- a/src/sage/categories/category_with_axiom.py +++ b/src/sage/categories/category_with_axiom.py @@ -927,7 +927,7 @@ def _(): return LazyImport('sage.categories.rngs', 'Rngs', at_startup=True) Supporting similar deduction rules will be an important feature in the future, with quite a few occurrences already implemented in - upcoming tickets. For the time being though there is a single + upcoming issues. For the time being though there is a single occurrence of this idiom outside of the tests. So this would be an easy thing to refactor after :trac:`10963` if a better idiom is found. diff --git a/src/sage/categories/chain_complexes.py b/src/sage/categories/chain_complexes.py index 531fc48e4cd..b1d8c578e60 100644 --- a/src/sage/categories/chain_complexes.py +++ b/src/sage/categories/chain_complexes.py @@ -46,7 +46,9 @@ def super_categories(self): [Category of modules over Ring of integers modulo 9] """ - from sage.categories.all import Fields, Modules, VectorSpaces + from sage.categories.fields import Fields + from sage.categories.modules import Modules + from sage.categories.vector_spaces import VectorSpaces base_ring = self.base_ring() if base_ring in Fields(): return [VectorSpaces(base_ring)] diff --git a/src/sage/categories/coalgebras.py b/src/sage/categories/coalgebras.py index 22a385d5f0d..3a7f8c6213a 100644 --- a/src/sage/categories/coalgebras.py +++ b/src/sage/categories/coalgebras.py @@ -10,7 +10,7 @@ # ***************************************************************************** from .category_types import Category_over_base_ring -from sage.categories.all import Modules +from sage.categories.modules import Modules from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring from sage.categories.tensor import TensorProductsCategory from sage.categories.dual import DualObjectsCategory diff --git a/src/sage/categories/coalgebras_with_basis.py b/src/sage/categories/coalgebras_with_basis.py index b672c37dd27..5518804d649 100644 --- a/src/sage/categories/coalgebras_with_basis.py +++ b/src/sage/categories/coalgebras_with_basis.py @@ -13,7 +13,9 @@ from sage.misc.lazy_attribute import lazy_attribute from sage.misc.lazy_import import LazyImport from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring -from sage.categories.all import ModulesWithBasis, tensor, Hom +from sage.categories.modules_with_basis import ModulesWithBasis +from sage.categories.tensor import tensor +from sage.categories.homset import Hom from sage.categories.super_modules import SuperModulesCategory from sage.categories.filtered_modules import FilteredModulesCategory diff --git a/src/sage/categories/examples/algebras_with_basis.py b/src/sage/categories/examples/algebras_with_basis.py index 7ad85cb82ed..f1d05839e2a 100644 --- a/src/sage/categories/examples/algebras_with_basis.py +++ b/src/sage/categories/examples/algebras_with_basis.py @@ -10,7 +10,7 @@ from sage.misc.cachefunc import cached_method from sage.sets.family import Family -from sage.categories.all import AlgebrasWithBasis +from sage.categories.algebras_with_basis import AlgebrasWithBasis from sage.combinat.free_module import CombinatorialFreeModule from sage.combinat.words.words import Words diff --git a/src/sage/categories/examples/commutative_additive_monoids.py b/src/sage/categories/examples/commutative_additive_monoids.py index 945826c22a5..7422604e8e9 100644 --- a/src/sage/categories/examples/commutative_additive_monoids.py +++ b/src/sage/categories/examples/commutative_additive_monoids.py @@ -10,7 +10,7 @@ from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent -from sage.categories.all import CommutativeAdditiveMonoids +from sage.categories.commutative_additive_monoids import CommutativeAdditiveMonoids from .commutative_additive_semigroups import FreeCommutativeAdditiveSemigroup class FreeCommutativeAdditiveMonoid(FreeCommutativeAdditiveSemigroup): diff --git a/src/sage/categories/examples/commutative_additive_semigroups.py b/src/sage/categories/examples/commutative_additive_semigroups.py index ea2fde99bb4..fdda759869a 100644 --- a/src/sage/categories/examples/commutative_additive_semigroups.py +++ b/src/sage/categories/examples/commutative_additive_semigroups.py @@ -12,7 +12,7 @@ from sage.structure.parent import Parent from sage.structure.element_wrapper import ElementWrapper from sage.structure.unique_representation import UniqueRepresentation -from sage.categories.all import CommutativeAdditiveSemigroups +from sage.categories.commutative_additive_semigroups import CommutativeAdditiveSemigroups from sage.sets.family import Family class FreeCommutativeAdditiveSemigroup(UniqueRepresentation, Parent): diff --git a/src/sage/categories/examples/finite_coxeter_groups.py b/src/sage/categories/examples/finite_coxeter_groups.py index 71ca54c8a5b..c7937688ef8 100644 --- a/src/sage/categories/examples/finite_coxeter_groups.py +++ b/src/sage/categories/examples/finite_coxeter_groups.py @@ -11,7 +11,7 @@ from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent from sage.structure.element_wrapper import ElementWrapper -from sage.categories.all import FiniteCoxeterGroups +from sage.categories.finite_coxeter_groups import FiniteCoxeterGroups from sage.structure.unique_representation import UniqueRepresentation from sage.misc.functional import is_odd, is_even from sage.combinat.root_system.coxeter_matrix import CoxeterMatrix diff --git a/src/sage/categories/examples/finite_dimensional_algebras_with_basis.py b/src/sage/categories/examples/finite_dimensional_algebras_with_basis.py index a3721f106b7..f51b66c49dd 100644 --- a/src/sage/categories/examples/finite_dimensional_algebras_with_basis.py +++ b/src/sage/categories/examples/finite_dimensional_algebras_with_basis.py @@ -9,7 +9,7 @@ #***************************************************************************** from sage.misc.cachefunc import cached_method -from sage.categories.all import FiniteDimensionalAlgebrasWithBasis +from sage.categories.finite_dimensional_algebras_with_basis import FiniteDimensionalAlgebrasWithBasis from sage.combinat.free_module import CombinatorialFreeModule diff --git a/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py b/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py index 306e0091e12..a975d902e14 100644 --- a/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py +++ b/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py @@ -10,7 +10,7 @@ from sage.misc.cachefunc import cached_method from sage.sets.family import Family -from sage.categories.all import LieAlgebras +from sage.categories.lie_algebras import LieAlgebras from sage.modules.free_module import FreeModule from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation diff --git a/src/sage/categories/examples/finite_monoids.py b/src/sage/categories/examples/finite_monoids.py index f61c28a4032..4d3e8fa7029 100644 --- a/src/sage/categories/examples/finite_monoids.py +++ b/src/sage/categories/examples/finite_monoids.py @@ -13,7 +13,7 @@ from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element_wrapper import ElementWrapper -from sage.categories.all import Monoids +from sage.categories.monoids import Monoids from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ diff --git a/src/sage/categories/examples/finite_weyl_groups.py b/src/sage/categories/examples/finite_weyl_groups.py index a17a48c142e..535d5101101 100644 --- a/src/sage/categories/examples/finite_weyl_groups.py +++ b/src/sage/categories/examples/finite_weyl_groups.py @@ -11,7 +11,7 @@ from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent from sage.structure.element_wrapper import ElementWrapper -from sage.categories.all import FiniteWeylGroups +from sage.categories.finite_weyl_groups import FiniteWeylGroups from sage.structure.unique_representation import UniqueRepresentation class SymmetricGroup(UniqueRepresentation, Parent): diff --git a/src/sage/categories/examples/hopf_algebras_with_basis.py b/src/sage/categories/examples/hopf_algebras_with_basis.py index 16bd866c9c6..35b61f3c085 100644 --- a/src/sage/categories/examples/hopf_algebras_with_basis.py +++ b/src/sage/categories/examples/hopf_algebras_with_basis.py @@ -10,9 +10,9 @@ from sage.misc.cachefunc import cached_method from sage.sets.family import Family -from sage.categories.all import HopfAlgebrasWithBasis +from sage.categories.hopf_algebras_with_basis import HopfAlgebrasWithBasis from sage.combinat.free_module import CombinatorialFreeModule -from sage.categories.all import tensor +from sage.categories.tensor import tensor class MyGroupAlgebra(CombinatorialFreeModule): r""" diff --git a/src/sage/categories/examples/lie_algebras.py b/src/sage/categories/examples/lie_algebras.py index 3eafe0787f3..135a665cfa3 100644 --- a/src/sage/categories/examples/lie_algebras.py +++ b/src/sage/categories/examples/lie_algebras.py @@ -10,7 +10,7 @@ #from sage.misc.cachefunc import cached_method from sage.sets.family import Family -from sage.categories.all import LieAlgebras +from sage.categories.lie_algebras import LieAlgebras from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element_wrapper import ElementWrapper diff --git a/src/sage/categories/examples/magmas.py b/src/sage/categories/examples/magmas.py index 5139041cef0..a4858bc2606 100644 --- a/src/sage/categories/examples/magmas.py +++ b/src/sage/categories/examples/magmas.py @@ -15,7 +15,7 @@ from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element_wrapper import ElementWrapper -from sage.categories.all import Magmas +from sage.categories.magmas import Magmas from sage.sets.family import Family diff --git a/src/sage/categories/examples/monoids.py b/src/sage/categories/examples/monoids.py index c2919a8cc28..7336c680bdf 100644 --- a/src/sage/categories/examples/monoids.py +++ b/src/sage/categories/examples/monoids.py @@ -11,7 +11,7 @@ from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent from sage.structure.element_wrapper import ElementWrapper -from sage.categories.all import Monoids +from sage.categories.monoids import Monoids from .semigroups import FreeSemigroup from sage.sets.family import Family diff --git a/src/sage/categories/examples/posets.py b/src/sage/categories/examples/posets.py index 5041df19835..20f461860c9 100644 --- a/src/sage/categories/examples/posets.py +++ b/src/sage/categories/examples/posets.py @@ -10,7 +10,7 @@ from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation -from sage.categories.all import Posets +from sage.categories.posets import Posets from sage.structure.element_wrapper import ElementWrapper from sage.sets.set import Set, Set_object_enumerated from sage.sets.positive_integers import PositiveIntegers diff --git a/src/sage/categories/examples/semigroups.py b/src/sage/categories/examples/semigroups.py index 4c4d9a1f4df..5502215ef8a 100644 --- a/src/sage/categories/examples/semigroups.py +++ b/src/sage/categories/examples/semigroups.py @@ -12,7 +12,7 @@ from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element_wrapper import ElementWrapper -from sage.categories.all import Semigroups +from sage.categories.semigroups import Semigroups from sage.sets.family import Family class LeftZeroSemigroup(UniqueRepresentation, Parent): diff --git a/src/sage/categories/examples/semigroups_cython.pyx b/src/sage/categories/examples/semigroups_cython.pyx index ee7a03ddc82..b456c2868f8 100644 --- a/src/sage/categories/examples/semigroups_cython.pyx +++ b/src/sage/categories/examples/semigroups_cython.pyx @@ -4,7 +4,8 @@ Examples of semigroups in cython from sage.structure.parent cimport Parent from sage.structure.element cimport Element -from sage.categories.all import Category, Semigroups +from sage.categories.category import Category +from sage.categories.semigroups import Semigroups from sage.categories.examples.semigroups import LeftZeroSemigroup as LeftZeroSemigroupPython from cpython.object cimport PyObject_RichCompare diff --git a/src/sage/categories/examples/sets_cat.py b/src/sage/categories/examples/sets_cat.py index 93cc264580d..c4df13b1357 100644 --- a/src/sage/categories/examples/sets_cat.py +++ b/src/sage/categories/examples/sets_cat.py @@ -13,7 +13,7 @@ from sage.categories.sets_cat import Sets from sage.rings.integer import Integer, IntegerWrapper from sage.rings.integer_ring import IntegerRing -from sage.arith.all import is_prime +from sage.arith.misc import is_prime from sage.structure.unique_representation import UniqueRepresentation diff --git a/src/sage/categories/examples/with_realizations.py b/src/sage/categories/examples/with_realizations.py index 06e060f8925..2b75946b1d2 100644 --- a/src/sage/categories/examples/with_realizations.py +++ b/src/sage/categories/examples/with_realizations.py @@ -10,7 +10,9 @@ from sage.misc.cachefunc import cached_method from sage.misc.bindable_class import BindableClass -from sage.categories.all import Rings, Algebras, AlgebrasWithBasis +from sage.categories.rings import Rings +from sage.categories.algebras import Algebras +from sage.categories.algebras_with_basis import AlgebrasWithBasis from sage.categories.realizations import Category_realization_of_parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.parent import Parent diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index bb3df827890..f1897267140 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -523,7 +523,7 @@ def base_change_matrix(self): [ 1 0] [E(4) 1] """ - from sage.matrix.all import Matrix + from sage.matrix.constructor import Matrix return Matrix(list(self.independent_roots())).inverse() class ElementMethods: @@ -795,7 +795,7 @@ def elements_below_coxeter_element(self, c=None): sage: W = CoxeterGroup(['A', 3]) sage: len(list(W.elements_below_coxeter_element())) doctest:...: DeprecationWarning: The method elements_below_coxeter_element is deprecated. Please use absolute_order_ideal instead. - See https://trac.sagemath.org/27924 for details. + See https://github.com/sagemath/sage/issues/27924 for details. 14 """ from sage.misc.superseded import deprecation @@ -1187,7 +1187,7 @@ def rational_catalan_number(self, p, polynomial=False): sage: W.rational_catalan_number(3, polynomial=True) q^6 + q^4 + q^3 + q^2 + 1 """ - from sage.arith.all import gcd + from sage.arith.misc import GCD as gcd from sage.combinat.q_analogues import q_int h = self.coxeter_number() diff --git a/src/sage/categories/finite_dimensional_bialgebras_with_basis.py b/src/sage/categories/finite_dimensional_bialgebras_with_basis.py index 086892237e6..02f1005e0de 100644 --- a/src/sage/categories/finite_dimensional_bialgebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_bialgebras_with_basis.py @@ -27,5 +27,5 @@ def FiniteDimensionalBialgebrasWithBasis(base_ring): sage: TestSuite(C).run() """ - from sage.categories.all import BialgebrasWithBasis + from sage.categories.bialgebras_with_basis import BialgebrasWithBasis return BialgebrasWithBasis(base_ring).FiniteDimensional() diff --git a/src/sage/categories/finite_dimensional_coalgebras_with_basis.py b/src/sage/categories/finite_dimensional_coalgebras_with_basis.py index 9d1eecf556d..60b135080da 100644 --- a/src/sage/categories/finite_dimensional_coalgebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_coalgebras_with_basis.py @@ -27,5 +27,5 @@ def FiniteDimensionalCoalgebrasWithBasis(base_ring): sage: TestSuite(C).run() """ - from sage.categories.all import CoalgebrasWithBasis + from sage.categories.coalgebras_with_basis import CoalgebrasWithBasis return CoalgebrasWithBasis(base_ring).FiniteDimensional() diff --git a/src/sage/categories/graded_bialgebras.py b/src/sage/categories/graded_bialgebras.py index 6c751db558b..eff325b320e 100644 --- a/src/sage/categories/graded_bialgebras.py +++ b/src/sage/categories/graded_bialgebras.py @@ -26,5 +26,5 @@ def GradedBialgebras(base_ring): sage: TestSuite(C).run() """ - from sage.categories.all import Bialgebras + from sage.categories.bialgebras import Bialgebras return Bialgebras(base_ring).Graded() diff --git a/src/sage/categories/graded_bialgebras_with_basis.py b/src/sage/categories/graded_bialgebras_with_basis.py index 326e32b735d..d1727c0f40c 100644 --- a/src/sage/categories/graded_bialgebras_with_basis.py +++ b/src/sage/categories/graded_bialgebras_with_basis.py @@ -26,5 +26,5 @@ def GradedBialgebrasWithBasis(base_ring): sage: TestSuite(C).run() """ - from sage.categories.all import BialgebrasWithBasis + from sage.categories.bialgebras_with_basis import BialgebrasWithBasis return BialgebrasWithBasis(base_ring).Graded() diff --git a/src/sage/categories/graded_hopf_algebras.py b/src/sage/categories/graded_hopf_algebras.py index ad350212725..c4d5a24e3fe 100644 --- a/src/sage/categories/graded_hopf_algebras.py +++ b/src/sage/categories/graded_hopf_algebras.py @@ -35,5 +35,5 @@ def GradedHopfAlgebras(base_ring): :class:`super Hopf algebras `. """ - from sage.categories.all import HopfAlgebras + from sage.categories.hopf_algebras import HopfAlgebras return HopfAlgebras(base_ring).Graded() diff --git a/src/sage/categories/homset.py b/src/sage/categories/homset.py index 1b488a03b69..88b162c5845 100644 --- a/src/sage/categories/homset.py +++ b/src/sage/categories/homset.py @@ -74,9 +74,9 @@ ################################### # Use the weak "triple" dictionary -# introduced in trac ticket #715 +# introduced in github issue #715 # with weak values, as introduced in -# trac ticket #14159 +# github issue #14159 from sage.structure.coerce_dict import TripleDict _cache = TripleDict(weak_values=True) diff --git a/src/sage/categories/magmas.py b/src/sage/categories/magmas.py index 975ea0491b3..ff1a7f955c5 100644 --- a/src/sage/categories/magmas.py +++ b/src/sage/categories/magmas.py @@ -785,7 +785,7 @@ def __init_extra__(self): # This should instead register the multiplication to the coercion model # But this is not yet implemented in the coercion model # - # Trac ticket #11900: The following used to test whether + # Github issue #11900: The following used to test whether # self.product != self.product_from_element_class_mul. But # that is, of course, a bug. Namely otherwise, if the parent # has an optimized `product` then its elements will *always* use diff --git a/src/sage/categories/map.pyx b/src/sage/categories/map.pyx index a569cc83849..5b3a00a2328 100644 --- a/src/sage/categories/map.pyx +++ b/src/sage/categories/map.pyx @@ -1331,7 +1331,7 @@ cdef class Section(Map): To: Multivariate Polynomial Ring in x, y over Rational Field """ from sage.categories.homset import Hom - from sage.categories.all import SetsWithPartialMaps + from sage.categories.sets_with_partial_maps import SetsWithPartialMaps Map.__init__(self, Hom(map.codomain(), map.domain(), SetsWithPartialMaps())) self._inverse = map # TODO: Use this attribute somewhere! diff --git a/src/sage/categories/modules.py b/src/sage/categories/modules.py index 2e3eb65dc3d..cb878f1c6f2 100644 --- a/src/sage/categories/modules.py +++ b/src/sage/categories/modules.py @@ -973,6 +973,6 @@ def tensor_factors(self): sage: M.construction() doctest:warning... DeprecationWarning: implementations of Modules().TensorProducts() now must define the method tensor_factors - See https://trac.sagemath.org/34393 for details. + See https://github.com/sagemath/sage/issues/34393 for details. (VectorFunctor, Integer Ring) """ diff --git a/src/sage/categories/monoid_algebras.py b/src/sage/categories/monoid_algebras.py index f51a8d01ce1..a387d7f74f4 100644 --- a/src/sage/categories/monoid_algebras.py +++ b/src/sage/categories/monoid_algebras.py @@ -33,5 +33,5 @@ def MonoidAlgebras(base_ring): sage: TestSuite(MonoidAlgebras(ZZ)).run() """ - from sage.categories.all import Monoids + from sage.categories.monoids import Monoids return Monoids().Algebras(base_ring) diff --git a/src/sage/categories/morphism.pyx b/src/sage/categories/morphism.pyx index 121dc3bbd15..59a73a43c62 100644 --- a/src/sage/categories/morphism.pyx +++ b/src/sage/categories/morphism.pyx @@ -393,7 +393,7 @@ cdef class Morphism(Map): # multiplying it with the gens of the scalar ring. # # It is known that this way of comparing morphisms may give - # a mathematically wrong answer. See Trac #28617 and #31783. + # a mathematically wrong answer. See Issue #28617 and #31783. if e is not None and isinstance(e, ModuleElement): B = (e)._parent._base gens = [e * B.coerce(x) for x in gens] diff --git a/src/sage/categories/primer.py b/src/sage/categories/primer.py index b3624ad4dc1..96dff8e2631 100644 --- a/src/sage/categories/primer.py +++ b/src/sage/categories/primer.py @@ -440,12 +440,12 @@ class implements: For plain Python methods, one can also just ask in which module they are implemented:: - sage: i._pow_.__module__ # not tested (Trac #24275) + sage: i._pow_.__module__ # not tested (Issue #24275) 'sage.categories.semigroups' sage: pQ._mul_.__module__ 'sage.rings.polynomial.polynomial_element_generic' - sage: pQ._pow_.__module__ # not tested (Trac #24275) + sage: pQ._pow_.__module__ # not tested (Issue #24275) 'sage.categories.semigroups' We see that integers and polynomials have each their own diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 86e33e45b1e..6c5b08e003a 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -2878,8 +2878,8 @@ def _apply_functor(self, R): Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + 2, y^2 + 3*x) Note that the ``quo()`` method of a field used to return the - integer zero. That strange behaviour was removed in trac - ticket :trac:`9138`. It now returns a trivial quotient ring + integer zero. That strange behaviour was removed in github + issue :trac:`9138`. It now returns a trivial quotient ring when applied to a field:: sage: F = ZZ.quo([5]*ZZ).construction()[0] diff --git a/src/sage/categories/schemes.py b/src/sage/categories/schemes.py index df2ec0603cf..aad5a48b7e9 100644 --- a/src/sage/categories/schemes.py +++ b/src/sage/categories/schemes.py @@ -140,7 +140,7 @@ def _call_(self, x): from sage.categories.commutative_rings import CommutativeRings from sage.schemes.generic.spec import Spec from sage.categories.map import Map - from sage.categories.all import Rings + from sage.categories.rings import Rings if x in CommutativeRings(): return Spec(x) elif isinstance(x, Map) and x.category_for().is_subcategory(Rings()): diff --git a/src/sage/categories/unital_algebras.py b/src/sage/categories/unital_algebras.py index 43ffa76d47c..d245b4de8c1 100644 --- a/src/sage/categories/unital_algebras.py +++ b/src/sage/categories/unital_algebras.py @@ -109,7 +109,7 @@ def __init_extra__(self): sage: Bar(category=Algebras(QQ)) doctest:warning...: DeprecationWarning: the attribute _no_generic_basering_coercion is deprecated, implement _coerce_map_from_base_ring() instead - See http://trac.sagemath.org/19225 for details. + See https://github.com/sagemath/sage/issues/19225 for details. <__main__.Bar_with_category object at 0x...> """ if getattr(self, '_no_generic_basering_coercion', False): @@ -227,7 +227,7 @@ def _coerce_map_from_base_ring(self): elif isinstance(generic_from_base_ring, lazy_attribute): # If the category implements from_base_ring() as lazy # attribute, then we always use it. - # This is for backwards compatibility, see Trac #25181 + # This is for backwards compatibility, see Issue #25181 use_from_base_ring = True else: try: diff --git a/src/sage/coding/gabidulin_code.py b/src/sage/coding/gabidulin_code.py index b29b85d6359..b6d2e2bac4d 100644 --- a/src/sage/coding/gabidulin_code.py +++ b/src/sage/coding/gabidulin_code.py @@ -544,7 +544,7 @@ class GabidulinPolynomialEvaluationEncoder(Encoder): sage: p = (z9^6 + z9^2 + z9 + 1)*x + z9^7 + z9^5 + z9^4 + z9^2 sage: vector(p.multi_point_evaluation(C.evaluation_points())) doctest:...: FutureWarning: This class/method/function is marked as experimental. It, its functionality or its interface might change without a formal deprecation. - See http://trac.sagemath.org/13215 for details. + See https://github.com/sagemath/sage/issues/13215 for details. (z9^7 + z9^6 + z9^5 + z9^4 + z9 + 1, z9^6 + z9^5 + z9^3 + z9) EXAMPLES:: diff --git a/src/sage/combinat/alternating_sign_matrix.py b/src/sage/combinat/alternating_sign_matrix.py index d0d95bc696d..9ece92160e1 100644 --- a/src/sage/combinat/alternating_sign_matrix.py +++ b/src/sage/combinat/alternating_sign_matrix.py @@ -1197,7 +1197,7 @@ def _element_constructor_(self, asm, check=True): if isinstance(asm, AlternatingSignMatrix): if asm.parent() is self: return asm - raise ValueError("Cannot convert between alternating sign matrices of different sizes") + raise ValueError("cannot convert between alternating sign matrices of different sizes") try: m = self._matrix_space(asm) except (TypeError, ValueError): diff --git a/src/sage/combinat/colored_permutations.py b/src/sage/combinat/colored_permutations.py index 4ace496fbdb..28b20e502af 100644 --- a/src/sage/combinat/colored_permutations.py +++ b/src/sage/combinat/colored_permutations.py @@ -436,7 +436,7 @@ class ColoredPermutations(Parent, UniqueRepresentation): [[0, 1, 0], [1, 2, 3]] We can also create a colored permutation by passing - either a list of tuples consisting of ``(color, element)``:: + an iterable consisting of tuples consisting of ``(color, element)``:: sage: x = C([(2,1), (3,3), (3,2)]); x [[2, 3, 3], [1, 3, 2]] @@ -445,6 +445,8 @@ class ColoredPermutations(Parent, UniqueRepresentation): sage: C([[3,3,1], [1,3,2]]) [[3, 3, 1], [1, 3, 2]] + sage: C(([3,3,1], [1,3,2])) + [[3, 3, 1], [1, 3, 2]] There is also the natural lift from permutations:: @@ -452,6 +454,12 @@ class ColoredPermutations(Parent, UniqueRepresentation): sage: C(P.an_element()) [[0, 0, 0], [3, 1, 2]] + + A colored permutation:: + + sage: C(C.an_element()) == C.an_element() + True + REFERENCES: - :wikipedia:`Generalized_symmetric_group` @@ -688,20 +696,22 @@ def _element_constructor_(self, x): sage: x == C([[2,3,3], [1,3,2]]) True """ - if isinstance(x, list): - if isinstance(x[0], tuple): - c = [] - p = [] - for k in x: - if len(k) != 2: - raise ValueError("input must be pairs (color, element)") - c.append(self._C(k[0])) - p.append(k[1]) - return self.element_class(self, c, self._P(p)) - - if len(x) != 2: - raise ValueError("input must be a pair of a list of colors and a permutation") - return self.element_class(self, [self._C(v) for v in x[0]], self._P(x[1])) + if isinstance(x, self.element_class) and x.parent() is self: + return self + x = list(x) + if isinstance(x[0], tuple): + c = [] + p = [] + for k in x: + if len(k) != 2: + raise ValueError("input must be pairs (color, element)") + c.append(self._C(k[0])) + p.append(k[1]) + return self.element_class(self, c, self._P(p)) + + if len(x) != 2: + raise ValueError("input must be a pair of a list of colors and a permutation") + return self.element_class(self, [self._C(v) for v in x[0]], self._P(x[1])) def _coerce_map_from_(self, C): """ @@ -989,6 +999,11 @@ def __classcall_private__(cls, pi): sage: SignedPermutation([2, 1, -3]) [2, 1, -3] + sage: SignedPermutation((2,1,-3)) + [2, 1, -3] + + sage: SignedPermutation(range(1,4)) + [1, 2, 3] """ return SignedPermutations(len(list(pi)))(pi) @@ -1360,38 +1375,43 @@ def _element_constructor_(self, x): sage: S([]) == list(S)[0] True - """ - if isinstance(x, list): - if x and isinstance(x[0], tuple): - c = [] - p = [] - for k in x: - if len(k) != 2: - raise ValueError("input must be pairs (sign, element)") - if k[0] != 1 and k[0] != -1: - raise ValueError("the sign must be +1 or -1") - c.append(ZZ(k[0])) - p.append(k[1]) - return self.element_class(self, c, self._P(p)) - - if len(x) == self._n: - c = [] - p = [] - one = ZZ.one() - for v in x: - if v > 0: - c.append(one) - p.append(v) - else: - c.append(-one) - p.append(-v) - return self.element_class(self, c, self._P(p)) - - if len(x) != 2: - raise ValueError("input must be a pair of a list of signs and a permutation") - if any(s != 1 and s != -1 for s in x[0]): - raise ValueError("the sign must be +1 or -1") - return self.element_class(self, [ZZ(v) for v in x[0]], self._P(x[1])) + sage: T = SignedPermutation(range(1,4)) + sage: SignedPermutations(3)(T) + [1, 2, 3] + """ + if isinstance(x, self.element_class) and x.parent() is self: + return self + x = list(x) + if x and isinstance(x[0], tuple): + c = [] + p = [] + for k in x: + if len(k) != 2: + raise ValueError("input must be pairs (sign, element)") + if k[0] != 1 and k[0] != -1: + raise ValueError("the sign must be +1 or -1") + c.append(ZZ(k[0])) + p.append(k[1]) + return self.element_class(self, c, self._P(p)) + + if len(x) == self._n: + c = [] + p = [] + one = ZZ.one() + for v in x: + if v > 0: + c.append(one) + p.append(v) + else: + c.append(-one) + p.append(-v) + return self.element_class(self, c, self._P(p)) + + if len(x) != 2: + raise ValueError("input must be a pair of a list of signs and a permutation") + if any(s != 1 and s != -1 for s in x[0]): + raise ValueError("the sign must be +1 or -1") + return self.element_class(self, [ZZ(v) for v in x[0]], self._P(x[1])) def __iter__(self): """ diff --git a/src/sage/combinat/combinat.py b/src/sage/combinat/combinat.py index baa58375751..845216c49a2 100644 --- a/src/sage/combinat/combinat.py +++ b/src/sage/combinat/combinat.py @@ -2528,7 +2528,7 @@ def cardinality(self) -> Integer | infinity: sage: R = InfiniteAbstractCombinatorialClass() doctest:warning... DeprecationWarning: this class is deprecated, do not use - See https://trac.sagemath.org/31545 for details. + See https://github.com/sagemath/sage/issues/31545 for details. sage: R.cardinality() +Infinity diff --git a/src/sage/combinat/decorated_permutation.py b/src/sage/combinat/decorated_permutation.py index 4ce8e5e56e0..e7281b7d3bb 100644 --- a/src/sage/combinat/decorated_permutation.py +++ b/src/sage/combinat/decorated_permutation.py @@ -213,7 +213,7 @@ def _element_constructor_(self, pi, check=True): if isinstance(pi, DecoratedPermutation): if pi.parent() is self: return pi - raise ValueError("Cannot convert between decorated permutations of different sizes") + raise ValueError("cannot convert between decorated permutations of different sizes") pi = tuple(pi) if check and pi not in self: diff --git a/src/sage/combinat/derangements.py b/src/sage/combinat/derangements.py index eeeb73fb7ce..1645ff2d53b 100644 --- a/src/sage/combinat/derangements.py +++ b/src/sage/combinat/derangements.py @@ -199,7 +199,7 @@ def _element_constructor_(self, der): if isinstance(der, Derangement): if der.parent() is self: return der - raise ValueError("Cannot convert %s to an element of %s" % (der, self)) + raise ValueError("cannot convert %s to an element of %s" % (der, self)) return self.element_class(self, der) Element = Derangement diff --git a/src/sage/combinat/designs/difference_family.py b/src/sage/combinat/designs/difference_family.py index ed9bb493616..609cdf6542e 100644 --- a/src/sage/combinat/designs/difference_family.py +++ b/src/sage/combinat/designs/difference_family.py @@ -1050,7 +1050,7 @@ def are_mcfarland_1973_parameters(v, k, lmbda, return_parameters=False): # NOTE: below we compute the value of s so that qs = q^s. If the method # is_power_of of integers would be able to return the exponent, we could use # that... but currently this is not the case - # see trac ticket #19792 + # see github issue #19792 p1,a1 = qs.is_prime_power(get_data=True) p2,a2 = q.is_prime_power(get_data=True) @@ -1294,24 +1294,24 @@ def _is_periodic_sequence(seq, period): first = seq[:per] periodic = True for j in range(1, len(seq)//per): - if seq[j*per:(j+1)*per] != first: + if seq[j*per : (j+1)*per] != first: periodic = False break if periodic: return False - if seq[:period] != seq[period:2*period]: + if seq[:period] != seq[period : 2*period]: return False return True def _create_m_sequence(q, n, check=True): - r"""Create an m-sequence over GF(q) with period `q^n-1`. + r"""Create an m-sequence over GF(q) with period `q^n - 1`. Given a prime power `q`, the m-sequence is created as described by [Zie1959]_ from a primitive function over the finite field `GF(q)`. - Given a primitive function `f=c_0+c_1x+...+c_nx^n` over `K=GF(q)` of degree `n`, - the recurrence is given by: `a_i = -c_0^{-1}(c_1a_{i-1}+...+c_na{i-n})`. - The first `n` elements will be `0,0,...,0,1` and these will give a maximal length recurrence sequence + Given a primitive function `f=c_0+c_1x+...+c_nx^n` over `K = GF(q)` of degree `n`, + the recurrence is given by: `a_i = -c_0^{-1}(c_1a_{i-1} + ... + c_na{i-n})`. + The first `n` elements will be `0, 0, ..., 0, 1` and these will give a maximal length recurrence sequence as shown in [Mit2008]_. INPUT: @@ -1320,7 +1320,7 @@ def _create_m_sequence(q, n, check=True): - ``n`` -- a nonnegative number. - - ``check`` -- boolean (dafault True): if true, check that the result is a seqauence with correct period. + - ``check`` -- boolean (default True): if true, check that the result is a seqauence with correct period. Setting it to false may speed up considerably the computation. EXAMPLES:: @@ -1354,13 +1354,13 @@ def _create_m_sequence(q, n, check=True): period = q**n - 1 seq_len = period*2 if check else period - seq = [1]+[0]*(n-1) + seq = [1] + [0]*(n-1) while len(seq) < seq_len: nxt = 0 for i, coeff in zip(exps[1:], coeffs[1:]): - nxt += coeff*seq[-i] - seq.append(-coeffs[0].inverse()*nxt) + nxt += coeff * seq[-i] + seq.append(-coeffs[0].inverse() * nxt) if check: assert _is_periodic_sequence(seq, period) @@ -1444,14 +1444,14 @@ def relative_difference_set_from_m_sequence(q, N, check=True): raise ValueError('N must be at least 2') m_seq = _create_m_sequence(q, N, check=False) - period = q**N-1 + period = q**N - 1 G = AdditiveAbelianGroup([period]) set1 = [i for i in G if m_seq[i[0]] == 1] if check: H = _get_submodule_of_order(G, q-1) - assert is_relative_difference_set(set1, G, H, (period//(q-1), q-1, q**(N-1), q**(N-2))) + assert is_relative_difference_set(set1, G, H, (period // (q-1), q - 1, q**(N-1), q**(N-2))) return set1 def relative_difference_set_from_homomorphism(q, N, d, check=True): @@ -1506,7 +1506,7 @@ def relative_difference_set_from_homomorphism(q, N, d, check=True): if (q-1)%d != 0: raise ValueError('q-1 must be a multiple of d') - G = AdditiveAbelianGroup([q**N-1]) + G = AdditiveAbelianGroup([q**N - 1]) K = _get_submodule_of_order(G, d) assert K is not None, 'Could not find kernel' @@ -1517,11 +1517,11 @@ def relative_difference_set_from_homomorphism(q, N, d, check=True): second_diff_set = [theta(x) for x in diff_set] if check: - H = _get_submodule_of_order(G2, (q-1)//d) - assert is_relative_difference_set(second_diff_set, G2, H, ((q**N-1)//(q-1), (q-1)//d, q**(N-1), q**(N-2)*d)) + H = _get_submodule_of_order(G2, (q-1) // d) + assert is_relative_difference_set(second_diff_set, G2, H, ((q**N-1) // (q-1), (q-1) // d, q**(N-1), q**(N-2) * d)) return second_diff_set -def is_relative_difference_set(R, G, H, params, verbose =False): +def is_relative_difference_set(R, G, H, params, verbose=False): r"""Check if `R` is a difference set of `G` relative to `H`, with the given parameters. This function checks that `G`, `H` and `R` have the orders specified in the parameters, and @@ -1546,9 +1546,9 @@ def is_relative_difference_set(R, G, H, params, verbose =False): sage: from sage.combinat.designs.difference_family import _get_submodule_of_order, relative_difference_set_from_m_sequence, is_relative_difference_set sage: q, N = 5, 2 - sage: G = AdditiveAbelianGroup([q^N-1]) - sage: H = _get_submodule_of_order(G, q-1) - sage: params = ((q^N-1)//(q-1), q-1, q^(N-1), q^(N-2)) + sage: G = AdditiveAbelianGroup([q^N - 1]) + sage: H = _get_submodule_of_order(G, q - 1) + sage: params = ((q^N-1) // (q-1), q - 1, q^(N-1), q^(N-2)) sage: R = relative_difference_set_from_m_sequence(q, N) sage: is_relative_difference_set(R, G, H, params) True @@ -1561,7 +1561,7 @@ def is_relative_difference_set(R, G, H, params, verbose =False): False """ m, n, k, d = params - if G.order() != m*n: + if G.order() != m * n: if verbose: print('Incorrect order of G:', G.order()) return False @@ -1579,7 +1579,7 @@ def is_relative_difference_set(R, G, H, params, verbose =False): for el1 in R: for el2 in R: if el1 != el2: - idx = el1-el2 + idx = el1 - el2 if idx not in diff_set: diff_set[idx] = 0 diff_set[idx] += 1 @@ -1602,11 +1602,11 @@ def is_relative_difference_set(R, G, H, params, verbose =False): return True def is_supplementary_difference_set(Ks, v, lmbda): - r"""Check that the sets in ``Ks`` are `n-\{v; k_1,...,k_n; \lambda \}` supplementary difference sets. - + r"""Check that the sets in ``Ks`` are `n-\{v; k_1, ..., k_n; \lambda \}` supplementary difference sets. + From the definition in [Spe1975]_: let `S_1, S_2, ..., S_n` be `n` subsets of an additive abelian group `G` of order `v` - such that `|S_i|= k_i`. If, for each `g\in G`, `g \neq 0`, the total number of solutions of `a_i-a'_i = g`, with - `a_i,a'_i \in S_i` is `\lambda`, then `S_1, S_2, ..., S_n` are `n-\{v; k_1,...,k_n;\lambda\}` supplementary difference sets. + such that `|S_i| = k_i`. If, for each `g \in G`, `g \neq 0`, the total number of solutions of `a_i - a'_i = g`, with + `a_i, a'_i \in S_i` is `\lambda`, then `S_1, S_2, ..., S_n` are `n-\{v; k_1, ..., k_n; \lambda\}` supplementary difference sets. INPUT: @@ -1638,8 +1638,7 @@ def is_supplementary_difference_set(Ks, v, lmbda): for K in Ks: for el1 in K: for el2 in K: - diff = G[el1]-G[el2] - + diff = G[el1] - G[el2] if diff not in differences_counter: differences_counter[diff] = 0 differences_counter[diff] += 1 @@ -1722,13 +1721,12 @@ def supplementary_difference_set(q, existence=False, check=True): .. SEEALSO:: :func:`is_supplementary_difference_set` - """ s = 0 m = -1 while q > 2**(s+1) and (q-1) % 2**(s+1) == 0: - prime_pow = (q-1)//2**(s+1)-1 + prime_pow = (q-1)//2**(s+1) - 1 if is_prime_power(prime_pow) and prime_pow % 2 == 1: m = (q - (2**(s+1) + 1)) // 2**(s+1) + 1 break @@ -1742,7 +1740,7 @@ def supplementary_difference_set(q, existence=False, check=True): if m == -1: raise ValueError('There is no s for which m-1 is an odd prime power') - set1 = relative_difference_set_from_homomorphism(m-1, 2, (m-2)//2, check=False) + set1 = relative_difference_set_from_homomorphism(m - 1, 2, (m-2) // 2, check=False) from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing P = PolynomialRing(ZZ, 'x') @@ -1753,15 +1751,15 @@ def supplementary_difference_set(q, existence=False, check=True): hall += P.monomial(d[0]) T_2m = 0 - for i in range(2*m): + for i in range(2 * m): T_2m += P.monomial(i) - modulo = P.monomial(2*m)-1 + modulo = P.monomial(2*m) - 1 diff = T_2m - (1+P.monomial(m))*hall diff = diff.mod(modulo) exp1, exp2 = diff.exponents() - a = (exp1+exp2-m)//2 + a = (exp1+exp2-m) // 2 alfa3 = (P.monomial(a) + hall).mod(modulo) alfa4 = (P.monomial(a+m) + hall).mod(modulo) @@ -1769,22 +1767,22 @@ def supplementary_difference_set(q, existence=False, check=True): psi3 = alfa3 psi4 = alfa4 for i in range(s): - psi3 = (alfa3(P.monomial(2))+P.monomial(1)*alfa4(P.monomial(2))).mod(P.monomial(4*m)-1) + psi3 = (alfa3(P.monomial(2)) + P.monomial(1)*alfa4(P.monomial(2))).mod(P.monomial(4*m)-1) psi4 = (alfa3(P.monomial(2)) + P.monomial(1)*(T_2m(P.monomial(2)) - alfa4(P.monomial(2)))).mod(P.monomial(4*m)-1) # Construction of psi1, psi2 set2 = relative_difference_set_from_m_sequence(q, 2, check=False) - s3 = _get_fixed_relative_difference_set(set2) + s3 = get_fixed_relative_difference_set(set2) phi_exps = [] for i in range(len(s3)): for j in range(i+1, len(s3)): - diff = (s3[i]-s3[j]) - if diff%(q-1) == 0 and diff%(q**2-1) != 0: + diff = s3[i] - s3[j] + if diff % (q-1) == 0 and diff % (q**2-1) != 0: phi_exps.append(s3[i]) - exps1 = [(x+1)//2 for x in phi_exps if x%2 == 1] - exps2 = [x//2 for x in phi_exps if x%2 == 0] + exps1 = [(x+1)//2 for x in phi_exps if x % 2 == 1] + exps2 = [x//2 for x in phi_exps if x % 2 == 0] theta1 = 0 for exp in exps1: @@ -1794,12 +1792,12 @@ def supplementary_difference_set(q, existence=False, check=True): theta2 = 0 for exp in exps2: theta2 += P.monomial(exp) - theta2 = theta2.mod(P.monomial(q-1)-1) + theta2 = theta2.mod(P.monomial(q-1) - 1) phi1 = 0 phi2 = 0 for exp in phi_exps: - if exp%2 == 0: + if exp % 2 == 0: phi2 += P.monomial(exp) else: phi1 += P.monomial(exp) @@ -1817,8 +1815,8 @@ def supplementary_difference_set(q, existence=False, check=True): return K1, K2, K3, K4 -def _get_fixed_relative_difference_set(rel_diff_set, as_elements=False): - r"""Contruct an equivalent relative difference set fixed by the size of the set. +def get_fixed_relative_difference_set(rel_diff_set, as_elements=False): + r"""Construct an equivalent relative difference set fixed by the size of the set. Given a relative difference set `R(q+1, q-1, q, 1)`, it is possible to find a translation of this set fixed by `q` (see Section 3 of [Spe1975]_). We say that a set is fixed by `t` if @@ -1842,30 +1840,30 @@ def _get_fixed_relative_difference_set(rel_diff_set, as_elements=False): EXAMPLES:: - sage: from sage.combinat.designs.difference_family import relative_difference_set_from_m_sequence, _get_fixed_relative_difference_set + sage: from sage.combinat.designs.difference_family import relative_difference_set_from_m_sequence, get_fixed_relative_difference_set sage: s1 = relative_difference_set_from_m_sequence(5, 2) - sage: _get_fixed_relative_difference_set(s1) #random + sage: get_fixed_relative_difference_set(s1) #random [2, 10, 19, 23, 0] If ``as_elements`` is true, the reuslt will contain elements of the group:: - sage: _get_fixed_relative_difference_set(s1, as_elements=True) #random + sage: get_fixed_relative_difference_set(s1, as_elements=True) #random [(2), (10), (19), (23), (0)] TESTS:: - sage: from sage.combinat.designs.difference_family import _is_fixed_relative_difference_set + sage: from sage.combinat.designs.difference_family import is_fixed_relative_difference_set sage: s1 = relative_difference_set_from_m_sequence(5, 2) - sage: s2 = _get_fixed_relative_difference_set(s1, as_elements=True) - sage: _is_fixed_relative_difference_set(s2, len(s2)) + sage: s2 = get_fixed_relative_difference_set(s1, as_elements=True) + sage: is_fixed_relative_difference_set(s2, len(s2)) True sage: s1 = relative_difference_set_from_m_sequence(9, 2) - sage: s2 = _get_fixed_relative_difference_set(s1, as_elements=True) - sage: _is_fixed_relative_difference_set(s2, len(s2)) + sage: s2 = get_fixed_relative_difference_set(s1, as_elements=True) + sage: is_fixed_relative_difference_set(s2, len(s2)) True sage: type(s2[0]) - sage: s2 = _get_fixed_relative_difference_set(s1) + sage: s2 = get_fixed_relative_difference_set(s1) sage: type(s2[0]) """ @@ -1875,14 +1873,14 @@ def _get_fixed_relative_difference_set(rel_diff_set, as_elements=False): s2 = None for el in G: fixed_set = [el+x for x in rel_diff_set] - if _is_fixed_relative_difference_set(fixed_set, q): + if is_fixed_relative_difference_set(fixed_set, q): s2 = fixed_set break assert s2 is not None, 'Cannot find fixed translation of the set' s3 = None for i in range(G.order()): - temp = [((q+1)*i+x[0])%G.order() for x in s2] + temp = [((q+1)*i+x[0]) % G.order() for x in s2] if 0 in temp: s3 = temp break @@ -1892,10 +1890,10 @@ def _get_fixed_relative_difference_set(rel_diff_set, as_elements=False): return [G[x] for x in s3] return s3 -def _is_fixed_relative_difference_set(R, q): +def is_fixed_relative_difference_set(R, q): r"""Check if the relative difference set `R` is fixed by `q`. - A relative difference set `R` is fixed by `q` if `\{qd | d\in R\}= R` (see Section 3 of [Spe1975]_). + A relative difference set `R` is fixed by `q` if `\{qd | d \in R\}= R` (see Section 3 of [Spe1975]_). INPUT: @@ -1905,40 +1903,45 @@ def _is_fixed_relative_difference_set(R, q): EXAMPLES:: - sage: from sage.combinat.designs.difference_family import relative_difference_set_from_m_sequence, _get_fixed_relative_difference_set, _is_fixed_relative_difference_set + sage: from sage.combinat.designs.difference_family import relative_difference_set_from_m_sequence, get_fixed_relative_difference_set, is_fixed_relative_difference_set sage: s1 = relative_difference_set_from_m_sequence(7, 2) - sage: s2 = _get_fixed_relative_difference_set(s1, as_elements=True) - sage: _is_fixed_relative_difference_set(s2, len(s2)) + sage: s2 = get_fixed_relative_difference_set(s1, as_elements=True) + sage: is_fixed_relative_difference_set(s2, len(s2)) True sage: G = AdditiveAbelianGroup([15]) sage: s3 = [G[1], G[2], G[3], G[4]] - sage: _is_fixed_relative_difference_set(s3, len(s3)) + sage: is_fixed_relative_difference_set(s3, len(s3)) False If the relative difference set does not contain elements of the group, the method returns false:: sage: s1 = relative_difference_set_from_m_sequence(7, 2) - sage: s2 = _get_fixed_relative_difference_set(s1, as_elements=False) - sage: _is_fixed_relative_difference_set(s2, len(s2)) + sage: s2 = get_fixed_relative_difference_set(s1, as_elements=False) + sage: is_fixed_relative_difference_set(s2, len(s2)) False - - """ for el in R: - if q*el not in R: + if q * el not in R: return False return True def skew_supplementary_difference_set(n, existence=False, check=True): - r"""Construct `4-\{n; n_1, n_2, n_3, n_4; \lambda\}` supplementary difference sets where `S_1` is skew and `n_1+n_2+n_3+n_4= n+\lambda`. + r"""Construct `4-\{n; n_1, n_2, n_3, n_4; \lambda\}` supplementary difference sets where `S_1` is skew and `n_1 + n_2 + n_3 + n_4 = n+\lambda`. These sets are constructed from available data, as described in [Djo1994]_. The set `S_1 \subset G` is - always skew, i.e. `S_1 \cap (-S_1) = \emptyset` and `S_1 \cup (-S_1) = G\setminus\{0\}`. - - The data for `n = 103, 151` is taken from [Djo1994]_ and the data for `n = 67, 113, 127, 157, 163, 181, 241` - is taken from [Djo1992]_. - + always skew, i.e. `S_1 \cap (-S_1) = \emptyset` and `S_1 \cup (-S_1) = G \setminus \{0\}`. + + The data is taken from: + + * `n = 103, 151`: [Djo1994]_ + * `n = 67, 113, 127, 157, 163, 181, 241`: [Djo1992a]_ + * `n = 37, 43`: [Djo1992b]_ + * `n = 39, 49, 65, 93, 121, 129, 133, 217, 219, 267`: [Djo1992c]_ + * `n = 97`: [Djo2008a]_ + * `n = 109, 145, 247`: [Djo2008b]_ + * `n = 73`: [Djo2023b]_ + INPUT: - ``n`` -- integer, the parameter of the supplementary difference set. @@ -1989,79 +1992,178 @@ def skew_supplementary_difference_set(n, existence=False, check=True): False sage: skew_supplementary_difference_set(127, existence=True) True - """ + .. NOTE:: + + The data for `n=247` in [Djo2008b]_ contains a typo: the set `\alpha_2` should contain `223` instead of `233`. + This can be verified by checking the resulting sets, which are given explicitly in the paper. + """ + # If -1 is present in an index set, it means that {0} should be added to that set indices = { - 67: [[0,3,5,6,9,10,13,14,17,18,20], - [0,2,4,9,11,12,13,16,19,21], - [1,3,6,10,11,13,14,16,20,21], - [2,4,6,8,9,11,14,17,19]], - 103: [[1,3,4,6,8,11,12,14,17,18,20,22,25,27,28,30,32], - [2,9,10,12,13,14,15,16,20,21,22,23,24,26,28,29,30], - [0,1,2,3,4,11,12,13,16,17,19,20,21,24,25,26,28,30,31], - [0,1,2,3,4,5,6,13,15,18,19,20,23,24,25,26,27,28,29,31]], - 113: [[0,3,4,6,8,10,13,14], - [1,3,8,9,10,11,12,13], - [0,2,3,5,6,7,12], - [1,2,3,5,8,9,15]], - 127: [[0,3,5,7,8,10,12,14,16], - [0,1,3,6,7,9,10,12,14,15], - [0,1,3,4,5,7,8,9,15,16], - [1,4,5,6,9,10,13,14,15,16]], - 151: [[0,3,5,6,8,11,13,14,16,19,21,23,25,27,28], - [2,3,6,13,16,17,20,23,25,26,27,28,29], - [0,1,2,3,4,6,7,8,9,10,11,12,23,24,27,28], - [1,4,5,10,11,12,13,14,16,18,19,22,25,26,27,28]], - 157:[[0,2,5,7,8,11], - [0,4,5,6,9,11], - [6,7,8,9,10,11], - [0,5,6,7,8,10,11]], - 163: [[0,2,5,6,9,10,13,14,17], - [0,1,7,10,12,15,16,17], - [0,1,3,5,8,13,15,16,17], - [3,6,7,8,11,12,13,14,16,17]], - 181: [[0,3,5,6,8,10,13,15,16,19], - [4,5,7,8,11,14,15,16,18,19], - [0,4,10,11,13,15,16,18,19], - [2,4,5,7,11,13,15,17,19]], - 241: [[0,2,4,6,8,11,12,14], - [1,3,4,6,7,13,14,15], - [6,8,9,10,12,13,14,15], - [3,4,5,9,10,13,14]], + 37: [[0, 3, 5, 7, 9, 10], [0, 5, 6, 7, 8], + [1, 2, 6, 7, 9], [2, 6, 8, 9, 10]], + 39: [[1, 3, 5, 6, 8, 10, 12], [0, 1, 5, 8, 12, 13], + [1, 3, 4, 7, 9, 12, 13], [0, 1, 2, 3, 7, 8]], + 43: [[1, 2, 4], [1, 2, 4], [0, 2, 3], [3, 4, -1]], + 49: [[1, 2, 5, 7, 8, 10, 13, 14], [4, 5, 6, 7, 10, 11], + [0, 1, 2, 4, 6, 7, 12, 14], [1, 2, 3, 5, 6, 10, 12, 13, 14]], + 65: [[1, 3, 5, 6, 8, 10, 13, 14, 17, 18, 20, 22], + [0, 3, 7, 10, 16, 17, 18, 20, 21], + [2, 4, 6, 8, 9, 10, 14, 15, 16, 17, 18, 20], + [5, 7, 8, 9, 11, 12, 13, 14, 16, 18, 19, 20, 21]], + 67: [[0, 3, 5, 6, 9, 10, 13, 14, 17, 18, 20], + [0, 2, 4, 9, 11, 12, 13, 16, 19, 21], + [1, 3, 6, 10, 11, 13, 14, 16, 20, 21], + [2, 4, 6, 8, 9, 11, 14, 17, 19]], + 73: [[4, 6, 8, 14], [8, 10, 12, 14], [4, 6, 10, 12], [-1, 0, 2, 10]], + 93: [[0, 3, 4, 6, 9, 10, 12, 14, 17, 18], + [2, 3, 4, 5, 9, 13, 15, 18, 19], + [1, 2, 3, 4, 5, 6, 7, 8, 16], + [1, 4, 6, 11, 12, 13, 15, 16, 17, 18]], + 97: [[1, 2, 4, 6, 9, 11, 13, 14, 17, 18, 21, 23, 25, 27, 29, 30], + [1, 2, 6, 7, 8, 9, 10, 11, 12, 13, 23, 27, 29], + [0, 1, 2, 5, 6, 12, 13, 15, 16, 20, 24, 25, 26, 29, 30, 31], + [0, 2, 3, 4, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 23, 28, 29]], + 103: [[1, 3, 4, 6, 8, 11, 12, 14, 17, 18, 20, 22, 25, 27, 28, 30, 32], + [2, 9, 10, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 26, 28, 29, 30], + [0, 1, 2, 3, 4, 11, 12, 13, 16, 17, 19, 20, 21, 24, 25, 26, 28, 30, 31], + [0, 1, 2, 3, 4, 5, 6, 13, 15, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 31]], + 109: [[0, 2, 5, 7, 8, 10, 12, 15, 16, 19, 20, 23, 24, 26, 29, 30, 33, 34], + [4, 5, 6, 7, 11, 15, 18, 19, 20, 22, 25, 30, 32, 33, 35], + [0, 1, 5, 6, 9, 10, 11, 14, 17, 20, 24, 26, 27, 28, 29, 31, 32], + [0, 3, 4, 6, 7, 9, 10, 12, 13, 22, 24, 25, 26, 27, 28, 29, 31, 33, 35]], + 113: [[0, 3, 4, 6, 8, 10, 13, 14], + [1, 3, 8, 9, 10, 11, 12, 13], + [0, 2, 3, 5, 6, 7, 12], + [1, 2, 3, 5, 8, 9, 15]], + 121: [[0, 2, 4, 7, 8, 11, 13, 14, 16, 19, 20, 22], + [0, 1, 4, 5, 8, 9, 10, 15, 17, 20, 23], + [1, 2, 3, 7, 9, 16, 18, 19, 20, 21, 22, 23], + [0, 2, 9, 10, 11, 12, 13, 14, 15, 17, 18, 21, 22, 23]], + 127: [[0, 3, 5, 7, 8, 10, 12, 14, 16], + [0, 1, 3, 6, 7, 9, 10, 12, 14, 15], + [0, 1, 3, 4, 5, 7, 8, 9, 15, 16], + [1, 4, 5, 6, 9, 10, 13, 14, 15, 16]], + 129: [[1, 2, 4, 7, 9, 11, 12, 14,16,18], + [0, 1, 2, 3, 9, 11, 14, 15, 19], + [0, 1, 3, 6, 8, 10, 12, 16, 18, 19], + [0, 3, 7, 8, 9, 10, 12, 14, 15, 17]], + 133: [[1, 2, 5, 6, 9, 11, 12, 14], [1, 4, 7, 9, 10, 12, 13, 15], + [0, 5, 6, 8, 11, 12, 13, 15], [0, 1, 2, 5, 7, 8, 9, 13, 14, 15]], + 145: [[1, 2, 4, 7, 9, 10, 13, 14, 16, 19, 20, 22], [0, 2, 4, 7, 10, 11, 14, 18, 19, 20, 21, 22], + [1, 3, 6, 9, 12, 13, 14, 17, 19, 20, 21, 22, 23], [2, 3, 5, 6, 7, 9, 12, 13, 15, 16, 19, 20, 21, 22, 23]], + 151: [[0, 3, 5, 6, 8, 11, 13, 14, 16, 19, 21, 23, 25, 27, 28], + [2, 3, 6, 13, 16, 17, 20, 23, 25, 26, 27, 28, 29], + [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 23, 24, 27, 28], + [1, 4, 5, 10, 11, 12, 13, 14, 16, 18, 19, 22, 25, 26, 27, 28]], + 157: [[0, 2, 5, 7, 8, 11], + [0, 4, 5, 6, 9, 11], + [6, 7, 8, 9, 10, 11], + [0, 5, 6, 7, 8, 10, 11]], + 163: [[0, 2, 5, 6, 9, 10, 13, 14, 17], + [0, 1, 7, 10, 12, 15, 16, 17], + [0, 1, 3, 5, 8, 13, 15, 16, 17], + [3, 6, 7, 8, 11, 12, 13, 14, 16, 17]], + 181: [[0, 3, 5, 6, 8, 10, 13, 15, 16, 19], + [4, 5, 7, 8, 11, 14, 15, 16, 18, 19], + [0, 4, 10, 11, 13, 15, 16, 18, 19], + [2, 4, 5, 7, 11, 13, 15, 17, 19]], + 217: [[0, 3, 5, 7, 8, 11, 12, 14], [1, 3, 4, 7, 9, 11, 12, 15], + [3, 4, 5, 6, 7, 9, 10, 14, 15], [1, 3, 4, 5, 7, 8, 11, 13, 14]], + 219: [[1, 3, 5, 6, 8, 11, 12, 15, 17, 18, 21, 22, 24], + [2, 6, 8, 10, 11, 12, 13, 16, 19, 22, 23, 24], + [0, 1, 5, 6, 10, 11, 13, 14, 17, 20, 21, 24, 25], + [0, 2, 3, 4, 5, 6, 7, 11, 12, 13, 16, 20, 23]], + 241: [[0, 2, 4, 6, 8, 11, 12, 14], + [1, 3, 4, 6, 7, 13, 14, 15], + [6, 8, 9, 10, 12, 13, 14, 15], + [3, 4, 5, 9, 10, 13, 14]], + 247: [[0, 2, 4, 7, 8, 10, 12, 15, 16, 18, 20, 23, 25, 27, 29], + [0, 2, 7, 9, 11, 12, 14, 15, 16, 18, 20, 22, 26], + [2, 3, 4, 12, 13, 14, 15, 16, 18, 20, 23, 24, 26, 27, 29], + [0, 3, 4, 6, 10, 11, 12, 14, 18, 19, 20, 22, 25, 29]], + 267: [[0, 3, 4, 7, 8, 11, 13, 15, 16, 19, 21, 22, 25], + [0, 1, 4, 5, 6, 8, 14, 15, 18, 21, 23], + [0, 2, 4, 5, 7, 9, 10, 11, 14, 15, 16, 17, 25], + [0, 1, 3, 4, 6, 14, 15, 16, 17, 18, 20, 22, 23, 25]], } + # If the element is a list, that is the coset. cosets_gens = { - 67: [1,2,3,4,5,6,8,10,12,15,17], + 37: [1, 2, 3, 5, 6, 9], + 39: [1, 2, 3, 4, 6, 8, [13]], + 43: [1, 3, 7], + 49: [1, 2, 3, 4, 6, 7, 9, 12], + 65: [1, 2, 3, 5, 6, 7, 9, 10, 11, [13], 22, [26]], + 67: [1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17], + 73: [1, 3, 5, 9, 11, 13, 17, 25], + 93: [1, 2, 3, 5, 7, 9, 10, 14, 15, [31]], + 97: [1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 15, 18, 20, 23, 26], 103: [1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 15, 17, 19, 21, 23, 30], + 109: [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 15, 16, 18, 20, 23, 25, 30], 113: [1, 2, 3, 5, 6, 9, 10, 13], + 121: [1, 2, 4, 5, 7, 8, 10, 11, 16, 17, 19, 20], 127: [1, 3, 5, 7, 9, 11, 13, 19, 21], - 151: [1, 2, 3 ,4, 5, 6, 9, 10, 11, 12, 15, 22, 27, 29, 30], + 129: [1, 3, 5, 7, 9, 11, 13, 19, 21, [43]], + 133: [1, 2, 3, 6, 7, 9, 18, [19, 38, 76]], + 145: [1, [2, 17, 32, 72, 77, 127, 137], [3, 43, 48, 98, 108, 118, 133], [6, 51, 71, 86, 91, 96, 121], + [7, 52, 82, 107, 112, 117, 132], [11, 21, 31, 46, 61, 101, 106], [14, 19, 69, 79, 89, 104, 119], + [22, 42, 57, 62, 67, 92, 122], [5, 35, 80, 100, 115, 120, 125], [10, 15, 55, 70, 85, 95, 105], + [29], [58]], + 151: [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 15, 22, 27, 29, 30], 157: [1, 2, 3, 5, 9, 15], 163: [1, 2, 3, 5, 6, 9, 10, 15, 18], 181: [1, 2, 3, 4, 6, 7, 8, 12, 13, 24], + 217: [1, 2, 4, 5, 7, 10, 19, [31, 62, 124]], + 219: [1, 2, 3, 5, 7, 9, 11, 15, 19, 22, 23, 33, [73]], 241: [1, 2, 4, 5, 7, 13, 19, 35], + 247: [1, [2, 18, 31, 32, 41, 110, 122, 162, 223], [3, 27, 48, 165, 170, 183, 185, 211, 243], + [5, 28, 45, 58, 80, 158, 187, 201, 226], [6, 54, 83, 93, 96, 119, 123, 175, 239], [7, 20, 63, 73, 112, 138, 163, 180, 232], + [10, 56, 69, 90, 116, 127, 155, 160, 205], [11, 47, 99, 102, 111, 115, 150, 176, 177], [13, 52, 65, 78, 91, 117, 143, 208, 221], + [14, 29, 40, 79, 113, 126, 146, 217, 224], [17, 25, 43, 49, 140, 142, 153, 194, 225], [19, 57, 171], + [33, 34, 37, 50, 59, 86, 98, 141, 203], [35, 66, 68, 74, 100, 118, 159, 172, 196], [38, 95, 114]], + 267: [1, 2, 3, 5, 7, 9, 10, 13, 14, 15, 19, 39, [89]], } H_db = { + 37: [1, 10, -11], + 39: [1, 16, 22], + 43: [1, 4, 11, 16, 21, -2, -8], + 49: [1, 18, 30], + 65: [1, 16, 61], 67: [1, 29, 37], + 73: [1, 2, 4, 8, 16, 32, 64, 55, 37], + 93: [1, 4, 16, 64, 70], + 97: [1, 35, 61], 103: [1, 46, 56], - 113: [1,16,28,30,49,106,109], - 127: [1,2,4,8,16,32,64], - 151: [1, 8,19,59, 64], - 157: [1,14,16,39,46,67,75,93,99,101,108,130,153], - 163: [1,38,40,53,58,85,104,133,140], - 181: [1,39,43,48,62,65,73,80,132], - 241: [1,15,24,54,87,91,94,98,100,119,160,183,205,225,231], + 109: [1, 45, 63], + 113: [1, 16, 28, 30, 49, 106, 109], + 121: [1, 3, 9, 27, 81], + 127: [1, 2, 4, 8, 16, 32, 64], + 129: [1, 4, 16, 64, 97, 121, 127], + 133: [1, 4, 16, 25, 64, 93, 100, 106, 123], + 145: [1, 16, 36, 81, 111, 136, 141], + 151: [1, 8, 19, 59, 64], + 157: [1, 14, 16, 39, 46, 67, 75, 93, 99, 101, 108, 130, 153], + 163: [1, 38, 40, 53, 58, 85, 104, 133, 140], + 181: [1, 39, 43, 48, 62, 65, 73, 80, 132], + 217: [1, 8, 9, 25, 51, 64, 72, 78, 81, 142, 190, 191, 193, 200, 214], + 219: [1, 4, 16, 37, 55, 64, 148, 154, 178], + 241: [1, 15, 24, 54, 87, 91, 94, 98, 100, 119, 160, 183, 205, 225, 231], + 247: [1, 9, 16, 55, 61, 81, 139, 144, 235], + 267: [1, 4, 16, 64, 67, 91, 97, 121, 217, 223, 256], } def generate_set(index_set, cosets): S = [] for idx in index_set: - S += cosets[idx] + if idx == -1: + S.append(Z(0)) + else: + S += cosets[idx] return S - if existence: return n in indices @@ -2073,11 +2175,11 @@ def generate_set(index_set, cosets): cosets = [] for el in cosets_gens[n]: - even_coset = [] - odd_coset = [] - for x in H: - even_coset.append(x*el) - odd_coset.append(-x*el) + if isinstance(el, list): + even_coset = [Z(x) for x in el] + else: + even_coset = [x*el for x in H] + odd_coset = [-x for x in even_coset] cosets.append(even_coset) cosets.append(odd_coset) @@ -2087,7 +2189,7 @@ def generate_set(index_set, cosets): S4 = generate_set(indices[n][3], cosets) if check: - lmbda = len(S1)+len(S2)+len(S3)+len(S4) - n + lmbda = len(S1) + len(S2) + len(S3) + len(S4) - n assert is_supplementary_difference_set([S1, S2, S3, S4], n, lmbda) assert _is_skew_set(S1, n) diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 6be4e0e2683..29671fb28ed 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -4887,7 +4887,7 @@ def key_function(s): return (s.from_state, s.to_state) # We use an OrderedDict instead of a dict in order to have a # defined ordering of the transitions in the output. See - # http://trac.sagemath.org/ticket/16580#comment:3 . As the + # https://github.com/sagemath/sage/issues/16580#comment:3 . As the # transitions have to be sorted anyway, the performance # penalty should be bearable; nevertheless, this is only # required for doctests. diff --git a/src/sage/combinat/free_module.py b/src/sage/combinat/free_module.py index 1bfb7f6072e..0d59caabd55 100644 --- a/src/sage/combinat/free_module.py +++ b/src/sage/combinat/free_module.py @@ -259,7 +259,7 @@ class CombinatorialFreeModule(UniqueRepresentation, Module, IndexedGenerators): sage: XQ == XQ True - We check that ticket :trac:`28681` is fixed:: + We check that issue :trac:`28681` is fixed:: sage: F = CombinatorialFreeModule(ZZ, ZZ); F.rename("F") sage: FF = tensor((F,F)) diff --git a/src/sage/combinat/k_regular_sequence.py b/src/sage/combinat/k_regular_sequence.py index 95a9283f7f0..50ae558aaad 100644 --- a/src/sage/combinat/k_regular_sequence.py +++ b/src/sage/combinat/k_regular_sequence.py @@ -18,7 +18,7 @@ doctest:...: FutureWarning: This class/method/function is marked as experimental. It, its functionality or its interface might change without a formal deprecation. - See http://trac.sagemath.org/21202 for details. + See https://github.com/sagemath/sage/issues/21202 for details. Examples diff --git a/src/sage/combinat/matrices/hadamard_matrix.py b/src/sage/combinat/matrices/hadamard_matrix.py index d5fb2b29648..1fa92388214 100644 --- a/src/sage/combinat/matrices/hadamard_matrix.py +++ b/src/sage/combinat/matrices/hadamard_matrix.py @@ -46,54 +46,76 @@ - [Hora]_ """ -#***************************************************************************** +# ***************************************************************************** # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# ***************************************************************************** from math import sqrt from urllib.request import urlopen from sage.arith.misc import divisors, is_prime_power, is_square -from sage.combinat.designs.difference_family import skew_supplementary_difference_set +from sage.combinat.designs.difference_family import (get_fixed_relative_difference_set, + relative_difference_set_from_homomorphism, + skew_supplementary_difference_set) from sage.combinat.t_sequences import T_sequences_smallcases from sage.cpython.string import bytes_to_str from sage.rings.integer_ring import ZZ +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.matrix.constructor import (block_matrix, block_diagonal_matrix, diagonal_matrix, identity_matrix as I, ones_matrix as J, matrix, + matrix_method, zero_matrix) from sage.misc.unknown import Unknown from sage.modules.free_module_element import vector -def normalise_hadamard(H): +def normalise_hadamard(H, skew=False): r""" Return the normalised Hadamard matrix corresponding to ``H``. The normalised Hadamard matrix corresponding to a Hadamard matrix `H` is a matrix whose every entry in the first row and column is +1. + If ``skew`` is True, the matrix returned will be skew-normal: a skew Hadamard + matrix with first row of all `+1`. + EXAMPLES:: - sage: from sage.combinat.matrices.hadamard_matrix import normalise_hadamard + sage: from sage.combinat.matrices.hadamard_matrix import normalise_hadamard, is_hadamard_matrix, skew_hadamard_matrix sage: H = normalise_hadamard(hadamard_matrix(4)) sage: H == hadamard_matrix(4) True + sage: H = normalise_hadamard(skew_hadamard_matrix(20, skew_normalize=False), skew=True) + sage: is_hadamard_matrix(H, skew=True, normalized=True) + True + + If ``skew`` is True but the Hadamard matrix is not skew, the matrix returned + will not be normalized:: + + sage: H = normalise_hadamard(hadamard_matrix(92), skew=True) + sage: is_hadamard_matrix(H, normalized=True) + False """ - for i in range(H.ncols()): - if H[0, i] < 0: - H.rescale_col(i, -1) - for i in range(H.nrows()): - if H[i, 0] < 0: - H.rescale_row(i, -1) - return H + + if skew: + dd = diagonal_matrix(H[0]) + return dd*H*dd + else: + for i in range(H.ncols()): + if H[0, i] < 0: + H.rescale_col(i, -1) + for i in range(H.nrows()): + if H[i, 0] < 0: + H.rescale_row(i, -1) + return H def hadamard_matrix_paleyI(n, normalize=True): @@ -143,22 +165,22 @@ def hadamard_matrix_paleyI(n, normalize=True): True """ p = n - 1 - if not(is_prime_power(p) and (p % 4 == 3)): + if not (is_prime_power(p) and (p % 4 == 3)): raise ValueError("The order %s is not covered by the Paley type I construction." % n) from sage.rings.finite_rings.finite_field_constructor import FiniteField - K = FiniteField(p,'x') + K = FiniteField(p, 'x') K_list = list(K) - K_list.insert(0,K.zero()) + K_list.insert(0, K.zero()) H = matrix(ZZ, [[(1 if (x-y).is_square() else -1) for x in K_list] for y in K_list]) for i in range(n): - H[i,0] = -1 - H[0,i] = 1 + H[i, 0] = -1 + H[0, i] = 1 if normalize: for i in range(n): - H[i,i] = -1 + H[i, i] = -1 H = normalise_hadamard(H) return H @@ -207,29 +229,30 @@ def hadamard_matrix_paleyII(n): True """ q = n//2 - 1 - if not(n%2==0 and is_prime_power(q) and (q % 4 == 1)): + if not (n % 2 == 0 and is_prime_power(q) and (q % 4 == 1)): raise ValueError("The order %s is not covered by the Paley type II construction." % n) from sage.rings.finite_rings.finite_field_constructor import FiniteField - K = FiniteField(q,'x') + K = FiniteField(q, 'x') K_list = list(K) - K_list.insert(0,K.zero()) + K_list.insert(0, K.zero()) H = matrix(ZZ, [[(1 if (x-y).is_square() else -1) for x in K_list] for y in K_list]) for i in range(q+1): - H[0,i] = 1 - H[i,0] = 1 - H[i,i] = 0 + H[0, i] = 1 + H[i, 0] = 1 + H[i, i] = 0 - tr = { 0: matrix(2,2,[ 1,-1,-1,-1]), - 1: matrix(2,2,[ 1, 1, 1,-1]), - -1: matrix(2,2,[-1,-1,-1, 1])} + tr = { 0: matrix(2, 2, [ 1, -1, -1, -1]), + 1: matrix(2, 2, [ 1, 1, 1, -1]), + -1: matrix(2, 2, [-1, -1, -1, 1])} - H = block_matrix(q+1,q+1,[tr[v] for r in H for v in r]) + H = block_matrix(q+1, q+1, [tr[v] for r in H for v in r]) return normalise_hadamard(H) + def hadamard_matrix_williamson_type(a, b, c, d, check=True): r""" Construction of Williamson type Hadamard matrix. @@ -283,16 +306,17 @@ def hadamard_matrix_williamson_type(a, b, c, d, check=True): n = len(a) assert len(a) == len(b) == len(c) == len(d) - assert A*A.T+B*B.T+C*C.T+D*D.T==4*n*I(n) + assert A*A.T+B*B.T+C*C.T+D*D.T == 4*n*I(n) M = block_matrix([[ A, B, C, D], [-B, A, -D, C], [-C, D, A, -B], - [-D, -C, B, A]]) + [-D, -C, B, A]]) if check: assert is_hadamard_matrix(M, normalized=False, skew=False) return M + def williamson_type_quadruples_smallcases(n, existence=False): r""" Quadruples of matrices that can be used to construct Williamson type Hadamard matrices. @@ -345,14 +369,14 @@ def williamson_type_quadruples_smallcases(n, existence=False): [1, -1, -1, 1, -1, -1, 1, -1, -1], [1, -1, 1, -1, -1, -1, -1, 1, -1], [1, 1, -1, -1, -1, -1, -1, -1, 1]), - 29: ([1, 1, 1,-1,-1,-1, 1, 1,-1,-1, 1,-1, 1,-1,-1,-1,-1, 1,-1, 1,-1,-1, 1, 1,-1,-1,-1, 1, 1], - [1,-1, 1,-1,-1,-1, 1, 1,-1,-1, 1,-1, 1, 1, 1, 1, 1, 1,-1, 1,-1,-1, 1, 1,-1,-1,-1, 1,-1], - [1, 1, 1, 1,-1, 1, 1,-1, 1,-1,-1,-1, 1, 1, 1, 1, 1, 1,-1,-1,-1, 1,-1, 1, 1,-1, 1, 1, 1], - [1, 1,-1,-1, 1,-1,-1, 1,-1, 1, 1, 1,-1, 1, 1, 1, 1,-1, 1, 1, 1,-1, 1,-1,-1, 1,-1,-1, 1]), + 29: ([1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1], + [1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1], + [1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1], + [1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1]), 43: ([1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1], - [1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1], - [1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1], - [1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), + [1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1], + [1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1], + [1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), } if existence: @@ -363,6 +387,7 @@ def williamson_type_quadruples_smallcases(n, existence=False): a, b, c, d = map(vector, db[n]) return a, b, c, d + def williamson_hadamard_matrix_smallcases(n, existence=False, check=True): r""" Construct Williamson type Hadamard matrices for some small values of n. @@ -392,9 +417,9 @@ def williamson_hadamard_matrix_smallcases(n, existence=False, check=True): ... ValueError: The Williamson type Hadamard matrix of order 100 is not yet implemented. """ - assert n%4 == 0 + assert n % 4 == 0 - if not williamson_type_quadruples_smallcases(n//4, existence=True): + if not williamson_type_quadruples_smallcases(n//4, existence=True): if existence: return False raise ValueError("The Williamson type Hadamard matrix of order %s is not yet implemented." % n) @@ -422,25 +447,26 @@ def hadamard_matrix_156(): sage: hadamard_matrix_156() 156 x 156 dense matrix over Integer Ring... """ - a = [1, 1,-1,-1, 1,-1, 1, 1,-1, 1,-1,-1, 1] - b = [1,-1,-1,-1, 1, 1, 1, 1, 1, 1,-1,-1,-1] - c = [1, 1, 1,-1, 1, 1,-1,-1, 1, 1,-1, 1, 1] - d = [1, 1,-1, 1,-1, 1, 1, 1, 1,-1, 1,-1, 1] + a = [1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1] + b = [1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1] + c = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1] + d = [1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1] A, B, C, D = map(matrix.circulant, [a, b, c, d]) - return block_matrix([[ A, A, A, B,-B, C,-C,-D, B, C,-D,-D], - [ A,-A, B,-A,-B,-D, D,-C,-B,-D,-C,-C], - [ A,-B,-A, A,-D, D,-B, B,-C,-D, C,-C], - [ B, A,-A,-A, D, D, D, C, C,-B,-B,-C], - [ B,-D, D, D, A, A, A, C,-C, B,-C, B], - [ B, C,-D, D, A,-A, C,-A,-D, C, B,-B], - [ D,-C, B,-B, A,-C,-A, A, B, C, D,-D], - [-C,-D,-C,-D, C, A,-A,-A,-D, B,-B,-B], - [ D,-C,-B,-B,-B, C, C,-D, A, A, A, D], - [-D,-B, C, C, C, B, B,-D, A,-A, D,-A], - [ C,-B,-C, C, D,-B,-D,-B, A,-D,-A, A], - [-C,-D,-D, C,-C,-B, B, B, D, A,-A,-A]]) + return block_matrix([[ A, A, A, B, -B, C, -C, -D, B, C, -D, -D], + [ A, -A, B, -A, -B, -D, D, -C, -B, -D, -C, -C], + [ A, -B, -A, A, -D, D, -B, B, -C, -D, C, -C], + [ B, A, -A, -A, D, D, D, C, C, -B, -B, -C], + [ B, -D, D, D, A, A, A, C, -C, B, -C, B], + [ B, C, -D, D, A, -A, C, -A, -D, C, B, -B], + [ D, -C, B, -B, A, -C, -A, A, B, C, D, -D], + [-C, -D, -C, -D, C, A, -A, -A, -D, B, -B, -B], + [ D, -C, -B, -B, -B, C, C, -D, A, A, A, D], + [-D, -B, C, C, C, B, B, -D, A, -A, D, -A], + [ C, -B, -C, C, D, -B, -D, -B, A, -D, -A, A], + [-C, -D, -D, C, -C, -B, B, B, D, A, -A, -A]]) + def construction_four_symbol_delta_code_I(X, Y, Z, W): r""" @@ -503,7 +529,8 @@ def construction_four_symbol_delta_code_I(X, Y, Z, W): n = len(X) assert len(Y) == n and len(Z) == n-1 and len(W) == n-1 - autocorrelation = lambda seq, j: sum([seq[i]*seq[i+j] for i in range(len(seq)-j)]) + def autocorrelation(seq, j): + return sum([seq[i]*seq[i+j] for i in range(len(seq)-j)]) for j in range(1, n): assert sum(map(lambda seq: autocorrelation(seq, j), [X, Y, Z, W])) == 0 @@ -580,12 +607,14 @@ def construction_four_symbol_delta_code_II(X, Y, Z, W): n = len(Z) assert len(X) == n+1 and len(Y) == n+1 and len(W) == n - autocorrelation = lambda seq, j: sum([seq[i]*seq[i+j] for i in range(len(seq)-j)]) + def autocorrelation(seq, j): + return sum([seq[i]*seq[i+j] for i in range(len(seq)-j)]) + for j in range(1, n): assert sum(map(lambda seq: autocorrelation(seq, j), [X, Y, Z, W])) == 0 def alternate(seq1, seq2): - return [seq1[i//2] if i%2 == 0 else seq2[(i-1)//2] for i in range(len(seq1)+len(seq2))] + return [seq1[i//2] if i % 2 == 0 else seq2[(i-1)//2] for i in range(len(seq1)+len(seq2))] XaltZ = alternate(X, Z) Wneg = [-w for w in W] @@ -597,6 +626,7 @@ def alternate(seq1, seq2): T4 = XaltZ + alternate(Yneg, W) + [-1] return T1, T2, T3, T4 + def four_symbol_delta_code_smallcases(n, existence=False): r""" Return the 4-symobl `\delta` code of length `n` if available. @@ -631,18 +661,18 @@ def four_symbol_delta_code_smallcases(n, existence=False): db = { 1: ([1, -1], [1, 1], [1], [1]), 14: ([1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1], - [1, 1, 1,-1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1], - [1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1], - [1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1]) + [1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1], + [1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1], + [1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1]) } T1, T2, T3, T4 = None, None, None, None - if n%2 == 1 and (n-1)//2 in db: + if n % 2 == 1 and (n-1)//2 in db: if existence: return True X, Y, Z, W = db[(n-1)//2] T1, T2, T3, T4 = construction_four_symbol_delta_code_I(X, Y, Z, W) - elif n%4 == 3 and (n-3)//4 in db: + elif n % 4 == 3 and (n-3) // 4 in db: if existence: return True X, Y, Z, W = db[(n-3)//4] @@ -656,7 +686,8 @@ def four_symbol_delta_code_smallcases(n, existence=False): return T1, T2, T3, T4 -def _construction_goethals_seidel_matrix(A, B ,C, D): + +def _construction_goethals_seidel_matrix(A, B, C, D): r""" Construct the Goethals Seidel matrix. @@ -706,12 +737,13 @@ def _construction_goethals_seidel_matrix(A, B ,C, D): [-1 1| 1 -1| 1 -1| 1 1] """ n = len(A[0]) - R = matrix(ZZ, n, n, lambda i,j: 1 if i+j==n-1 else 0) + R = matrix(ZZ, n, n, lambda i, j: 1 if i+j == n-1 else 0) return block_matrix([[ A, B*R, C*R, D*R], [-B*R, A, -D.T*R, C.T*R], [-C*R, D.T*R, A, -B.T*R], [-D*R, -C.T*R, B.T*R, A]]) + def hadamard_matrix_cooper_wallis_construction(x1, x2, x3, x4, A, B, C, D, check=True): r""" Create an Hadamard matrix using the contruction detailed in [CW1972]_. @@ -800,6 +832,7 @@ def hadamard_matrix_cooper_wallis_construction(x1, x2, x3, x4, A, B, C, D, check assert is_hadamard_matrix(H) return H + def hadamard_matrix_cooper_wallis_smallcases(n, check=True, existence=False): r""" Construct Hadamard matrices using the Cooper-Wallis construction for some small values of `n`. @@ -859,7 +892,7 @@ def hadamard_matrix_cooper_wallis_smallcases(n, check=True, existence=False): ... AssertionError """ - assert n%4 == 0 and n > 0 + assert n % 4 == 0 and n > 0 db = { 67: ( @@ -871,7 +904,7 @@ def hadamard_matrix_cooper_wallis_smallcases(n, check=True, existence=False): } for T_seq_len in divisors(n//4): - will_size = n//(4* T_seq_len) + will_size = n // (4*T_seq_len) if (T_seq_len in db or T_sequences_smallcases(T_seq_len, existence=True)) and williamson_type_quadruples_smallcases(will_size, existence=True): if existence: return True @@ -894,6 +927,7 @@ def hadamard_matrix_cooper_wallis_smallcases(n, check=True, existence=False): return False raise ValueError("The Cooper-Wallis construction for Hadamard matrices of order %s is not yet implemented." % n) + def _get_baumert_hall_units(n, existence=False): r""" Construct Baumert-Hall units of size `n` from available 4-symbol `\delta` codes. @@ -938,8 +972,7 @@ def _get_baumert_hall_units(n, existence=False): ... ValueError: The Baumert-Hall units of size 200 have not yet been implemented """ - assert n%4 == 0 and n > 0 - + assert n % 4 == 0 and n > 0 delta_codes_len = n//4 if not four_symbol_delta_code_smallcases(delta_codes_len, existence=True): @@ -967,6 +1000,7 @@ def _get_baumert_hall_units(n, existence=False): e4 = _construction_goethals_seidel_matrix(M4hat, M3hat, -M2hat, M1hat) return e1, e2, e3, e4 + def hadamard_matrix_turyn_type(a, b, c, d, e1, e2, e3, e4, check=True): r""" Construction of Turyn type Hadamard matrix. @@ -1022,11 +1056,11 @@ def hadamard_matrix_turyn_type(a, b, c, d, e1, e2, e3, e4, check=True): n = len(a) assert len(a) == len(b) == len(c) == len(d) - assert A*A.T+B*B.T+C*C.T+D*D.T==4*n*I(n) + assert A*A.T+B*B.T+C*C.T+D*D.T == 4*n*I(n) t4 = len(e1[0]) - assert t4 %4 == 0 - t = t4//4 + assert t4 % 4 == 0 + t = t4 // 4 # Check that e1, e2, e3, e4 are valid Baumert-Hall units for i in range(t4): @@ -1040,12 +1074,12 @@ def hadamard_matrix_turyn_type(a, b, c, d, e1, e2, e3, e4, check=True): for j in range(i+1, len(units)): assert units[i]*units[j].T + units[j]*units[i].T == 0*I(t4) - H = e1.tensor_product(A) + e2.tensor_product(B) + e3.tensor_product(C) + e4.tensor_product(D) if check: assert is_hadamard_matrix(H) return H + def turyn_type_hadamard_matrix_smallcases(n, existence=False, check=True): r""" Construct an Hadamard matrix of order `n` from available 4-symbol `\delta` codes and Williamson quadruples. @@ -1061,7 +1095,7 @@ def turyn_type_hadamard_matrix_smallcases(n, existence=False, check=True): - ``existence`` -- boolean (default False): if True, only check if matrix exists. - - ``check`` -- bolean: if True (default), check the the matrix is an Hadamard matrix before returning. + - ``check`` -- boolean: if True (default), check the the matrix is an Hadamard matrix before returning. EXAMPLES:: @@ -1083,7 +1117,7 @@ def turyn_type_hadamard_matrix_smallcases(n, existence=False, check=True): ... ValueError: The Turyn type construction for Hadamard matrices of order 64 is not yet implemented. """ - assert n%4 == 0 and n > 0 + assert n % 4 == 0 and n > 0 for delta_code_len in divisors(n//4): units_size = delta_code_len*4 @@ -1100,6 +1134,7 @@ def turyn_type_hadamard_matrix_smallcases(n, existence=False, check=True): return False raise ValueError("The Turyn type construction for Hadamard matrices of order %s is not yet implemented." % n) + def hadamard_matrix_spence_construction(n, existence=False, check=True): r"""Create an Hadamard matrix of order `n` using Spence construction. @@ -1153,7 +1188,7 @@ def hadamard_matrix_spence_construction(n, existence=False, check=True): """ from sage.combinat.designs.difference_family import supplementary_difference_set - assert n%4 == 0 and n > 0 + assert n % 4 == 0 and n > 0 q = n//4 @@ -1170,7 +1205,7 @@ def hadamard_matrix_spence_construction(n, existence=False, check=True): A3 = matrix.circulant([1 if j in S3 else -1 for j in range(q-1)]) A4 = matrix.circulant([1 if j in S2 else -1 for j in range(q-1)]) - P = matrix(ZZ, [[1 if (i + j)%(q-1) == 0 else 0 for i in range(1, q)] for j in range(1, q)]) + P = matrix(ZZ, [[1 if (i + j) % (q-1) == 0 else 0 for i in range(1, q)] for j in range(1, q)]) e = matrix([1]*(q-1)) m1 = matrix([-1]) @@ -1188,6 +1223,7 @@ def hadamard_matrix_spence_construction(n, existence=False, check=True): return H + def is_hadamard_matrix(M, normalized=False, skew=False, verbose=False): r""" Test if `M` is a Hadamard matrix. @@ -1246,6 +1282,14 @@ def is_hadamard_matrix(M, normalized=False, skew=False, verbose=False): False sage: is_hadamard_matrix(h, skew=False, verbose=True) True + sage: h = skew_hadamard_matrix(20, skew_normalize=False) + sage: is_hadamard_matrix(h, skew=True, normalized=True, verbose=True) + The matrix is not skew-normalized + False + sage: from sage.combinat.matrices.hadamard_matrix import normalise_hadamard + sage: h = normalise_hadamard(h, skew=True) + sage: is_hadamard_matrix(h, skew=True, normalized=True, verbose=True) + True """ n = M.ncols() if n != M.nrows(): @@ -1264,16 +1308,17 @@ def is_hadamard_matrix(M, normalized=False, skew=False, verbose=False): return False prod = (M*M.transpose()).dict() - if (len(prod) != n or - set(prod.values()) != {n} or - any((i, i) not in prod for i in range(n))): + if (len(prod) != n or set(prod.values()) != {n} or any((i, i) not in prod for i in range(n))): if verbose: print("The product M*M.transpose() is not equal to nI") return False if normalized: - if (set(M.row(0) ) != {1} or - set(M.column(0)) != {1}): + if skew and (set(M.row(0)) != {1}): + if verbose: + print("The matrix is not skew-normalized") + return False + elif not skew and (set(M.row(0)) != {1} or set(M.column(0)) != {1}): if verbose: print("The matrix is not normalized") return False @@ -1281,20 +1326,54 @@ def is_hadamard_matrix(M, normalized=False, skew=False, verbose=False): if skew: for i in range(n-1): for j in range(i+1, n): - if M[i,j] != -M[j,i]: + if M[i, j] != -M[j, i]: if verbose: print("The matrix is not skew") return False for i in range(n): - if M[i,i] != 1: + if M[i, i] != 1: if verbose: print("The matrix is not skew - diagonal entries must be all 1") return False return True -from sage.matrix.constructor import matrix_method + +def is_skew_hadamard_matrix(M, normalized=False, verbose=False): + r""" + Test if `M` is a skew Hadamard matrix. + + this is a wrapper around the function :func:`is_hadamard_matrix` + + INPUT: + + - ``M`` -- a matrix + + - ``normalized`` (boolean) -- whether to test if ``M`` is a skew-normalized + Hadamard matrix, i.e. has its first row filled with +1. + + - ``verbose`` (boolean) -- whether to be verbose when the matrix is not + skew Hadamard. + + EXAMPLES:: + + sage: from sage.combinat.matrices.hadamard_matrix import is_skew_hadamard_matrix, skew_hadamard_matrix + sage: h = matrix.hadamard(12) + sage: is_skew_hadamard_matrix(h, verbose=True) + The matrix is not skew + False + sage: h = skew_hadamard_matrix(12) + sage: is_skew_hadamard_matrix(h) + True + sage: from sage.combinat.matrices.hadamard_matrix import normalise_hadamard + sage: h = normalise_hadamard(skew_hadamard_matrix(12), skew=True) + sage: is_skew_hadamard_matrix(h, verbose=True, normalized=True) + True + """ + return is_hadamard_matrix(M, skew=True, normalized=normalized, verbose=verbose) + + @matrix_method -def hadamard_matrix(n,existence=False, check=True): +def hadamard_matrix(n, existence=False, check=True): r""" Tries to construct a Hadamard matrix using the available methods. @@ -1382,7 +1461,7 @@ def hadamard_matrix(n,existence=False, check=True): sage: matrix.hadamard(324, existence=True) True """ - if not(n % 4 == 0) and (n > 2): + if not (n % 4 == 0) and (n > 2): if existence: return False raise ValueError("The Hadamard matrix of order %s does not exist" % n) @@ -1398,10 +1477,10 @@ def hadamard_matrix(n,existence=False, check=True): if existence: return True M = hadamard_matrix_paleyII(n) - elif n == 4 or n % 8 == 0 and hadamard_matrix(n//2,existence=True) is True: + elif n == 4 or n % 8 == 0 and hadamard_matrix(n//2, existence=True) is True: if existence: return True - had = hadamard_matrix(n//2,check=False) + had = hadamard_matrix(n//2, check=False) chad1 = matrix([list(r) + list(r) for r in had.rows()]) mhad = (-1) * had R = len(had.rows()) @@ -1428,7 +1507,7 @@ def hadamard_matrix(n,existence=False, check=True): if existence: return True M = turyn_type_hadamard_matrix_smallcases(n, check=False) - elif hadamard_matrix_spence_construction(n ,existence=True): + elif hadamard_matrix_spence_construction(n, existence=True): if existence: return True M = hadamard_matrix_spence_construction(n, check=False) @@ -1507,7 +1586,7 @@ def hadamard_matrix_www(url_file, comments=False): _rshcd_cache = {} -def regular_symmetric_hadamard_matrix_with_constant_diagonal(n,e,existence=False): +def regular_symmetric_hadamard_matrix_with_constant_diagonal(n, e, existence=False): r""" Return a Regular Symmetric Hadamard Matrix with Constant Diagonal. @@ -1576,13 +1655,13 @@ def regular_symmetric_hadamard_matrix_with_constant_diagonal(n,e,existence=False - [HX2010]_ """ - if existence and (n,e) in _rshcd_cache: - return _rshcd_cache[n,e] + if existence and (n, e) in _rshcd_cache: + return _rshcd_cache[n, e] from sage.graphs.strongly_regular_db import strongly_regular_graph def true(): - _rshcd_cache[n,e] = True + _rshcd_cache[n, e] = True return True M = None @@ -1591,7 +1670,7 @@ def true(): sqn = None if is_square(n): sqn = int(sqrt(n)) - if n<0: + if n < 0: if existence: return False raise ValueError @@ -1599,31 +1678,31 @@ def true(): if existence: return true() if e == 1: - M = J(4)-2*matrix(4,[[int(i+j == 3) for i in range(4)] for j in range(4)]) + M = J(4)-2*matrix(4, [[int(i+j == 3) for i in range(4)] for j in range(4)]) else: M = -J(4)+2*I(4) - elif n == 36: + elif n == 36: if existence: return true() if e == 1: M = strongly_regular_graph(36, 15, 6, 6).adjacency_matrix() M = J(36) - 2*M else: - M = strongly_regular_graph(36,14,4,6).adjacency_matrix() - M = -J(36) + 2*M + 2*I(36) + M = strongly_regular_graph(36, 14, 4, 6).adjacency_matrix() + M = -J(36) + 2*M + 2*I(36) elif n == 100: if existence: return true() if e == -1: - M = strongly_regular_graph(100,44,18,20).adjacency_matrix() + M = strongly_regular_graph(100, 44, 18, 20).adjacency_matrix() M = 2*M - J(100) + 2*I(100) else: - M = strongly_regular_graph(100,45,20,20).adjacency_matrix() + M = strongly_regular_graph(100, 45, 20, 20).adjacency_matrix() M = J(100) - 2*M elif n == 196 and e == 1: if existence: return true() - M = strongly_regular_graph(196,91,42,42).adjacency_matrix() + M = strongly_regular_graph(196, 91, 42, 42).adjacency_matrix() M = J(196) - 2*M elif n == 324: if existence: @@ -1641,7 +1720,7 @@ def true(): elif (e == 1 and sqn is not None and sqn % 4 == 2 and - strongly_regular_graph(sqn-1,(sqn-2)//2,(sqn-6)//4, + strongly_regular_graph(sqn-1, (sqn-2)//2, (sqn-6)//4, existence=True) is True and is_prime_power(ZZ(sqn + 1))): if existence: @@ -1651,30 +1730,31 @@ def true(): # Recursive construction: the Kronecker product of two RSHCD is a RSHCD else: from itertools import product - for n1,e1 in product(divisors(n)[1:-1],[-1,1]): + for n1, e1 in product(divisors(n)[1:-1], [-1, 1]): e2 = e1*e n2 = n//n1 - if (regular_symmetric_hadamard_matrix_with_constant_diagonal(n1,e1,existence=True) is True and - regular_symmetric_hadamard_matrix_with_constant_diagonal(n2,e2,existence=True)) is True: + if (regular_symmetric_hadamard_matrix_with_constant_diagonal(n1, e1, existence=True) is True and + regular_symmetric_hadamard_matrix_with_constant_diagonal(n2, e2, existence=True)) is True: if existence: return true() - M1 = regular_symmetric_hadamard_matrix_with_constant_diagonal(n1,e1) - M2 = regular_symmetric_hadamard_matrix_with_constant_diagonal(n2,e2) - M = M1.tensor_product(M2) + M1 = regular_symmetric_hadamard_matrix_with_constant_diagonal(n1, e1) + M2 = regular_symmetric_hadamard_matrix_with_constant_diagonal(n2, e2) + M = M1.tensor_product(M2) break if M is None: from sage.misc.unknown import Unknown - _rshcd_cache[n,e] = Unknown + _rshcd_cache[n, e] = Unknown if existence: return Unknown - raise ValueError("I do not know how to build a {}-RSHCD".format((n,e))) + raise ValueError("I do not know how to build a {}-RSHCD".format((n, e))) assert M*M.transpose() == n*I(n) - assert set(map(sum,M)) == {ZZ(e*sqn)} + assert set(map(sum, M)) == {ZZ(e*sqn)} return M + def RSHCD_324(e): r""" Return a size 324x324 Regular Symmetric Hadamard Matrix with Constant Diagonal. @@ -1720,15 +1800,16 @@ def RSHCD_324(e): from sage.graphs.generators.smallgraphs import JankoKharaghaniTonchevGraph as JKTG M = JKTG().adjacency_matrix() M = J(324) - 2*M - if e==-1: - M1=M[:162].T - M2=M[162:].T - M11=M1[:162] - M12=M1[162:].T - M21=M2[:162].T - M=block_matrix([[M12,-M11],[-M11.T,M21]]) + if e == -1: + M1 = M[:162].T + M2 = M[162:].T + M11 = M1[:162] + M12 = M1[162:].T + M21 = M2[:162].T + M = block_matrix([[M12, -M11], [-M11.T, M21]]) return M + def _helper_payley_matrix(n, zero_position=True): r""" Return the matrix constructed in Lemma 1.19 page 291 of [SWW1972]_. @@ -1855,23 +1936,23 @@ def rshcd_from_close_prime_powers(n): - [SWW1972]_ """ - if n%4: + if n % 4: raise ValueError("n(={}) must be congruent to 0 mod 4") - a,b = sorted([n-1,n+1],key=lambda x:-x%4) - Sa = _helper_payley_matrix(a) - Sb = _helper_payley_matrix(b) - U = matrix(a,[[int(i+j == a-1) for i in range(a)] for j in range(a)]) + a, b = sorted([n-1, n+1], key=lambda x: -x % 4) + Sa = _helper_payley_matrix(a) + Sb = _helper_payley_matrix(b) + U = matrix(a, [[int(i+j == a-1) for i in range(a)] for j in range(a)]) K = (U*Sa).tensor_product(Sb) + U.tensor_product(J(b)-I(b)) - J(a).tensor_product(I(b)) - F = lambda x:diagonal_matrix([-(-1)**i for i in range(x)]) - G = block_diagonal_matrix([J(1),I(a).tensor_product(F(b))]) - e = matrix(a*b,[1]*(a*b)) - H = block_matrix(2,[-J(1),e.transpose(),e,K]) + F = lambda x: diagonal_matrix([-(-1)**i for i in range(x)]) + G = block_diagonal_matrix([J(1), I(a).tensor_product(F(b))]) + e = matrix(a*b, [1]*(a*b)) + H = block_matrix(2, [-J(1), e.transpose(), e, K]) HH = G*H*G - assert len(set(map(sum,HH))) == 1 + assert len(set(map(sum, HH))) == 1 assert HH**2 == n**2*I(n**2) return HH @@ -1912,16 +1993,103 @@ def williamson_goethals_seidel_skew_hadamard_matrix(a, b, c, d, check=True): - [KoSt08]_ """ n = len(a) - A,B,C,D=map(matrix.circulant, [a,b,c,d]) + A, B, C, D = map(matrix.circulant, [a, b, c, d]) if check: - assert A*A.T+B*B.T+C*C.T+D*D.T==4*n*I(n) - assert A+A.T==2*I(n) + assert A*A.T+B*B.T+C*C.T+D*D.T == 4*n*I(n) + assert A+A.T == 2*I(n) M = _construction_goethals_seidel_matrix(A, B, C, D) if check: assert is_hadamard_matrix(M, normalized=False, skew=True) return M + +def skew_hadamard_matrix_spence_construction(n, check=True): + r""" + Construct skew Hadamard matrix of order `n` using Spence constrution. + + This function will construct skew Hadamard matrix of order `n=2(q+1)` where `q` is + a prime power with `q = 5` (mod 8). The construction is taken from [Spe1977]_, and the + relative difference sets are constructed using :func:`sage.combinat.designs.difference_family.relative_difference_set_from_homomorphism`. + + INPUT: + + - ``n`` -- A positive integer. + + - ``check`` -- boolean. If true (default), check that the resulting matrix is Hadamard + before returning it. + + OUTPUT: + + If `n` satisfies the requirements described above, the function returns a `n\times n` Hadamard matrix. + Otherwise, an exception is raised. + + EXAMPLES:: + + sage: from sage.combinat.matrices.hadamard_matrix import skew_hadamard_matrix_spence_construction + sage: skew_hadamard_matrix_spence_construction(28) + 28 x 28 dense matrix over Integer Ring... + + TESTS:: + + sage: from sage.combinat.matrices.hadamard_matrix import is_hadamard_matrix + sage: is_hadamard_matrix(skew_hadamard_matrix_spence_construction(12, check=False), skew=True) + True + sage: is_hadamard_matrix(skew_hadamard_matrix_spence_construction(60, check=False), skew=True) + True + sage: skew_hadamard_matrix_spence_construction(31) + Traceback (most recent call last): + ... + ValueError: The order 31 is not covered by the Spence construction. + sage: skew_hadamard_matrix_spence_construction(16) + Traceback (most recent call last): + ... + ValueError: The order 16 is not covered by the Spence construction. + """ + q = n//2 - 1 + m = (q+1)//2 + if n % 4 != 0 or not is_prime_power(q) or q % 8 != 5: + raise ValueError(f'The order {n} is not covered by the Spence construction.') + + D = relative_difference_set_from_homomorphism(q, 2, (q-1)//4, check=False) + D_fixed = get_fixed_relative_difference_set(D) + D_union = D_fixed + [q+1+el for el in D_fixed] + D_union = list(set([el % (4*(q+1)) for el in D_union])) + + def find_a(i): + for a in range(8): + if (a*(q+1)//2+i) % 8 == 0: + return a + + ai = [find_a(0), find_a(1), find_a(2), find_a(3)] + P = PolynomialRing(ZZ, 'x') + + Tm = 0 + for i in range(m): + Tm += P.monomial(i) + + Ds = [[] for i in range(4)] + + for el in D_union: + i = el % 8 + if i > 3: + continue + Ds[i].append(((el + ai[i] * m) // 8) % m) + + psis = [0 for i in range(4)] + for i in range(4): + for el in Ds[i]: + psis[i] += P.monomial(el) + + diffs = [(2*psis[i] - Tm).mod(P.monomial(m)-1) for i in range(4)] + a = [-el for el in diffs[1].coefficients()] + b = diffs[0].coefficients() + c = diffs[2].coefficients() + d = diffs[3].coefficients() + + return williamson_goethals_seidel_skew_hadamard_matrix(a, b, c, d, check=check) + + def GS_skew_hadamard_smallcases(n, existence=False, check=True): r""" Data for Williamson-Goethals-Seidel construction of skew Hadamard matrices @@ -1929,12 +2097,17 @@ def GS_skew_hadamard_smallcases(n, existence=False, check=True): Here we keep the data for this construction. Namely, it needs 4 circulant matrices with extra properties, as described in :func:`sage.combinat.matrices.hadamard_matrix.williamson_goethals_seidel_skew_hadamard_matrix` - Matrices for `n=36` and `52` are given in [GS70s]_. Matrices for `n=92` are given - in [Wall71]_. + Matrices are taken from: + + * `n=36, 52`: [GS70s]_ + * `n=92`: [Wall71]_ + * `n=188`: [Djo2008a]_ + * `n=236`: [FKS2004]_ + * `n=276`: [Djo2023a]_ Additional data is obtained from skew supplementary difference sets contained in :func:`sage.combinat.designs.difference_family.skew_supplementary_difference_set`, using the - construction described in [Djo1992]_. + construction described in [Djo1992a]_. INPUT: @@ -1960,27 +2133,29 @@ def GS_skew_hadamard_smallcases(n, existence=False, check=True): def pmtoZ(s): return [1 if x == '+' else -1 for x in s] - if existence: - return n in [36, 52, 92] or skew_supplementary_difference_set(n//4, existence=True) + db = { + 36: ['+++-+-+--', '+-++--++-', '--++++++-', '+++-++-++'], + 52: ['++++-++--+---', '-+-++----++-+', '--+-+++++-+++', '--+-+++++-+++'], + 92: ['+-------++-+-+--+++++++', '++--+--++++--++++--+--+', '++---+-+-+-++-+-+-+---+', '+----+--+--++--+--+----'], + 188: ['+----+----++-+-+---++-++--+--+++-+-+--++++-++++', + '++--+---+------++------++-+-++--+-+-+----+---++', + '+-+-++---++-+---+++---++-++-++-++-+++++-+-+----', + '+++-++-+-+---+-+++++--+-----++---+--+++++--++-+'], + 236: ['+-+---+-+-++-++---+----++-----+++++--++++-+++--+--+-+-+++-+', + '+-+---+-+-++-++---+----++-----+++++--++++-+++--+--+-+-+++-+', + '+++-++----+++-+-+++--+--++------+---+-----+--+-+--+---+----', + '++++++--+++--+---++-+-+-+---+-+----++++-++-+--++-+--+------'], + 276: ['+--+++--+-+++--+---++-+++++-+++-++-+--+---+-----+--+++-++---+-++---++', + '+-++--+-+----++-+---++++-+---+-++++++++-+---+-++++---+-++----+-+--++-', + '--+--+-++---+--++--+-+-+++-+--++---++++-+-+-+--+-++-+++++++--+--+++++', + '-+---+++-----++---+++-+++--+++++--+---+-+-++++-++++-++-++-+-+++++++++'] + } - if n == 36: - a = [ 1, 1, 1, -1, 1, -1, 1, -1, -1] - b = [ 1, -1, 1, 1, -1, -1, 1, 1, -1] - c = [-1, -1]+[1]*6+[-1] - d = [ 1, 1, 1, -1, 1, 1, -1, 1, 1] - return WGS(a, b, c, d, check=check) + if existence: + return n in db or skew_supplementary_difference_set(n//4, existence=True) - if n == 52: - a = pmtoZ('++++-++--+---') - b = pmtoZ('-+-++----++-+') - c = pmtoZ('--+-+++++-+++') - return WGS(a, b, c, c, check=check) - - if n == 92: - a = [1,-1,-1,-1,-1,-1,-1,-1, 1, 1,-1, 1,-1, 1,-1,-1, 1, 1, 1, 1, 1, 1, 1] - b = [1, 1,-1,-1, 1,-1,-1, 1, 1, 1, 1,-1,-1, 1, 1, 1, 1,-1,-1, 1,-1,-1, 1] - c = [1, 1,-1,-1,-1, 1,-1, 1,-1, 1,-1, 1, 1,-1, 1,-1, 1,-1, 1,-1,-1,-1, 1] - d = [1,-1,-1,-1,-1, 1,-1,-1, 1,-1,-1, 1, 1,-1,-1, 1,-1,-1, 1,-1,-1,-1,-1] + if n in db: + a, b, c, d = map(pmtoZ, db[n]) return WGS(a, b, c, d, check=check) if skew_supplementary_difference_set(n//4, existence=True): @@ -1994,9 +2169,348 @@ def pmtoZ(s): return None -_skew_had_cache={} -def skew_hadamard_matrix(n,existence=False, skew_normalize=True, check=True): +def skew_hadamard_matrix_whiteman_construction(n, existence=False, check=True): + r""" + Construct a skew Hadamard matrix of order `n=2(q+1)` where `q=p^t` is a prime power with `p \cong 5 \mod 8` and `t \cong 2 \mod 4`. + + Assuming `n` satisfies the conditions above, it is possible to construct two supplementary difference sets + `A, B` (see [Whi1971]_), and these can be used to construct a skew Hadamard matrix, as described in [BS1969]_. + + INPUT: + + - ``n`` -- A positive integer, the order of the matrix to be constructed. + + - ``existence`` -- boolean (default False). If True, only return whether the Hadamard matrix can be constructed. + + - ``check`` -- boolean: if True (default), check the the result is a skew Hadamard matrix + before returning it. + + OUTPUT: + + If ``existence`` is false, returns the skew Hadamard matrix of order `n`. It raises an error if `n` does + not satisfy the required conditions. + If ``existence`` is true, returns a boolean representing whether the matrix can be constructed or not. + + EXAMPLES:: + + sage: from sage.combinat.matrices.hadamard_matrix import skew_hadamard_matrix_whiteman_construction + sage: skew_hadamard_matrix_whiteman_construction(52) + 52 x 52 dense matrix over Integer Ring... + sage: skew_hadamard_matrix_whiteman_construction(52, existence=True) + True + + TESTS:: + + sage: from sage.combinat.matrices.hadamard_matrix import is_hadamard_matrix + sage: is_hadamard_matrix(skew_hadamard_matrix_whiteman_construction(52, check=False), skew=True) + True + sage: is_hadamard_matrix(skew_hadamard_matrix_whiteman_construction(340, check=False), skew=True) + True + sage: skew_hadamard_matrix_whiteman_construction(31) + Traceback (most recent call last): + ... + ValueError: The order 31 is not covered by the Whiteman construction. + sage: skew_hadamard_matrix_whiteman_construction(100) + Traceback (most recent call last): + ... + ValueError: The order 100 is not covered by the Whiteman construction. + sage: skew_hadamard_matrix_whiteman_construction(100, existence=True) + False + """ + + q = n // 2 - 1 + p, t = is_prime_power(q, get_data=True) + + is_order_valid = n % 4 == 0 and t > 0 and p % 8 == 5 and t % 4 == 2 + if existence: + return is_order_valid + + if not is_order_valid: + raise ValueError(f'The order {n} is not covered by the Whiteman construction.') + + from sage.rings.finite_rings.finite_field_constructor import GF + G = GF(q) + f = (q-1) // 8 + Cs = {i: [G.gen()**(8*s+i) for s in range(f)] for i in [0, 1, 2, 3, 6, 7]} + A = Cs[0] + Cs[1] + Cs[2] + Cs[3] + B = Cs[0] + Cs[1] + Cs[6] + Cs[7] + + m = n//4 - 1 + Glist = list(G) + + S = [[0 for i in range(n)] for j in range(n)] + for i in range(2*m + 1): + for j in range(2*m + 1): + S[2*m + 1 + i][2*m + 1 + j] = -1 if Glist[j] - Glist[i] in A else 1 + S[i][j] = -S[2*m + 1 + i][2*m + 1 + j] + S[2*m + 1 + j][i] = -1 if Glist[j] - Glist[i] in B else 1 + S[i][2*m + 1 + j] = -S[2*m + 1 + j][i] + S[4*m + 2][i] = -1 + S[4*m + 2][2*m + 1 + i] = 1 + S[i][4*m + 2] = 1 + S[i + 2*m + 1][4*m + 2] = -1 + for i in range(4*m + 3): + S[4*m + 3][i] = 1 + S[i][4*m + 3] = -1 + for i in range(4*m + 4): + S[i][i] = 1 + + H = matrix(S) + + if check: + assert is_hadamard_matrix(H, skew=True) + return H + + +def skew_hadamard_matrix_324(): + r""" + Construct a skew Hadamard matrix of order 324. + + The construction is taken from [Djo1994]_. It uses four supplementary difference sets `S_1, S_2, S_3, S_4`, + with `S_1` of skew type. These are then used to generate four matrices of order `81`, which are + inserted into the Goethals-Seidel array. + + EXAMPLES:: + + sage: from sage.combinat.matrices.hadamard_matrix import skew_hadamard_matrix_324 + sage: skew_hadamard_matrix_324() + 324 x 324 dense matrix over Integer Ring... + + TESTS:: + + sage: from sage.combinat.matrices.hadamard_matrix import is_hadamard_matrix + sage: is_hadamard_matrix(skew_hadamard_matrix_324(), skew=True) + True + """ + from sage.symbolic.ring import SymbolicRing + from sage.rings.finite_rings.integer_mod_ring import Zmod + + R = SymbolicRing() + x = R.var('x') + Z3 = Zmod(3) + F = Z3.extension(x**4 - x**3 - 1) + H = [(F.gen()**16)**i for i in range(10)] + + cosets = [] + for i in range(8): + cosets.append([F.gen()**i * el for el in H]) + cosets.append([-F.gen()**i * el for el in H]) + + def generate_set(index_set, cosets): + S = [] + for idx in index_set: + S += cosets[idx] + return S + + S1 = generate_set([1, 2, 4, 6, 8, 10, 12, 14], cosets) + S2 = generate_set([1, 2, 3, 4, 10, 11, 13], cosets) + S3 = generate_set([4, 5, 6, 8, 12, 13, 14], cosets) + S4 = generate_set([2, 4, 5, 6, 7, 11, 12, 13, 15], cosets) + + A = matrix([[-1 if y-x in S1 else +1 for y in F] for x in F]) + B = matrix([[-1 if y-x in S2 else +1 for y in F] for x in F]) + C = matrix([[-1 if y-x in S3 else +1 for y in F] for x in F]) + D = matrix([[-1 if y-x in S4 else +1 for y in F] for x in F]) + + return _construction_goethals_seidel_matrix(A, B, C, D) + + +def skew_hadamard_matrix_from_good_matrices(a, b, c, d, check=True): + r""" + Construct skew Hadamard matrix from good matrices. + + Given good matrices `A`, `B`, `C`, `D` (`A` circulant, `B, C, D` back-circulant) they can be used to construct + a skew Hadamard matrix using the following block matrix (as described in [Sze1988]_): + + .. MATH:: + + \left(\begin{array}{rrrr} + A & B & C & D \\ + -B & A & D & -C \\ + -C & -D & A & B \\ + -D & C & -B & A + \end{array}\right) + + INPUT: + + - ``a`` -- (1,-1) list specifying the 1st row of `A`. + + - ``b`` -- (1,-1) list specifying the 1st row of `B`. + + - ``d`` -- (1,-1) list specifying the 1st row of `C`. + + - ``c`` -- (1,-1) list specifying the 1st row of `D`. + + - ``check`` -- boolean: if True (default), check that the matrix is a skew Hadamard matrix before returning it. + + EXAMPLES:: + + sage: from sage.combinat.matrices.hadamard_matrix import skew_hadamard_matrix_from_good_matrices + sage: a, b, c, d = ([1, 1, 1, -1, -1], [1, -1, 1, 1, -1], [1, -1, -1, -1, -1], [1, -1, -1, -1, -1]) + sage: skew_hadamard_matrix_from_good_matrices(a, b, c, d) + 20 x 20 dense matrix over Integer Ring... + + TESTS:: + + sage: from sage.combinat.matrices.hadamard_matrix import is_hadamard_matrix + sage: a, b, c, d = ([1, 1, 1, -1, -1], [1, -1, 1, 1, -1], [1, -1, -1, -1, -1], [1, -1, -1, -1, -1]) + sage: is_hadamard_matrix(skew_hadamard_matrix_from_good_matrices(a, b, c, d, check=False), skew=True) + True + sage: a, b, c, d = ([1, 1, 1, -1, -1], [1, -1, 1, 1, -1], [1, -1, -1, -1, -1], [1, -1, -1, -1, 1]) + sage: skew_hadamard_matrix_from_good_matrices(a, b, c, d) + Traceback (most recent call last): + ... + AssertionError + sage: a, b, c, d = ([1, 1, 1], [1, -1, 1, 1, -1], [1, -1, -1, -1, -1], [1, -1, -1, -1, -1]) + sage: skew_hadamard_matrix_from_good_matrices(a, b, c, d) + Traceback (most recent call last): + ... + AssertionError + """ + n = len(a) + m = (n-1) // 2 + + assert len(a) == len(b) == len(c) == len(d) + assert a[0] == 1 and b[0] == 1 and c[0] == 1 and d[0] == 1 + for i in range(1, m+1): + assert a[i] == -a[n-i] and b[i] == b[n-i] and c[i] == c[n-i] and d[i] == d[n-i] + + def back_circulant(row): + length = len(row) + return matrix([[row[(j+i) % length] for j in range(length)] for i in range(length)]) + + A = matrix.circulant(a) + B = back_circulant(b) + C = back_circulant(c) + D = back_circulant(d) + + H = block_matrix([[ A, B, C, D], + [-B, A, D, -C], + [-C, -D, A, B], + [-D, C, -B, A]]) + + if check: + assert is_hadamard_matrix(H, skew=True) + return H + + +def skew_hadamard_matrix_from_good_matrices_smallcases(n, existence=False, check=True): + r""" + Construct skew Hadamard matrices from good matrices for some small values of `n=4m`, with `m` odd. + + The function stores good matrices of odd orders `\le 31`, taken from [Sze1988]_. + These are used to create skew Hadamard matrices of order `4m`, `1 \le m \le 31` (`m` odd), using the function + :func:`skew_hadamard_matrix_from_good_matrices`. + + ALGORITHM: + + Given four sequences (stored in ``E_sequences``) of length `m`, they can be used to construct four `E-sequences` + of length `n=2m+1`, as follows: + + .. MATH:: + + \begin{aligned} + a &= 1, a_0, a_1, ..., a_m, -a_m, -a_{m-1}, ..., -a_0 \\ + b &= 1, b_0, b_1, ..., b_m, b_m, b_{m-1}, ..., b_0 \\ + c &= 1, c_0, c_1, ..., c_m, c_m, c_{m-1}, ..., c_0 \\ + d &= 1, d_0, d_1, ..., d_m, d_m, d_{m-1}, ..., d_0 \\ + \end{aligned} + + These E-sequences will be the first rows of the four good matrices needed to construct a skew Hadamard matrix + of order `4n`. + + INPUT: + + - ``n`` -- the order of the skew Hadamard matrix to be constructed. + + - ``existence`` -- boolean (default False). If True, only return whether the Hadamard matrix can be constructed. + + - ``check`` -- boolean: if True (default), check the the matrix is an Hadamard matrix before returning it. + + OUTPUT: + + If ``existence`` is false, returns the skew Hadamard matrix of order `n`. It raises an error if no data + is available to construct the matrix of the given order. + If ``existence`` is true, returns a boolean representing whether the matrix can be constructed or not. + + EXAMPLES:: + + sage: from sage.combinat.matrices.hadamard_matrix import skew_hadamard_matrix_from_good_matrices_smallcases + sage: skew_hadamard_matrix_from_good_matrices_smallcases(20) + 20 x 20 dense matrix over Integer Ring... + sage: skew_hadamard_matrix_from_good_matrices_smallcases(20, existence=True) + True + + TESTS:: + + sage: from sage.combinat.matrices.hadamard_matrix import is_hadamard_matrix + sage: is_hadamard_matrix(skew_hadamard_matrix_from_good_matrices_smallcases(28, check=False), skew=True) + True + sage: skew_hadamard_matrix_from_good_matrices_smallcases(140) + Traceback (most recent call last): + ... + ValueError: The Good matrices of order 35 are not yet implemented. + sage: skew_hadamard_matrix_from_good_matrices_smallcases(14) + Traceback (most recent call last): + ... + ValueError: The skew Hadamard matrix of order 14 from good matrices does not exist. + sage: skew_hadamard_matrix_from_good_matrices_smallcases(140, existence=True) + False + sage: skew_hadamard_matrix_from_good_matrices_smallcases(14, existence=True) + False + """ + E_sequences = { + 0: ['', '', '', ''], + 1: ['+', '-', '-', '+'], + 2: ['++', '-+', '--', '--'], + 3: ['++-', '++-', '+-+', '-++'], + 4: ['+++-', '+-+-', '---+', '++-+'], + 5: ['+-+--', '+++--', '-+++-', '---+-'], + 6: ['+-+---', '---+++', '+-+--+', '----+-'], + 7: ['+++++--', '-++--++', '----+-+', '-+---+-'], + 8: ['+--++-+-', '+--+----', '++----+-', '+---+-+-'], + 9: ['-+-----++', '+-+++++--', '-+----++-', '--+-+-++-'], + 10: ['+--+++++++', '++--++++-+', '--++-+-+-+', '---+++-+-+'], + 11: ['++-+-------', '+----+--+--', '+-+--++---+', '--++-+-+-++'], + 12: ['+-----+-+---', '+-++++-+-++-', '---+--++++--', '--+-+++--+--'], + 13: ['+---+-+--++-+', '+++---++-++-+', '+++-+++-++---', '+---++++-+-+-'], + 14: ['+--+----+-+-++', '+---++++-++--+', '+-+----++-+--+', '++++++---+-+-+'], + 15: ['+--++----+---+-', '-++-+---+-+++--', '++---+--+--+++-', '-++++++++--+-+-'] + } + + def pm_to_good_matrix(s, sign=1): + e1 = [1 if x == '+' else -1 for x in s] + e2 = [sign * (1 if x == '+' else -1) for x in s] + e2.reverse() + return [1] + e1 + e2 + + if not (n % 4 == 0 and (n//4) % 2 == 1): + if existence: + return False + raise ValueError("The skew Hadamard matrix of order %s from good matrices does not exist." % n) + + m = n//4 + l = (m-1) // 2 + + if existence: + return l in E_sequences + + if l not in E_sequences: + raise ValueError("The Good matrices of order %s are not yet implemented." % m) + + e1, e2, e3, e4 = E_sequences[l] + a = pm_to_good_matrix(e1, sign=-1) + b = pm_to_good_matrix(e2) + c = pm_to_good_matrix(e3) + d = pm_to_good_matrix(e4) + return skew_hadamard_matrix_from_good_matrices(a, b, c, d, check=check) + + +_skew_had_cache = {} + + +def skew_hadamard_matrix(n, existence=False, skew_normalize=True, check=True): r""" Tries to construct a skew Hadamard matrix @@ -2062,11 +2576,11 @@ def skew_hadamard_matrix(n,existence=False, skew_normalize=True, check=True): 92 x 92 dense matrix over Integer Ring... sage: skew_hadamard_matrix(816) # long time 816 x 816 dense matrix over Integer Ring... - sage: skew_hadamard_matrix(100) + sage: skew_hadamard_matrix(356) Traceback (most recent call last): ... - ValueError: A skew Hadamard matrix of order 100 is not yet implemented. - sage: skew_hadamard_matrix(100,existence=True) + ValueError: A skew Hadamard matrix of order 356 is not yet implemented. + sage: skew_hadamard_matrix(356,existence=True) Unknown Check that :trac:`28526` is fixed:: @@ -2089,7 +2603,7 @@ def true(): M = None if existence and n in _skew_had_cache: return True - if not(n % 4 == 0) and (n > 2): + if not (n % 4 == 0) and (n > 2): if existence: return False raise ValueError("A skew Hadamard matrix of order %s does not exist" % n) @@ -2101,35 +2615,50 @@ def true(): if existence: return true() M = matrix([1]) + elif n == 324: + if existence: + return true() + M = skew_hadamard_matrix_324() + elif skew_hadamard_matrix_from_good_matrices_smallcases(n, existence=True): + if existence: + return true() + M = skew_hadamard_matrix_from_good_matrices_smallcases(n, check=False) elif is_prime_power(n - 1) and ((n - 1) % 4 == 3): if existence: return true() M = hadamard_matrix_paleyI(n, normalize=False) - + elif is_prime_power(n//2 - 1) and (n//2 - 1) % 8 == 5: + if existence: + return true() + M = skew_hadamard_matrix_spence_construction(n, check=False) + elif skew_hadamard_matrix_whiteman_construction(n, existence=True): + if existence: + return true() + M = skew_hadamard_matrix_whiteman_construction(n, check=False) elif n % 8 == 0: - if skew_hadamard_matrix(n//2,existence=True) is True: # (Lemma 14.1.6 in [Ha83]_) + if skew_hadamard_matrix(n//2, existence=True) is True: # (Lemma 14.1.6 in [Ha83]_) if existence: return true() - H = skew_hadamard_matrix(n//2,check=False) - M = block_matrix([[H,H], [-H.T,H.T]]) + H = skew_hadamard_matrix(n//2, check=False) + M = block_matrix([[H, H], [-H.T, H.T]]) - else: # try Williamson construction (Lemma 14.1.5 in [Ha83]_) - for d in divisors(n)[2:-2]: # skip 1, 2, n/2, and n + else: # try Williamson construction (Lemma 14.1.5 in [Ha83]_) + for d in divisors(n)[2:-2]: # skip 1, 2, n/2, and n n1 = n//d if is_prime_power(d - 1) and (d % 4 == 0) and (n1 % 4 == 0)\ - and skew_hadamard_matrix(n1,existence=True) is True: + and skew_hadamard_matrix(n1, existence=True) is True: if existence: return true() H = skew_hadamard_matrix(n1, check=False)-I(n1) - U = matrix(ZZ, d, lambda i, j: -1 if i==j==0 else\ - 1 if i==j==1 or (i>1 and j-1==d-i)\ + U = matrix(ZZ, d, lambda i, j: -1 if i == j == 0 else + 1 if i == j == 1 or (i > 1 and j-1 == d-i) else 0) - A = block_matrix([[matrix([0]), matrix(ZZ,1,d-1,[1]*(d-1))], - [ matrix(ZZ,d-1,1,[-1]*(d-1)), - _helper_payley_matrix(d-1,zero_position=0)]])+I(d) + A = block_matrix([[matrix([0]), matrix(ZZ, 1, d-1, [1]*(d-1))], + [matrix(ZZ, d-1, 1, [-1]*(d-1)), + _helper_payley_matrix(d-1, zero_position=0)]])+I(d) M = A.tensor_product(I(n1))+(U*A).tensor_product(H) break - if M is None: # try Williamson-Goethals-Seidel construction + if M is None: # try Williamson-Goethals-Seidel construction if GS_skew_hadamard_smallcases(n, existence=True) is True: if existence: return true() @@ -2140,15 +2669,13 @@ def true(): return Unknown raise ValueError("A skew Hadamard matrix of order %s is not yet implemented." % n) if skew_normalize: - dd = diagonal_matrix(M[0]) - M = dd*M*dd + M = normalise_hadamard(M, skew=True) if check: - assert is_hadamard_matrix(M, normalized=False, skew=True) - if skew_normalize: - assert M[0]==vector([1]*n) - _skew_had_cache[n]=True + assert is_hadamard_matrix(M, normalized=skew_normalize, skew=True) + _skew_had_cache[n] = True return M + def symmetric_conference_matrix(n, check=True): r""" Tries to construct a symmetric conference matrix @@ -2188,12 +2715,12 @@ def symmetric_conference_matrix(n, check=True): """ from sage.graphs.strongly_regular_db import strongly_regular_graph as srg try: - m = srg(n-1,(n-2)/2,(n-6)/4,(n-2)/4) + m = srg(n-1, (n-2)/2, (n-6)/4, (n-2)/4) except ValueError: raise C = matrix([0]+[1]*(n-1)).stack(matrix([1]*(n-1)).stack(m.seidel_adjacency_matrix()).T) if check: - assert (C==C.T and C**2==(n-1)*I(n)) + assert (C == C.T and C**2 == (n-1)*I(n)) return C @@ -2238,16 +2765,16 @@ def szekeres_difference_set_pair(m, check=True): B = [b for b in G if b + F.one() in sG] if check: from itertools import product, chain - assert(len(A) == len(B) == m) + assert (len(A) == len(B) == m) if m > 1: - assert(sG == set([xy[0] / xy[1] + assert (sG == set([xy[0] / xy[1] for xy in chain(product(A, A), product(B, B))])) - assert(all(F.one() / b + F.one() in sG for b in B)) - assert(not any(F.one() / a - F.one() in sG for a in A)) + assert (all(F.one() / b + F.one() in sG for b in B)) + assert (not any(F.one() / a - F.one() in sG for a in A)) return G, A, B -def typeI_matrix_difference_set(G,A): +def typeI_matrix_difference_set(G, A): r""" (1,-1)-incidence type I matrix of a difference set `A` in `G` @@ -2267,7 +2794,8 @@ def typeI_matrix_difference_set(G,A): [-1 -1 1 1 -1] """ n = len(G) - return matrix(n,n, lambda i,j: 1 if G[i]/G[j] in A else -1) + return matrix(n, n, lambda i, j: 1 if G[i]/G[j] in A else -1) + def rshcd_from_prime_power_and_conference_matrix(n): r""" @@ -2320,27 +2848,27 @@ def rshcd_from_prime_power_and_conference_matrix(n): - [WW1972]_ """ from sage.graphs.strongly_regular_db import strongly_regular_graph as srg - if is_prime_power(n) and 2==(n-1)%4: + if is_prime_power(n) and 2 == (n-1) % 4: try: - M = srg(n-2,(n-3)//2,(n-7)//4) + M = srg(n-2, (n-3)//2, (n-7)//4) except ValueError: return m = (n-3)//4 - Q,X,Y = szekeres_difference_set_pair(m) - B = typeI_matrix_difference_set(Q,X) - A = -typeI_matrix_difference_set(Q,Y) # must be symmetric + Q, X, Y = szekeres_difference_set_pair(m) + B = typeI_matrix_difference_set(Q, X) + A = -typeI_matrix_difference_set(Q, Y) # must be symmetric W = M.seidel_adjacency_matrix() - f = J(1,4*m+1) - e = J(1,2*m+1) + f = J(1, 4*m+1) + e = J(1, 2*m+1) JJ = J(2*m+1, 2*m+1) II = I(n-2) Ib = I(2*m+1) - J4m = J(4*m+1,4*m+1) + J4m = J(4*m+1, 4*m+1) H34 = -(B+Ib).tensor_product(W)+Ib.tensor_product(J4m)+(Ib-JJ).tensor_product(II) A_t_W = A.tensor_product(W) e_t_f = e.tensor_product(f) H = block_matrix([ - [J(1,1), f, e_t_f, -e_t_f], + [J(1, 1), f, e_t_f, -e_t_f], [f.T, J4m, e.tensor_product(W-II), e.tensor_product(W+II)], [ e_t_f.T, (e.T).tensor_product(W-II), A_t_W+JJ.tensor_product(II), H34], [-e_t_f.T, (e.T).tensor_product(W+II), H34.T, -A_t_W+JJ.tensor_product(II)]]) diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index a483d63200f..14aeb35c876 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -7248,7 +7248,7 @@ def has_left_descent(self, i, mult=None): doctest:warning ... DeprecationWarning: The mult option is deprecated and ignored. - See https://trac.sagemath.org/27467 for details. + See https://github.com/sagemath/sage/issues/27467 for details. True sage: x.has_left_descent(2, mult='r2l') True @@ -7302,7 +7302,7 @@ def has_right_descent(self, i, mult=None): doctest:warning ... DeprecationWarning: The mult option is deprecated and ignored. - See https://trac.sagemath.org/27467 for details. + See https://github.com/sagemath/sage/issues/27467 for details. True sage: x.has_right_descent(3, mult='r2l') True @@ -9063,7 +9063,7 @@ def a(self): sage: P = Permutations(3, avoiding=[[2,1,3],[1,2,3]]) sage: P.a doctest:...: DeprecationWarning: The attribute a for the list of patterns to avoid is deprecated, use the method patterns instead. - See https://trac.sagemath.org/26810 for details. + See https://github.com/sagemath/sage/issues/26810 for details. ([2, 1, 3], [1, 2, 3]) """ from sage.misc.superseded import deprecation diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index da265a33271..c794ef1f2f1 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -745,7 +745,7 @@ def rank_function(self): sage: Q.rank_function() is None True - test for ticket :trac:`14006`:: + test for issue :trac:`14006`:: sage: H = Poset()._hasse_diagram sage: s = dumps(H) @@ -2051,7 +2051,7 @@ def orthocomplementations_iterator(self): mt = self.meet_matrix() jn = self.join_matrix() for e in range(n): - # Fix following after ticket #20727 + # Fix following after issue #20727 comps[e] = [x for x in range(n) if mt[e, x] == 0 and jn[e, x] == n - 1 and x in orbits[orbit_number[dual_isomorphism[e]]]] diff --git a/src/sage/combinat/posets/lattices.py b/src/sage/combinat/posets/lattices.py index 43bd9f83fdc..985b61cd6ca 100644 --- a/src/sage/combinat/posets/lattices.py +++ b/src/sage/combinat/posets/lattices.py @@ -3010,7 +3010,7 @@ def vertical_composition(self, other, labels='pairs'): # Todo: This and ordinal_sum() of posets could keep # distinguished linear extension, if it is defined # for both posets/lattices. That can be done after - # trac ticket #21607. + # github issue #21607. if labels not in ['integers', 'pairs']: raise ValueError("labels must be either 'pairs' or 'integers'") diff --git a/src/sage/combinat/posets/linear_extensions.py b/src/sage/combinat/posets/linear_extensions.py index 5d9aae755d8..48ca0af51d5 100644 --- a/src/sage/combinat/posets/linear_extensions.py +++ b/src/sage/combinat/posets/linear_extensions.py @@ -252,6 +252,73 @@ def is_greedy(self): return False return True + def is_supergreedy(self): + r""" + Return ``True`` if the linear extension is supergreedy. + + A linear extension `[x_1 @@ -793,7 +793,7 @@ def __call__(self, w, order=1, datatype=None): doctest:warning ... DeprecationWarning: the "datatype" argument is deprecated - See https://trac.sagemath.org/26307 for details. + See https://github.com/sagemath/sage/issues/26307 for details. sage: type(w) sage: w = m([0],4,datatype='str') @@ -1907,7 +1907,7 @@ def fixed_points(self): sage: for w in f.fixed_points(): print(w) abcabbccabcabcabbccbccabcabbccabcabbccab... - This shows that ticket :trac:`13668` has been resolved:: + This shows that issue :trac:`13668` has been resolved:: sage: d = {1:[1,2],2:[2,3],3:[4],4:[5],5:[6],6:[7],7:[8],8:[9],9:[10],10:[1]} sage: s = WordMorphism(d) @@ -1918,7 +1918,7 @@ def fixed_points(self): sage: s7r.periodic_point(2) word: 2,1,1,10,9,8,7,6,5,4,3,2,1,10,9,8,7,6,5,4,3,2,10,9,8,7,6,5,4,3,2,9,8,7,6,5,4,3,2,8,... - This shows that ticket :trac:`13668` has been resolved:: + This shows that issue :trac:`13668` has been resolved:: sage: s = "1->321331332133133,2->133321331332133133,3->2133133133321331332133133" sage: s = WordMorphism(s) @@ -1994,7 +1994,7 @@ def periodic_points(self): sage: f.fixed_points() [] - This shows that ticket :trac:`13668` has been resolved:: + This shows that issue :trac:`13668` has been resolved:: sage: d = {1:[1,2],2:[2,3],3:[4],4:[5],5:[6],6:[7],7:[8],8:[9],9:[10],10:[1]} sage: s = WordMorphism(d) diff --git a/src/sage/cpython/__init__.py b/src/sage/cpython/__init__.py index 19c8d87a3be..51974f1e438 100644 --- a/src/sage/cpython/__init__.py +++ b/src/sage/cpython/__init__.py @@ -5,18 +5,18 @@ # Make sure that the correct zlib library is loaded. This is needed # to prevent the system zlib to be loaded instead of the Sage one. -# See https://trac.sagemath.org/ticket/23122 +# See https://github.com/sagemath/sage/issues/23122 import zlib as _zlib del _zlib # Monkey-patch ExtensionFileLoader to allow IPython to find the sources -# of Cython files. See https://trac.sagemath.org/ticket/24681 +# of Cython files. See https://github.com/sagemath/sage/issues/24681 from importlib.machinery import ExtensionFileLoader as _ExtensionFileLoader del _ExtensionFileLoader.get_source del _ExtensionFileLoader # Work around a Cygwin-specific bug caused by sqlite3; see -# https://trac.sagemath.org/ticket/30157 and the docstring for +# https://github.com/sagemath/sage/issues/30157 and the docstring for # fix_for_ticket_30157 # Here we monkey-patch the sqlite3 module to ensure the fix is # applied the very first time a connection is made to a sqlite3 @@ -39,7 +39,7 @@ def _patch_sqlite3(): def connect(*args, **kwargs): if fix_for_ticket_30157(): raise RuntimeError( - 'patch for Trac ticket #30157 failed; please report this ' + 'patch for Github issue #30157 failed; please report this ' 'bug to https://trac.sagemath.org') # Undo the monkey-patch diff --git a/src/sage/cpython/atexit.pyx b/src/sage/cpython/atexit.pyx index 3ba391b4cdd..baa3d7a2c0e 100644 --- a/src/sage/cpython/atexit.pyx +++ b/src/sage/cpython/atexit.pyx @@ -51,7 +51,7 @@ cdef class restore_atexit: sage: import atexit sage: from sage.cpython.atexit import restore_atexit sage: def handler(*args, **kwargs): - ....: import sys # see https://trac.sagemath.org/ticket/25270#comment:56 + ....: import sys # see https://github.com/sagemath/sage/issues/25270#comment:56 ....: sys.stdout.write(str((args, kwargs))) ....: sys.stdout.write('\n') sage: atexit.register(handler, 1, 2, c=3) diff --git a/src/sage/cpython/cython_metaclass.pyx b/src/sage/cpython/cython_metaclass.pyx index a846884093e..744d6e54791 100644 --- a/src/sage/cpython/cython_metaclass.pyx +++ b/src/sage/cpython/cython_metaclass.pyx @@ -61,7 +61,8 @@ In Python, this would be ``meta.__init__(cls, name, bases, dict)``. EXAMPLES:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: cimport sage.cpython.cython_metaclass ....: cdef class MyCustomType(): ....: def __getmetaclass__(_): @@ -75,9 +76,9 @@ EXAMPLES:: ....: ''') Calling MyMetaclass.__init__(, None, None, None) Calling MyMetaclass.__init__(, None, None, None) - sage: MyCustomType.__class__ + sage: MyCustomType.__class__ # optional - sage.misc.cython - sage: class MyPythonType(MyDerivedType): + sage: class MyPythonType(MyDerivedType): # optional - sage.misc.cython ....: pass Calling MyMetaclass.__init__(, 'MyPythonType', (,), {...}) @@ -98,7 +99,8 @@ TESTS: Check that a proper exception is raised if ``__getmetaclass__`` returns a non-type:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: cimport sage.cpython.cython_metaclass ....: cdef class MyCustomType(): ....: def __getmetaclass__(_): diff --git a/src/sage/cpython/string.pyx b/src/sage/cpython/string.pyx index 2bd86dbfcf6..bc5fc6f2398 100644 --- a/src/sage/cpython/string.pyx +++ b/src/sage/cpython/string.pyx @@ -6,7 +6,8 @@ TESTS: Check that this can be used outside of Sage (see :trac:`25549`):: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: from sage.cpython.string cimport char_to_str ....: print(char_to_str("hello world!")) ....: ''') diff --git a/src/sage/cpython/wrapperdescr.pxd b/src/sage/cpython/wrapperdescr.pxd index fe0a0618a17..d7e67a48ac6 100644 --- a/src/sage/cpython/wrapperdescr.pxd +++ b/src/sage/cpython/wrapperdescr.pxd @@ -39,24 +39,25 @@ cdef inline wrapperbase* get_slotdef(wrapper_descriptor slotwrapper) except NULL TESTS:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: from sage.cpython.wrapperdescr cimport get_slotdef ....: from cpython.long cimport PyLong_FromVoidPtr ....: def py_get_slotdef(slotwrapper): ....: return PyLong_FromVoidPtr(get_slotdef(slotwrapper)) ....: ''') - sage: py_get_slotdef(object.__init__) # random + sage: py_get_slotdef(object.__init__) # random # optional - sage.misc.cython 140016903442416 - sage: py_get_slotdef(bytes.__lt__) # random + sage: py_get_slotdef(bytes.__lt__) # random # optional - sage.misc.cython 140016903441800 - sage: py_get_slotdef(bytes.__lt__) == py_get_slotdef(Integer.__lt__) + sage: py_get_slotdef(bytes.__lt__) == py_get_slotdef(Integer.__lt__) # optional - sage.misc.cython True - sage: py_get_slotdef(bytes.__lt__) == py_get_slotdef(bytes.__gt__) + sage: py_get_slotdef(bytes.__lt__) == py_get_slotdef(bytes.__gt__) # optional - sage.misc.cython False sage: class X(): ....: def __eq__(self, other): ....: return False - sage: py_get_slotdef(X.__eq__) + sage: py_get_slotdef(X.__eq__) # optional - sage.misc.cython Traceback (most recent call last): ... TypeError: Cannot convert ... to wrapper_descriptor diff --git a/src/sage/crypto/boolean_function.pyx b/src/sage/crypto/boolean_function.pyx index a9ea665475c..d10c0c11546 100644 --- a/src/sage/crypto/boolean_function.pyx +++ b/src/sage/crypto/boolean_function.pyx @@ -942,7 +942,7 @@ cdef class BooleanFunction(SageObject): doctest:warning ... DeprecationWarning: absolut_indicator is deprecated. Please use absolute_indicator instead. - See https://trac.sagemath.org/28001 for details. + See https://github.com/sagemath/sage/issues/28001 for details. 32 """ cdef long a diff --git a/src/sage/data_structures/bounded_integer_sequences.pyx b/src/sage/data_structures/bounded_integer_sequences.pyx index 724f296eae2..d431c71f663 100644 --- a/src/sage/data_structures/bounded_integer_sequences.pyx +++ b/src/sage/data_structures/bounded_integer_sequences.pyx @@ -1212,7 +1212,7 @@ cdef class BoundedIntegerSequence: sage: T+None Traceback (most recent call last): ... - TypeError: Cannot concatenate bounded integer sequence and None + TypeError: cannot concatenate bounded integer sequence and None TESTS: @@ -1228,7 +1228,7 @@ cdef class BoundedIntegerSequence: """ cdef BoundedIntegerSequence myself, right, out if other is None or self is None: - raise TypeError('Cannot concatenate bounded integer sequence and None') + raise TypeError('cannot concatenate bounded integer sequence and None') myself = self # may result in a type error right = other # --"-- if right.data.itembitsize != myself.data.itembitsize: diff --git a/src/sage/databases/findstat.py b/src/sage/databases/findstat.py index 218a2dff3ff..452abbcce8e 100644 --- a/src/sage/databases/findstat.py +++ b/src/sage/databases/findstat.py @@ -4733,7 +4733,7 @@ def __init__(self): print(" %s: %s" % (id, data["NamePlural"])) print("To use it with this interface, it has to be added to the dictionary") print(" _SupportedFindStatCollections in src/sage/databases/findstat.py") - print("of the SageMath distribution. Please open a ticket on trac!") + print("of the SageMath distribution. Please open an issue on github!") # print("Very likely, the following code would work:") # fields = "SageCodeElementToString,SageCodeElementsOnLevel,SageCodeStringToElement" # url = FINDSTAT_API_COLLECTIONS + id + "?fields=" + fields diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index a800db53df2..509f0c10d46 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -592,7 +592,7 @@ def _imaginary_entry(self, ident='A999999', keywords=''): '%D ' + ident + ' Lewis Carroll, The Hunting of the Snark.\n' '%D ' + ident + ' Deep Thought, The Answer to the Ultimate Question of Life, The Universe, and Everything.\n' '%H ' + ident + ' Wikipedia, 42 (number)\n' - '%H ' + ident + ' See. also trac ticket #42\n' + '%H ' + ident + ' See. also github issue #42\n' '%H ' + ident + ' Do not confuse with the sequence A000042 or the sequence A000024\n' '%H ' + ident + ' The string http://42.com is not a link.\n' '%F ' + ident + ' For n big enough, s(n+1) - s(n) = 0.\n' @@ -1556,7 +1556,7 @@ def links(self, browse=None, format='guess'): sage: HTML = s.links(format="html"); HTML 0: Wikipedia, 42 (number) - 1: See. also trac ticket #42 + 1: See. also github issue #42 ... sage: type(HTML) diff --git a/src/sage/docs/instancedoc.py b/src/sage/docs/instancedoc.py index e24368e4943..5b03886ef02 100644 --- a/src/sage/docs/instancedoc.py +++ b/src/sage/docs/instancedoc.py @@ -36,7 +36,8 @@ For a Cython ``cdef class``, a decorator cannot be used. Instead, call :func:`instancedoc` as a function after defining the class:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: from sage.misc.instancedoc import instancedoc ....: cdef class Y: ....: "Class docstring" diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index adbf012ab2e..fe58e2bde3e 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -152,10 +152,10 @@ def init_sage(controller=None): """ try: # We need to ensure that the Matplotlib font cache is built to - # avoid spurious warnings (see Trac #20222). + # avoid spurious warnings (see Issue #20222). import matplotlib.font_manager except ImportError: - # Do not require matplotlib for running doctests (Trac #25106). + # Do not require matplotlib for running doctests (Issue #25106). pass else: # Make sure that the agg backend is selected during doctesting. @@ -170,7 +170,7 @@ def init_sage(controller=None): # Set the Python PRNG class to the Python 2 implementation for consistency # of 'random' test results that use it; see - # https://trac.sagemath.org/ticket/24508 + # https://github.com/sagemath/sage/issues/24508 # We use the baked in copy of the random module for both Python 2 and 3 # since, although the upstream copy is unlikely to change, this further # ensures consistency of test results @@ -214,17 +214,17 @@ def init_sage(controller=None): debug.refine_category_hash_check = True # We import readline before forking, otherwise Pdb doesn't work - # on OS X: http://trac.sagemath.org/14289 + # on OS X: https://github.com/sagemath/sage/issues/14289 try: import readline except ModuleNotFoundError: - # Do not require readline for running doctests (Trac #31160). + # Do not require readline for running doctests (Issue #31160). pass try: import sympy except ImportError: - # Do not require sympy for running doctests (Trac #25106). + # Do not require sympy for running doctests (Issue #25106). pass else: # Disable SymPy terminal width detection @@ -731,7 +731,7 @@ def compiler(example): # exceptions), whereas on Python 2 does not, so we # normalize Python 3 exceptions to match tests written to # Python 2 - # See https://trac.sagemath.org/ticket/24271 + # See https://github.com/sagemath/sage/issues/24271 exc_cls = exception[0] exc_name = exc_cls.__name__ if exc_cls.__module__: @@ -2144,7 +2144,7 @@ def run(self): sys.stdin = os.fdopen(0, "r") except OSError: # We failed to open stdin for reading, this might happen - # for example when running under "nohup" (Trac #14307). + # for example when running under "nohup" (Issue #14307). # Simply redirect stdin from /dev/null and try again. with open(os.devnull) as f: os.dup2(f.fileno(), 0) diff --git a/src/sage/dynamics/surface_dynamics_deprecation.py b/src/sage/dynamics/surface_dynamics_deprecation.py index 9a2a1b4312c..9da8f1d0be3 100644 --- a/src/sage/dynamics/surface_dynamics_deprecation.py +++ b/src/sage/dynamics/surface_dynamics_deprecation.py @@ -25,7 +25,7 @@ def surface_dynamics_deprecation(name): computation that are currently available in Sage. See more information at http://www.labri.fr/perso/vdelecro/surface-dynamics/latest/ - See http://trac.sagemath.org/20695 for details. + See https://github.com/sagemath/sage/issues/20695 for details. """ from sage.misc.superseded import deprecation deprecation(20695, deprecation_msg.format(name)) diff --git a/src/sage/env.py b/src/sage/env.py index ac279ed5da3..d1a87df74ce 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -449,7 +449,8 @@ def cython_aliases(required_modules=None, We can use ``cython.parallel`` regardless of whether OpenMP is supported. This will run in parallel, if OpenMP is supported:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: #distutils: extra_compile_args = OPENMP_CFLAGS ....: #distutils: extra_link_args = OPENMP_CFLAGS ....: from cython.parallel import prange diff --git a/src/sage/ext/memory_allocator.pxd b/src/sage/ext/memory_allocator.pxd index b612df2110c..c4f2028f4e4 100644 --- a/src/sage/ext/memory_allocator.pxd +++ b/src/sage/ext/memory_allocator.pxd @@ -56,7 +56,8 @@ cdef class MemoryAllocator: TESTS:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: cdef MemoryAllocator mem = MemoryAllocator() ....: cdef void* ptr @@ -64,8 +65,9 @@ cdef class MemoryAllocator: ....: ptr = mem.aligned_malloc(2**i, 4048) ....: assert ptr == ( ptr) & ~(2**i-1) ....: ''') - doctest:...: DeprecationWarning: this class is deprecated; use the class from the python package `memory_allocator` - See https://trac.sagemath.org/31591 for details. + doctest:...: DeprecationWarning: this class is deprecated; + use the class from the python package `memory_allocator` + See https://github.com/sagemath/sage/issues/31591 for details. """ cdef size_t extra = alignment - 1 return align(self.malloc(size + extra), alignment) @@ -85,7 +87,8 @@ cdef class MemoryAllocator: TESTS:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: def foo(): ....: cdef MemoryAllocator mem = MemoryAllocator() @@ -94,9 +97,10 @@ cdef class MemoryAllocator: ....: ptr = mem.aligned_calloc(2**i, i, 2**i) ....: assert ptr == ( ptr) & ~(2**i-1) ....: ''') - sage: foo() - doctest:...: DeprecationWarning: this class is deprecated; use the class from the python package `memory_allocator` - See https://trac.sagemath.org/31591 for details. + sage: foo() # optional - sage.misc.cython + doctest:...: DeprecationWarning: this class is deprecated; + use the class from the python package `memory_allocator` + See https://github.com/sagemath/sage/issues/31591 for details. """ # Find extra such that (nmemb + extra) * size >= nmemb * size + alignment - 1 # ⇔ extra * size >= alignment - 1 @@ -120,7 +124,8 @@ cdef class MemoryAllocator: TESTS:: - sage: cython(''' # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython + ....: ''' ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: def foo(): ....: cdef MemoryAllocator mem = MemoryAllocator() @@ -129,8 +134,8 @@ cdef class MemoryAllocator: ....: ptr = mem.aligned_allocarray(2**i, i, 2**i) ....: assert ptr == ( ptr) & ~(2**i-1) ....: ''') - sage: foo() # random # might raise deprecation warning - sage: foo() + sage: foo() # random # might raise deprecation warning # optional - sage.misc.cython + sage: foo() # optional - sage.misc.cython """ # Find extra such that (nmemb + extra) * size >= nmemb * size + alignment - 1 # ⇔ extra * size >= alignment - 1 diff --git a/src/sage/ext/memory_allocator.pyx b/src/sage/ext/memory_allocator.pyx index cae760c9752..1f271a3e82e 100644 --- a/src/sage/ext/memory_allocator.pyx +++ b/src/sage/ext/memory_allocator.pyx @@ -27,7 +27,7 @@ cdef class MemoryAllocator: ....: mem.aligned_allocarray(8, n, 8) ....: ''') doctest:...: DeprecationWarning: this class is deprecated; use the class from the python package `memory_allocator` - See https://trac.sagemath.org/31591 for details. + See https://github.com/sagemath/sage/issues/31591 for details. """ def __cinit__(self): """ @@ -44,7 +44,7 @@ cdef class MemoryAllocator: ....: ''') sage: foo() doctest:...: DeprecationWarning: this class is deprecated; use the class from the python package `memory_allocator` - See https://trac.sagemath.org/31591 for details. + See https://github.com/sagemath/sage/issues/31591 for details. 1 16 """ diff --git a/src/sage/ext/mod_int.h b/src/sage/ext/mod_int.h index bb18adf3c11..9bb5043ec71 100644 --- a/src/sage/ext/mod_int.h +++ b/src/sage/ext/mod_int.h @@ -14,7 +14,7 @@ * Hence, we use signed 64-bit ints. This gives us fast conversion * to/from Python on 64-bit Linux and OSX, and a large number of * available (but not quite as fast) primes on 64-bit Windows and all - * 32-bit platforms (see Trac #10281) + * 32-bit platforms (see Issue #10281) */ typedef int64_t mod_int; diff --git a/src/sage/ext_data/threejs/threejs_template.html b/src/sage/ext_data/threejs/threejs_template.html index 38800560c47..172d0cec4aa 100644 --- a/src/sage/ext_data/threejs/threejs_template.html +++ b/src/sage/ext_data/threejs/threejs_template.html @@ -214,7 +214,17 @@ camera.up.set( 0, 0, 1 ); camera.position.set( a[0]*xMid, a[1]*yMid, a[2]*zMid ); - var offset = new THREE.Vector3( a[0]*xRange, a[1]*yRange, a[2]*zRange ); + // camera is positioned so that the line from the camera to the center + // of the bounding sphere of the objects makes an angle of 60 degrees with x-axis + // and an angle of 30 degrees with z-axis and the field of view of the camera looking + // at the center has an angle of 45 degrees. + const sin8 = Math.sin(Math.PI / 8); + const sin5 = Math.sin(Math.PI / 5); + const cos5 = Math.cos(Math.PI / 5); + const sin3 = Math.sin(Math.PI / 3); + const cos3 = Math.cos(Math.PI / 3); + var r = midToCorner / sin8; + var offset = new THREE.Vector3( r * sin3 * cos5, r * sin3 * sin5, r * cos3 ); if ( options.viewpoint ) { @@ -569,7 +579,7 @@ setTimeout( function() { m.style.display = 'none'; }, 2000 ); } - +