diff --git a/.ci/build-docker.sh b/.ci/build-docker.sh index 9df4c932c68..321f92ddba4 100755 --- a/.ci/build-docker.sh +++ b/.ci/build-docker.sh @@ -47,6 +47,9 @@ rsync html_/ html/ -a --copy-links # Build the release image without build artifacts. docker_build --target sagemath --tag "$DOCKER_IMAGE_CLI" . +# Tag the sagemath:$DOCKER_TAG image that CI has just built as +# sagemath:$COMMIT_HASH so we can refer to it uniquely later. +docker tag "$DOCKER_IMAGE_CLI" "$DOCKER_IMAGE_BINDER" # Display the layers of this image docker history "$DOCKER_IMAGE_CLI" # Build the developer image with the build artifacts intact. diff --git a/.ci/update-env.sh b/.ci/update-env.sh index c82345de348..fd1900b1a04 100755 --- a/.ci/update-env.sh +++ b/.ci/update-env.sh @@ -45,6 +45,8 @@ fi export DOCKER_IMAGE_CLI=${DOCKER_NAMESPACE:-sagemath}/sagemath:$DOCKER_TAG export DOCKER_IMAGE_DEV=${DOCKER_NAMESPACE:-sagemath}/sagemath-dev:$DOCKER_TAG +export DOCKER_IMAGE_BINDER="${DOCKER_NAMESPACE:-sagemath}/sagemath:${CI_COMMIT_SHA}" + # Seed the build cache with this image (set to source-clean to build from # scratch.) export ARTIFACT_BASE=${ARTIFACT_BASE:-$DEFAULT_ARTIFACT_BASE} diff --git a/.github/workflows/ci-cygwin-standard-python2.yml b/.github/workflows/ci-cygwin-standard-python2.yml deleted file mode 100644 index a4460b6e11f..00000000000 --- a/.github/workflows/ci-cygwin-standard-python2.yml +++ /dev/null @@ -1,950 +0,0 @@ -name: CI cygwin-standard-python2 - -on: - pull_request: - types: [opened, synchronize] - push: - tags: - - '*' - -env: - MAKE: make -j8 - SAGE_NUM_THREADS: 3 - SAGE_CHECK: warn - SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl" - CYGWIN: winsymlinks:native - CONFIGURE_ARGS: --enable-experimental-packages --enable-download-from-upstream-url - SAGE_FAT_BINARY: yes - -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: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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 nose certifi singledispatch 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: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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 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-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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 ratpoints 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: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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 thebe - 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: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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 sage_brial sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs zn_poly 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: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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: - env: - STAGE: iii - PREVIOUS_STAGES: ii-* - 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-ii-a, cygwin-stage-ii-b, cygwin-stage-ii-c, cygwin-stage-ii-d, cygwin-stage-ii-e] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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-a: - env: - STAGE: iv-a - PREVIOUS_STAGES: iii - TARGETS: ptest - 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] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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-iv-b: - env: - STAGE: iv-b - PREVIOUS_STAGES: iii - 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-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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-iv-c: - env: - STAGE: iv-c - PREVIOUS_STAGES: iii - 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-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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-iv-d: - env: - STAGE: iv-d - PREVIOUS_STAGES: iii - 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-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - 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\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in 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 local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files 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/tox-gcc_spkg.yml b/.github/workflows/tox-gcc_spkg.yml index cff253c99a3..f9a9847f9a9 100644 --- a/.github/workflows/tox-gcc_spkg.yml +++ b/.github/workflows/tox-gcc_spkg.yml @@ -36,7 +36,7 @@ jobs: fail-fast: false matrix: tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, centos-7, centos-8, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386] - tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard-python2-gcc_spkg] + tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg] env: TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} @@ -101,7 +101,7 @@ jobs: fail-fast: false matrix: tox_system_factor: [conda-forge-ubuntu] - tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard-python2-gcc_spkg] + tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} diff --git a/.github/workflows/tox-optional.yml b/.github/workflows/tox-optional.yml index 742ea890b47..445840229ef 100644 --- a/.github/workflows/tox-optional.yml +++ b/.github/workflows/tox-optional.yml @@ -102,7 +102,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - tox_system_factor: [homebrew-macos-python2, homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, conda-forge-macos] + tox_system_factor: [homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, conda-forge-macos] tox_packages_factor: [maximal] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 12e357dac53..67ad95c4c93 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -37,7 +37,7 @@ jobs: max-parallel: 20 matrix: tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, centos-7, centos-8, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386] - tox_packages_factor: [minimal, standard, standard-python2] + tox_packages_factor: [minimal, standard] env: TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} @@ -102,7 +102,7 @@ jobs: fail-fast: false max-parallel: 4 matrix: - tox_system_factor: [homebrew-macos-python2, homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, homebrew-macos-python3_xcode-gcc_spkg, conda-forge-macos] + tox_system_factor: [homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, homebrew-macos-python3_xcode-gcc_spkg, conda-forge-macos] tox_packages_factor: [minimal, standard] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} @@ -147,7 +147,7 @@ jobs: max-parallel: 1 matrix: tox_system_factor: [conda-forge-ubuntu] - tox_packages_factor: [minimal, standard, standard-python2] + tox_packages_factor: [minimal, standard] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22a4075b91e..6d335bc1eb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,7 +37,7 @@ # If you want to provide your own runners, make sure to tag them as follows: # * "big" (60GB of disk space are available) to make build-from-clean pass. -image: docker:latest +image: docker:stable stages: - build @@ -77,7 +77,7 @@ before_script: # better isolation. If you expect many builds to run simultaneously on a host, # conflicting tags can cause issues with a mounted DOCKER_HOST. services: -- docker:18.05.0-ce-dind +- docker:stable-dind # Build Sage and its documentation. # The build starts from the build artifacts of DEFAULT_ARTIFACT_BASE which is @@ -100,6 +100,7 @@ build-from-latest: - .ci/build-docker.sh | tee gitlab-build-docker.log | .ci/head-tail.sh 1048576 - .ci/push-gitlab.sh sagemath-dev - .ci/push-gitlab.sh sagemath + - DOCKER_TAG=$CI_COMMIT_SHA .ci/push-gitlab.sh sagemath except: - master - develop diff --git a/Makefile b/Makefile index 8f5ffdda80f..2190139c2e3 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,8 @@ distclean: build-clean bootstrap-clean: rm -rf config configure build/make/Makefile-auto.in rm -f src/doc/en/installation/*.txt + rm -rf src/doc/en/reference/spkg/*.rst + rm -f src/doc/en/reference/repl/*.txt # Remove absolutely everything which isn't part of the git repo maintainer-clean: distclean bootstrap-clean diff --git a/VERSION.txt b/VERSION.txt index 64dc3bd1d87..d85786ed487 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 9.2.beta0, Release Date: 2020-05-28 +SageMath version 9.2.beta1, Release Date: 2020-06-13 diff --git a/bootstrap b/bootstrap index 0cca4c43739..1e0fb4452ce 100755 --- a/bootstrap +++ b/bootstrap @@ -160,7 +160,7 @@ save () { # Create configure tarball echo "Creating $NEWCONFBALL..." mkdir -p upstream - tar zcf "$NEWCONFBALL" configure config/* build/make/Makefile-auto.in src/doc/en/installation/*.txt + tar zcf "$NEWCONFBALL" configure config/* build/make/Makefile-auto.in src/doc/en/installation/*.txt src/doc/en/reference/spkg/*.rst src/doc/en/reference/repl/*.txt # Update version echo "$NEWCONFVERSION" >$PKG/package-version.txt diff --git a/build/bin/sage-site b/build/bin/sage-site new file mode 100755 index 00000000000..566ae033010 --- /dev/null +++ b/build/bin/sage-site @@ -0,0 +1,170 @@ +#!/usr/bin/env bash +# Handle options of the src/bin/sage script that pertain to SAGE_ROOT or sage-the-distribution. + +usage() { + echo + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo "Sage-the-distribution options:" + echo " --optional -- list all optional packages that can be installed" + echo " --experimental -- list all experimental packages that can be installed" + echo " --info [packages] -- print the SPKG.txt or SPKG.rst of the given packages," + echo " and some additional information." + echo " -i [packages] -- install the given Sage packages" + echo " --upgrade [version] -- download, build and install the given version. Here," + echo " 'version' is a git branch or tag name. Useful values" + echo " are 'master' (the current development version, this" + echo " is the default) or a version number like '5.13'." +} + +usage_advanced() { + echo + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo "Building the Sage library:" + echo + echo " -b -- build Sage library -- do this if you have" + echo " modified any source code files in SAGE_ROOT/src/sage/" + echo " -ba -- same as -b, but rebuild *all* Cython" + echo " code. This could take a while, so you will be asked" + echo " if you want to proceed." + echo " --ba-force -- same as -ba, but don't query before rebuilding" + echo " -br -- build and run Sage" + echo + echo " -bt [...] -- build Sage and test; same options as -t" + echo " -btp [...] -- build Sage and test in parallel; same options as -tp" + echo " -btnew [...] -- build Sage and test modified files, as in -t --new" + echo + echo " -bn [...], --build-and-notebook [...]" + echo " -- build the Sage library (as by running \"sage -b\")" + echo " and then start the notebook" + echo + echo "Package handling:" + echo + echo " --package [args] -- call the package manager with given arguments." + echo " Run without arguments for help." + echo " --experimental -- list all experimental packages that can be installed" + echo " -i [opts] [pkgs] -- install the given Sage packages. Options:" + echo " -c -- run the packages' test suites," + echo " overriding the settings of" + echo " SAGE_CHECK and SAGE_CHECK_PACKAGES" + echo " -d -- only download, do not install packages" + echo " -f -- force build: install the packages even" + echo " if they are already installed" + echo " -s -- do not delete the temporary build directories" + echo " after a successful build" + echo " -y -- reply yes to prompts about experimental" + echo " and old-style packages; warning: there" + echo " is no guarantee that these packages will" + echo " build correctly; use at your own risk" + echo " -n -- reply no to prompts about experimental" + echo " and old-style packages" + echo " -f [opts] [pkgs] -- shortcut for -i -f: force build of the given Sage" + echo " packages" + echo " -p [opts] [packages]-- install the given Sage packages, without dependency" + echo " checking. Options are the same as for the -i command." + echo " --location -- if needed, fix paths to make Sage relocatable" + echo " --optional -- list all optional packages that can be installed" + echo " --standard -- list all standard packages that can be installed" + echo " --installed -- list all installed packages" + echo + echo "Upgrading:" + echo + echo " --upgrade [version] -- download, build and install the given version. Here," + echo " 'version' is a git branch or tag name. Useful values" + echo " are 'master' (the current development version, this" + echo " is the default) or a version number like '5.13'." + + echo + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo "Making Sage distributions:" + echo + echo " --sdist -- build a source distribution of Sage" + echo + echo "Building the documentation:" + echo + echo " --docbuild [lang/] -- Build the Sage documentation" + echo + echo "Other developer tools:" + echo + echo " --root -- print the Sage root directory" + echo " --git-branch -- print the current git branch" + echo " --buildsh [...] -- run a shell with Sage environment variables" + echo " as they are set while building Sage and its packages" + echo + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| +} + +if [ "$1" = '-h' -o "$1" = '-?' -o "$1" = '-help' -o "$1" = '--help' ]; then + usage + exit 0 +fi +if [ "$1" = "-advanced" -o "$1" = "--advanced" ]; then + usage_advanced + exit 0 +fi + +##################################################################### +# Package handling +##################################################################### + +if [ "$1" = '-package' -o "$1" = "--package" ]; then + shift + exec sage-package $@ +fi + +if [ "$1" = '-optional' -o "$1" = "--optional" ]; then + shift + exec sage-list-packages optional $@ +fi + +if [ "$1" = '-experimental' -o "$1" = "--experimental" ]; then + shift + exec sage-list-packages experimental $@ +fi + +if [ "$1" = '-standard' -o "$1" = "--standard" ]; then + shift + exec sage-list-packages standard $@ +fi + +if [ "$1" = '-installed' -o "$1" = "--installed" ]; then + shift + exec sage-list-packages all --installed-only $@ +fi + +if [ "$1" = '-p' ]; then + echo "Error: Installing old-style SPKGs is no longer supported." + exit 1 +fi + +if [ "$1" = '-info' -o "$1" = '--info' ]; then + shift + for PKG in "$@" + do + sage-spkg --info "$PKG" || exit $? + done + exit 0 +fi + +##################################################################### +# Building the documentation. +##################################################################### + +if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then + # Redirect stdin from /dev/null. This helps with running TeX which + # tends to ask interactive questions if something goes wrong. These + # cause the build to hang. If stdin is /dev/null, TeX just aborts. + shift + exec sage-python -m sage_setup.docbuild "$@" ... +# sage {-i|-p} ... # # Options can be: # -s: do not delete temporary build directory @@ -73,12 +73,10 @@ export LC_ALL=C usage() { cat < +Usage: sage {-i|-p} -If is a URL, download and install it. If it is a file -name, install it. Otherwise, search Sage's list of packages (see -'sage --package list') for a matching package, and if a match is -found, install it. +Search Sage's list of packages (see 'sage --package list') for a +matching package, and if a match is found, install it. Options: -s: do not delete the temporary build directory @@ -249,37 +247,16 @@ done # Figure out the package filename, download it if needed. ################################################################## # One should be able to install a package using -# sage -i where can be any of the -# following values: -# -# 1a. /path/to/-x.y.z.spkg, i.e. the package is found somewhere -# in your file system and you're giving an absolute path. -# 1b. relative/path/to/-x.y.z.spkg, the same with a relative -# path. -# 2a. -x.y.z, i.e. the name of the package plus the package's -# version numbers. -# 2b. -x.y.z.spkg, i.e. the name of the package in addition to -# the version numbers and the ".spkg" extension. -# 3. , i.e. the name of the package without a version number. -# 4. /-x.y.z.spkg, i.e. the full URL where the package -# is hosted. Any local packages matching are ignored. -# -# In cases 2a, 2b and 3 we first look locally inside spkg/* for a -# matching package. Otherwise, we try to download it. In all cases, -# we reduce to case 1a. -# -# See #7544 and #12602. -# +# sage -i PKG_SRC="$1" # Does PKG_SRC contain a slash? if echo "$PKG_SRC" | grep / >/dev/null; then - PKG_HAS_PATH=yes + echo >&2 "Error: Installing old-style SPKGs is no longer supported" + exit 1 fi -# PKG_NAME is the last path component without .spkg -# This already reduces case 2b to case 2a. -PKG_NAME=`basename "$PKG_SRC" | sed 's/\.spkg$//'` -PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'` +PKG_NAME="$PKG_SRC" +PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'` # strip version number # USE_LOCAL_SCRIPTS is a flag that if non-empty will cause # this script to try to install the package using local metadata @@ -287,39 +264,31 @@ PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'` # the value of this flag is set in the next codeblock USE_LOCAL_SCRIPTS= -if [ -f "$PKG_SRC" ]; then - # PKG_SRC is a file. If it is given by a relative path, prepend `pwd` - # (reduce case 1b to 1a) - if ! echo "$PKG_SRC" | grep '^/' >/dev/null; then - PKG_SRC="`pwd`/$PKG_SRC" - fi -elif [ -z "$PKG_HAS_PATH" ]; then - # If PKG_SRC is not an existing file and doesn't contain a slash, - # we are in case 2a or 3. If version in 2a matches the version in - # build/pkgs or we are in case 3 use the local scripts, otherwise - # we try to find a package in upstream - PKG_VER="${PKG_NAME#${PKG_BASE}}" - PKG_VER="${PKG_VER#-}" - PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" - LOCAL_PKG_VER=`cat $PKG_SCRIPTS/package-version.txt 2>/dev/null` - if [ -n "$LOCAL_PKG_VER" ] && [ -z "$PKG_VER" -o "$PKG_VER" = "$LOCAL_PKG_VER" ]; then - PKG_VER="$LOCAL_PKG_VER" - if [ -z "$PKG_VER" ]; then - PKG_NAME="${PKG_BASE}" - else - PKG_NAME="${PKG_BASE}-${PKG_VER}" - fi - USE_LOCAL_SCRIPTS=yes - PKG_BASE_VER=`echo $PKG_VER | sed 's/\.p[0-9][0-9]*$//'` - PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"` - echo "Found local metadata for $PKG_NAME" - - # Warning for experimental packages - if [ x`cat "$PKG_SCRIPTS/type"` = x"experimental" -a $INFO = 0 ]; then - if [ $YES != 1 ]; then - # We use /dev/tty here because our output may be redirected - # to a logfile, or line-buffered. - write_to_tty </dev/null` +PKG_VER="$LOCAL_PKG_VER" +if [ -z "$PKG_VER" ]; then + PKG_NAME="${PKG_BASE}" +else + PKG_NAME="${PKG_BASE}-${PKG_VER}" +fi +USE_LOCAL_SCRIPTS=yes +PKG_BASE_VER=`echo $PKG_VER | sed 's/\.p[0-9][0-9]*$//'` +PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"` +echo "Found local metadata for $PKG_NAME" + +# Warning for experimental packages +if [ x`cat "$PKG_SCRIPTS/type"` = x"experimental" -a $INFO = 0 ]; then + if [ $YES != 1 ]; then + # We use /dev/tty here because our output may be redirected + # to a logfile, or line-buffered. + write_to_tty < /dev/tty 2>&1 - else - answer=n - fi - case "$answer" in - n*|N*) exit 1;; - esac - # Confirm the user's input. (This gives important - # feedback to the user when output is redirected to a logfile.) - echo > /dev/tty "OK, installing $PKG_NAME now..." - fi + if [ $? -ne 0 ]; then + echo "Terminal not available for prompting. Use 'sage -i -y $PKG_BASE'" + echo "to install experimental packages in non-interactive mode." + YES=-1 fi - - else - cd "$SAGE_DISTFILES" - for spkg in `ls -1t ${PKG_NAME}.spkg ${PKG_NAME}-*.spkg 2>/dev/null`; do - if [ -f "$spkg" ]; then - # Found a good package - echo "Found package $PKG_NAME in $SAGE_DISTFILES/$spkg" - PKG_SRC="`pwd`/$spkg" - PKG_NAME=`basename "$spkg" | sed 's/\.spkg$//'` - break - fi - done + if [ $YES != -1 ]; then + read -p "Are you sure you want to continue [Y/n]? " answer < /dev/tty > /dev/tty 2>&1 + else + answer=n + fi + case "$answer" in + n*|N*) exit 1;; + esac + # Confirm the user's input. (This gives important + # feedback to the user when output is redirected to a logfile.) + echo > /dev/tty "OK, installing $PKG_NAME now..." fi fi if [ $INFO -ne 0 -a "$USE_LOCAL_SCRIPTS" = yes ]; then - cat "$PKG_SCRIPTS/SPKG.txt" - if [ -r "$PKG_SCRIPTS/type" ] ; then - echo - echo "== Type ==" - echo - cat "$PKG_SCRIPTS/type" - echo - fi - echo "== Equivalent System Packages ==" - echo - PKG_DISTROS="$PKG_SCRIPTS"/distros - for system_package_file in "$PKG_DISTROS"/*.txt; do - if [ -f "$system_package_file" ]; then - system=$(basename "$system_package_file" .txt) - system_packages="$(echo $(sed 's/#.*//;' $system_package_file))" - case $system in - debian) - # Generic - echo "Debian/Ubuntu:" - ;; - fedora) - # Generic - echo "Fedora/Redhat/CentOS:" - ;; - *) - echo "$system:" - ;; - esac - echo -n " " - sage-print-system-package-command $system --prompt --sudo install $system_packages - fi - done - if [ -z "$system" ]; then - echo "(none known)" - else - echo - if [ -f "$PKG_SCRIPTS"/spkg-configure.m4 ]; then - echo "If the system package is installed, ./configure will check whether it can be used." - else - echo "However, these system packages will not be used for building Sage" - echo "because spkg-configure.m4 has not been written for this package;" - echo "see https://trac.sagemath.org/ticket/27330" - fi - fi - echo - exit 0 + exec sage-spkg-info $PKG_BASE fi # If we haven't found the package yet, we must download it @@ -419,154 +329,8 @@ if [ ! -f "$PKG_SRC" ]; then fi PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM" else - # Handle all the legacy cruft. This branch can be deleted once - # we get rid of old-style spkgs - if [ $YES = -1 ]; then - # User provided -n option, so don't even try to download the package" - echo "Old-style packages disabled by use of '-n' option" - exit 1 - fi - if [ $INFO -eq 0 ]; then - echo "Attempting to download package $PKG_NAME" - else - echo "Attempting to get on-line info for package $PKG_NAME" - fi - - # Reduce everything to case 4: full URL. - if [ -n "$PKG_HAS_PATH" ]; then - PKG_URL="$PKG_SRC" - else - # Handle cases 2a and 3, where the package name is something - # like "foo" or "foo-1.2.3". - MIRROR=$(sage-download-file --print-fastest-mirror)/spkg - if [ $? -ne 0 ]; then - error_msg "Error downloading list of packages" - exit 1 - fi - for repo in optional experimental huge; do - # Download the list of packages. - echo ">>> Checking online list of $repo packages." - # File inside DOT_SAGE should be writable - repolist="${DOT_SAGE}/${repo}.list" - sage-download-file --quiet "$MIRROR/$repo/list" $repolist - if [ $? -ne 0 ]; then - rm -f $repolist - error_msg "Error downloading $MIRROR/$repo/list" - exit 1 - fi - - # The contrived sed commands print out either ${PKG_NAME} if - # it appears as a complete line or some string starting with - # ${PKG_NAME}- whichever occurs first. - # Tested with GNU sed, BSD sed (on OS X) and Solaris sed. - pkg=`sed -n -f <( echo "/^${PKG_NAME}\$/{p;q;}" && echo "/^${PKG_NAME}-/{p;q;}" ) $repolist` - rm -f $repolist - if [ -n "$pkg" ]; then - echo ">>> Found $pkg" - PKG_NAME=$pkg - - # If INFO is set, try downloading only the .txt file - if [ $INFO -eq 1 ]; then - PKG_URL="$MIRROR/$repo/$pkg.txt" - sage-download-file --quiet "$PKG_URL" && exit 0 - # If the download failed (for whatever reason), - # fall through and use the .spkg file. - else - if [ $YES != 1 ]; then - # Warn and ask the user if downloading an - # experimental package. - # Add a deprecation note for other packages, - # since old-style packages are deprecated. - if [ $repo = experimental ]; then - write_to_tty < /dev/tty 2>&1 - else - answer=n - fi - case "$answer" in - n*|N*) exit 1;; - esac - else - # Deprecated since Sage 6.9, Trac #19158 - write_to_tty < /dev/tty 2>&1 - elif [ $YES = -1 ]; then - answer=n - else - answer=y - fi - case "$answer" in - n*|N*) exit 1;; - esac - fi - # Confirm the user's input. (This gives important - # feedback to the user when output is redirected to a logfile.) - echo > /dev/tty "OK, installing $PKG_NAME now..." - fi - fi - PKG_URL="$MIRROR/$repo/$pkg.spkg" - break - fi - done - - if [ -z "$PKG_URL" ]; then - echo >&2 "Error: could not find a package matching $PKG_NAME" - echo >&2 " Try 'sage --package list' to see the available packages" - echo >&2 " $(sage-package apropos $PKG_NAME)" - exit 1 - fi - fi - - # Trac #5852: check write permissions - mkdir -p "$SAGE_DISTFILES" - if [ ! -w "$SAGE_DISTFILES" ]; then - error_msg "Error: no write access to packages directory $SAGE_PACKAGES" - exit 1 - fi - cd "$SAGE_DISTFILES" || exit $? - - # Download to a temporary file (such that we don't end up with a - # corrupted .spkg file). - PKG_TMP="${PKG_URL##*/}.tmp" - echo ">>> Trying to download $PKG_URL" - sage-download-file "$PKG_URL" "$PKG_TMP" - if [ $? -ne 0 ]; then - # Delete failed download - rm -f "$PKG_TMP" - error_msg "Error downloading $PKG_URL" - exit 1 - fi - - PKG_SRC="`pwd`/${PKG_URL##*/}" - mv -f "$PKG_TMP" "$PKG_SRC" + echo >&2 "Error: Installing old-style SPKGs is no longer supported" + exit 1 fi fi @@ -679,21 +443,8 @@ if [ "$USE_LOCAL_SCRIPTS" = yes ]; then exit 1 fi else - # Old-style package (deprecated) - echo "Extracting package $PKG_SRC" - ls -l "$PKG_SRC" - - sage-uncompress-spkg "$PKG_SRC" - if [ $? -ne 0 ]; then - error_msg "Error: failed to extract $PKG_SRC" - exit 1 - fi - - cd "$PKG_NAME" - if [ $? -ne 0 ]; then - error_msg "Error: after extracting, the directory '$PKG_NAME' does not exist" - exit 1 - fi + echo >&2 "Error: Installing old-style SPKGs is no longer supported." + exit 1 fi echo "Finished extraction" @@ -1092,4 +843,4 @@ fi touch "$SAGE_LOCAL/lib/sage-force-relocate.txt" -echo "Finished installing $PKG_NAME.spkg" +echo "Finished installing $PKG_NAME" diff --git a/build/bin/sage-spkg-info b/build/bin/sage-spkg-info new file mode 100755 index 00000000000..1a8847bb875 --- /dev/null +++ b/build/bin/sage-spkg-info @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# +# sage-spkg-info SPKG +# Format information about a Sage package +# +# Assumes SAGE_ROOT is set +PKG_BASE=$1 +PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" +for ext in rst txt; do + SPKG_FILE="$PKG_SCRIPTS/SPKG.$ext" + if [ -f "$SPKG_FILE" ]; then + cat "$SPKG_FILE" + break + fi +done +if [ -r "$PKG_SCRIPTS/type" ] ; then + echo + echo "== Type ==" + echo + cat "$PKG_SCRIPTS/type" + echo +fi +echo "== Equivalent System Packages ==" +echo +PKG_DISTROS="$PKG_SCRIPTS"/distros +for system_package_file in "$PKG_DISTROS"/*.txt; do + if [ -f "$system_package_file" ]; then + system=$(basename "$system_package_file" .txt) + system_packages="$(echo $(sed 's/#.*//;' $system_package_file))" + case $system in + debian) + # Generic + echo "Debian/Ubuntu:" + ;; + fedora) + # Generic + echo "Fedora/Redhat/CentOS:" + ;; + *) + echo "$system:" + ;; + esac + echo -n " " + sage-print-system-package-command $system --prompt --sudo install $system_packages + fi +done +if [ -z "$system" ]; then + echo "(none known)" +else + echo + if [ -f "$PKG_SCRIPTS"/spkg-configure.m4 ]; then + echo "If the system package is installed, ./configure will check whether it can be used." + else + echo "However, these system packages will not be used for building Sage" + echo "because spkg-configure.m4 has not been written for this package;" + echo "see https://trac.sagemath.org/ticket/27330" + fi +fi +echo diff --git a/build/pkgs/4ti2/SPKG.rst b/build/pkgs/4ti2/SPKG.rst new file mode 100644 index 00000000000..c847e765542 --- /dev/null +++ b/build/pkgs/4ti2/SPKG.rst @@ -0,0 +1,25 @@ +4ti2 +==== + +Description +----------- + +A software package for algebraic, geometric and combinatorial problems +on linear spaces. Available at www.4ti2.de. + +License +------- + +4ti2 is released under a GPL v2 license. + + +Upstream Contact +---------------- + +- Raymond Hemmecke, TU Munich, Germany +- Matthias Köppe, UC Davis, CA, USA + +Dependencies +------------ + +GLPK, GMP. diff --git a/build/pkgs/4ti2/SPKG.txt b/build/pkgs/4ti2/SPKG.txt deleted file mode 100644 index 92ffa4737fb..00000000000 --- a/build/pkgs/4ti2/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= 4ti2 = - -== Description == - -A software package for algebraic, geometric and combinatorial problems on linear spaces. Available at www.4ti2.de. - -== License == -4ti2 is released under a GPL v2 license. - -== Upstream Contact == - -Raymond Hemmecke, TU Munich, Germany -Matthias Köppe, UC Davis, CA, USA - -== Dependencies == - -GLPK, GMP. diff --git a/build/pkgs/alabaster/SPKG.rst b/build/pkgs/alabaster/SPKG.rst new file mode 100644 index 00000000000..63abb0eed3c --- /dev/null +++ b/build/pkgs/alabaster/SPKG.rst @@ -0,0 +1,15 @@ +alabaster +========= + +Description +----------- + +Alabaster is a visually (c)lean, responsive, configurable theme for the +Sphinx documentation system. It is Python 2+3 compatible. + +It began as a third-party theme, and is still maintained separately, but +as of Sphinx 1.3, Alabaster is an install-time dependency of Sphinx and +is selected as the default theme. + +Live examples of this theme can be seen on paramiko.org, fabfile.org and +pyinvoke.org. diff --git a/build/pkgs/alabaster/SPKG.txt b/build/pkgs/alabaster/SPKG.txt deleted file mode 100644 index b6f8231441d..00000000000 --- a/build/pkgs/alabaster/SPKG.txt +++ /dev/null @@ -1,13 +0,0 @@ -= alabaster = - -== Description == - -Alabaster is a visually (c)lean, responsive, configurable theme for the Sphinx -documentation system. It is Python 2+3 compatible. - -It began as a third-party theme, and is still maintained separately, but as of -Sphinx 1.3, Alabaster is an install-time dependency of Sphinx and is selected -as the default theme. - -Live examples of this theme can be seen on paramiko.org, fabfile.org and -pyinvoke.org. diff --git a/build/pkgs/appnope/SPKG.rst b/build/pkgs/appnope/SPKG.rst new file mode 100644 index 00000000000..bd3e10e2962 --- /dev/null +++ b/build/pkgs/appnope/SPKG.rst @@ -0,0 +1,7 @@ +appnope +======= + +Description +----------- + +Disable App Nap on OS X 10.9 diff --git a/build/pkgs/appnope/SPKG.txt b/build/pkgs/appnope/SPKG.txt deleted file mode 100644 index eafadb7faad..00000000000 --- a/build/pkgs/appnope/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= appnope = - -== Description == - -Disable App Nap on OS X 10.9 diff --git a/build/pkgs/arb/SPKG.txt b/build/pkgs/arb/SPKG.rst similarity index 58% rename from build/pkgs/arb/SPKG.txt rename to build/pkgs/arb/SPKG.rst index 20a790f549c..c0eea2854e7 100644 --- a/build/pkgs/arb/SPKG.txt +++ b/build/pkgs/arb/SPKG.rst @@ -1,6 +1,8 @@ -= arb = +arb +=== -== Description == +Description +----------- Arb is a C library for arbitrary-precision floating-point ball arithmetic, developed by Fredrik Johansson @@ -9,21 +11,24 @@ computation with polynomials, power series, matrices and special functions over the real and complex numbers, with automatic, rigorous error control. -== License == +License +------- GNU General Public License v2+ -== Upstream Contact == +Upstream Contact +---------------- -* Fredrik Johansson: fredrik.johansson@gmail.com +- Fredrik Johansson: fredrik.johansson@gmail.com +Dependencies +------------ -== Dependencies == +- FLINT +- MPIR or GMP +- MPFR -* FLINT -* MPIR or GMP -* MPFR - -== Special Update/Build Instructions == +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/atlas/SPKG.rst b/build/pkgs/atlas/SPKG.rst new file mode 100644 index 00000000000..b2c086c83ba --- /dev/null +++ b/build/pkgs/atlas/SPKG.rst @@ -0,0 +1,106 @@ +ATLAS +===== + +Description +----------- + +This spkg builds ATLAS for Sage. + +License +------- + +3-clause BSD + + +Upstream Contact +---------------- + +- Atlas devel mailing list. +- Clint Whaley has frequently answered questions from the Sage project + +Dependencies +------------ + +- Python + + +Special Update/Build Instructions +--------------------------------- + +- src/lapack-x.y.z.tgz: The netlib lapack tarball. If you update this, + make sure you also update the LAPACK_TARBALL variable in + spkg-install. + +- src/ATLAS-lib: We are using a dummy autotools/libtools project + to repack the static ATLAS libraries into shared libraries. + +- src/ARCHS: We ship some archdef tarballs to speed ATLAS build. +- spkg-install: If you update atlas to a new version make sure that the + ATLAS_OSTYPE, ATLAS_MACHTYPE, and ATLAS_ISAEXT variables in + spkg-install remain in sync with atlas' CONFIG/include/atlconf.h + +- The package is never installed on OS X, unless you set + SAGE_ATLAS_ARCH. + +Patches +~~~~~~~ + +- patches/detect.patch: Fix Itanium2 support on modern + RHEL 5 and SLES 10 systems, work around -m64 issue on Itanium2, + and correctly detect number and speed of CPUs on a bunch of systems. + +- patches/arm_hard_floats.patch: make sure soft floats are not enforced + on ARM. +- patches/Makefile.patch: fix clean target. +- patches/do_not_force_mutex.patch: always use assembly over mutex + since the mutex version fails to build a shared library. See #15045 + for details. + +- patches/glibc_scanf_workaround.patch: Workaround for the scanf bug + in glibc-2.18 that breaks the atlas auto-tuning system. + +Configuration +~~~~~~~~~~~~~ + +The package can be configured via three environment variables: + +- SAGE_ATLAS_LIB=path + + If this environment variable is set, the libraries libatlas, + libcblas, liblapack, and libf77blas from the direcory "path" are + used and ATLAS is not compiled from source. The libraries can be + either static (endin in .a) or shared libraries (ending in .so or + .dylib). + +- SAGE_ATLAS_ARCH=arch[,isaext1][,isaext2]...[,isaextN] + + The given architectural default and instruction set extensions are + used instead of the empirical tuning. Available architectures are + + POWER3, POWER4, POWER5, PPCG4, PPCG5, POWER6, POWER7, IBMz9, + IBMz10, IBMz196, x86x87, x86SSE1, x86SSE2, x86SSE3, P5, P5MMX, + PPRO, PII, PIII, PM, CoreSolo, CoreDuo, Core2Solo, Core2, Corei1, + Corei2, Atom, P4, P4E, Efficeon, K7, HAMMER, AMD64K10h, AMDDOZER, + UNKNOWNx86, IA64Itan, IA64Itan2, USI, USII, USIII, USIV, UST1, UST2, + UnknownUS, MIPSR1xK, MIPSICE9, ARMv6, ARMv7 + + and instruction set extensions are + + VSX, AltiVec, AVXMAC, AVXFMA4, AVX, SSE3, SSE2, SSE1, 3DNow, NEON + + In addition, you can also set + +- SAGE_ATLAS_ARCH=fast picks defaults for a modern (2-3 year old) + CPU of your processor line, and + +- SAGE_ATLAS_ARCH=base picks defaults that should work for a ~10 + year old CPU. + + For example, + + SAGE_ATLAS_ARCH=Corei2,AVX,SSE3,SSE2,SSE1 + + would be appropriate for a Core i7 CPU. + +- If SAGE_ATLAS_SAVE_ARCHDEF = is given, then a new archdef + file is created and saved to the given path. diff --git a/build/pkgs/atlas/SPKG.txt b/build/pkgs/atlas/SPKG.txt deleted file mode 100644 index eb015aa4ec4..00000000000 --- a/build/pkgs/atlas/SPKG.txt +++ /dev/null @@ -1,85 +0,0 @@ -= ATLAS = - -== Description == - -This spkg builds ATLAS for Sage. - -== License == - -3-clause BSD - -== Upstream Contact == - - * Atlas devel mailing list. - * Clint Whaley has frequently answered questions from the Sage project - -== Dependencies == - - * Python - -== Special Update/Build Instructions == - - * src/lapack-x.y.z.tgz: The netlib lapack tarball. If you update this, - make sure you also update the LAPACK_TARBALL variable in spkg-install. - * src/ATLAS-lib: We are using a dummy autotools/libtools project - to repack the static ATLAS libraries into shared libraries. - * src/ARCHS: We ship some archdef tarballs to speed ATLAS build. - * spkg-install: If you update atlas to a new version make sure that the - ATLAS_OSTYPE, ATLAS_MACHTYPE, and ATLAS_ISAEXT variables in - spkg-install remain in sync with atlas' CONFIG/include/atlconf.h - * The package is never installed on OS X, unless you set SAGE_ATLAS_ARCH. - -=== Patches === - * patches/detect.patch: Fix Itanium2 support on modern - RHEL 5 and SLES 10 systems, work around -m64 issue on Itanium2, - and correctly detect number and speed of CPUs on a bunch of systems. - * patches/arm_hard_floats.patch: make sure soft floats are not enforced on ARM. - * patches/Makefile.patch: fix clean target. - * patches/do_not_force_mutex.patch: always use assembly over mutex - since the mutex version fails to build a shared library. See #15045 - for details. - * patches/glibc_scanf_workaround.patch: Workaround for the scanf bug - in glibc-2.18 that breaks the atlas auto-tuning system. - -=== Configuration === -The package can be configured via three environment variables: - - * SAGE_ATLAS_LIB=path - If this environment variable is set, the libraries libatlas, - libcblas, liblapack, and libf77blas from the direcory "path" are - used and ATLAS is not compiled from source. The libraries can be - either static (endin in .a) or shared libraries (ending in .so or - .dylib). - - * SAGE_ATLAS_ARCH=arch[,isaext1][,isaext2]...[,isaextN] - The given architectural default and instruction set extensions are - used instead of the empirical tuning. Available architectures are - - POWER3, POWER4, POWER5, PPCG4, PPCG5, POWER6, POWER7, IBMz9, - IBMz10, IBMz196, x86x87, x86SSE1, x86SSE2, x86SSE3, P5, P5MMX, - PPRO, PII, PIII, PM, CoreSolo, CoreDuo, Core2Solo, Core2, Corei1, - Corei2, Atom, P4, P4E, Efficeon, K7, HAMMER, AMD64K10h, AMDDOZER, - UNKNOWNx86, IA64Itan, IA64Itan2, USI, USII, USIII, USIV, UST1, UST2, - UnknownUS, MIPSR1xK, MIPSICE9, ARMv6, ARMv7 - - and instruction set extensions are - - VSX, AltiVec, AVXMAC, AVXFMA4, AVX, SSE3, SSE2, SSE1, 3DNow, NEON - - In addition, you can also set - - - SAGE_ATLAS_ARCH=fast picks defaults for a modern (2-3 year old) - CPU of your processor line, and - - - SAGE_ATLAS_ARCH=base picks defaults that should work for a ~10 - year old CPU. - - For example, - - SAGE_ATLAS_ARCH=Corei2,AVX,SSE3,SSE2,SSE1 - - would be appropriate for a Core i7 CPU. - - * If SAGE_ATLAS_SAVE_ARCHDEF = is given, then a new archdef - file is created and saved to the given path. - diff --git a/build/pkgs/autotools/SPKG.txt b/build/pkgs/autotools/SPKG.rst similarity index 64% rename from build/pkgs/autotools/SPKG.txt rename to build/pkgs/autotools/SPKG.rst index 11919b30bfa..240889f2151 100644 --- a/build/pkgs/autotools/SPKG.txt +++ b/build/pkgs/autotools/SPKG.rst @@ -1,15 +1,17 @@ -= autotools = +autotools +========= -== Description == +Description +----------- This package contains a recent version of Texinfo, GNU m4, and help2man. It contains the git repository of autoconf, automake and libtool. -For the latter 3 packages (commonly referred to as "autotools"), -many different versions are installed, by checking out the versions -from the git repo and building/installing them separately. Since the -complete git repository is shipped in the spkg, this does not require -internet access. +For the latter 3 packages (commonly referred to as "autotools"), many +different versions are installed, by checking out the versions from the +git repo and building/installing them separately. Since the complete git +repository is shipped in the spkg, this does not require internet +access. For Texinfo, m4 and help2man, just one version is installed. These are prerequisites for autotools. Moreover, Texinfo is often needed for @@ -24,33 +26,41 @@ version is run. The goal of all this is to make it easier to patch configure.ac or Makefile.am files inside a spkg. By using the same version of autotools as originally used, the patch files should be relatively small. The environment variables AUTOCONF_VERSION, -AUTOMAKE_VERSION and LIBTOOL_VERSION can be used to override the -chosen version. +AUTOMAKE_VERSION and LIBTOOL_VERSION can be used to override the chosen +version. -== License == +License +------- GNU General Public License version 3 or later. -== Upstream Contact == -* http://www.gnu.org/software/texinfo/ -* http://www.gnu.org/software/m4/ -* http://www.gnu.org/software/help2man/ -* http://www.gnu.org/software/autoconf/ -* http://www.gnu.org/software/automake/ -* http://www.gnu.org/software/libtool/ +Upstream Contact +---------------- + +- http://www.gnu.org/software/texinfo/ +- http://www.gnu.org/software/m4/ +- http://www.gnu.org/software/help2man/ +- http://www.gnu.org/software/autoconf/ +- http://www.gnu.org/software/automake/ +- http://www.gnu.org/software/libtool/ -== Dependencies == +Dependencies +------------ To install the package: -* Perl -* Git + +- Perl +- Git To update the package: -* Sage with autotools package installed -* Internet access -== Special Update/Build Instructions == +- Sage with autotools package installed +- Internet access + + +Special Update/Build Instructions +--------------------------------- The file spkg-src can be used to automatically create the upstream tarball from the git repositories. This obviously requires internet @@ -60,6 +70,7 @@ The file version-list defines the list of versions installed by this spkg. If you edit this, you must update Makefile.build using the spkg-write-makefile script. After optionally updating the git repos using spkg-src, you need to run - ./spkg-write-makefile >Makefile.build -This must be run in a Sage shell, with the autotools spkg -installed. + + ./spkg-write-makefile >Makefile.build + +This must be run in a Sage shell, with the autotools spkg installed. diff --git a/build/pkgs/awali/SPKG.rst b/build/pkgs/awali/SPKG.rst new file mode 100644 index 00000000000..11142d87cee --- /dev/null +++ b/build/pkgs/awali/SPKG.rst @@ -0,0 +1,43 @@ +awali +===== + +Description +----------- + +Awali is a software platform dedicated to the computation of, and with, +finite state machines. Here finite state machines is to be understood in +the broadest possible sense: finite automata with output — often called +transducers then — or even more generally finite automata with +multiplicity, that is, automata that not only accept, or recognize, +sequences of symbols but compute for every such sequence a 'value' that +is associated with it and which can be taken in any semiring. Hence the +variety of situations that can thus be modellized. + +License +------- + +- GPL 3.0 + + +Upstream Contact +---------------- + +- Website: http://vaucanson-project.org/Awali/index.html +- Releases: http://files.vaucanson-project.org/tarballs/ + +Dependencies +------------ + +- Python +- CMake +- Cython +- ncurses + +- graphviz must be installed from your distro, and available in the + path. + + +Special Update/Build Instructions +--------------------------------- + +- None diff --git a/build/pkgs/awali/SPKG.txt b/build/pkgs/awali/SPKG.txt deleted file mode 100644 index 37d42039b32..00000000000 --- a/build/pkgs/awali/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= awali = - -== Description == - -Awali is a software platform dedicated to the computation of, and with, finite -state machines. Here finite state machines is to be understood in the broadest -possible sense: finite automata with output — often called transducers then — or -even more generally finite automata with multiplicity, that is, automata that -not only accept, or recognize, sequences of symbols but compute for every such -sequence a `value' that is associated with it and which can be taken in any -semiring. Hence the variety of situations that can thus be modellized. - -== License == - - * GPL 3.0 - -== Upstream Contact == - - * Website: http://vaucanson-project.org/Awali/index.html - * Releases: http://files.vaucanson-project.org/tarballs/ - -== Dependencies == - - * Python - * CMake - * Cython - * ncurses - - * graphviz must be installed from your distro, and available in the path. - -== Special Update/Build Instructions == - - * None diff --git a/build/pkgs/babel/SPKG.txt b/build/pkgs/babel/SPKG.rst similarity index 73% rename from build/pkgs/babel/SPKG.txt rename to build/pkgs/babel/SPKG.rst index ae0451d58be..265c2757cee 100644 --- a/build/pkgs/babel/SPKG.txt +++ b/build/pkgs/babel/SPKG.rst @@ -1,6 +1,8 @@ -= babel = +babel +===== -== Description == +Description +----------- Internationalization utilities diff --git a/build/pkgs/backports_abc/SPKG.txt b/build/pkgs/backports_abc/SPKG.rst similarity index 58% rename from build/pkgs/backports_abc/SPKG.txt rename to build/pkgs/backports_abc/SPKG.rst index e6f57200183..1d3d02d6a9e 100644 --- a/build/pkgs/backports_abc/SPKG.txt +++ b/build/pkgs/backports_abc/SPKG.rst @@ -1,18 +1,23 @@ -= backports_abc = +backports_abc +============= -== Description == +Description +----------- A backport of recent additions to the 'collections.abc' module. -== License == +License +------- Python Software Foundation License -== Upstream Contact == + +Upstream Contact +---------------- Home page: https://pypi.python.org/pypi/backports_abc -== Dependencies == +Dependencies +------------ Python, Setuptools - diff --git a/build/pkgs/backports_functools_lru_cache/SPKG.rst b/build/pkgs/backports_functools_lru_cache/SPKG.rst new file mode 100644 index 00000000000..b8bcbc948e7 --- /dev/null +++ b/build/pkgs/backports_functools_lru_cache/SPKG.rst @@ -0,0 +1,8 @@ +backports.functools_lru_cache +============================= + +Description +----------- + +A backport of functools.lru_cache from Python 3.3 as published at +ActiveState. diff --git a/build/pkgs/backports_functools_lru_cache/SPKG.txt b/build/pkgs/backports_functools_lru_cache/SPKG.txt deleted file mode 100644 index ecee62e1137..00000000000 --- a/build/pkgs/backports_functools_lru_cache/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= backports.functools_lru_cache = - -== Description == - -A backport of functools.lru_cache from Python 3.3 as published at ActiveState. diff --git a/build/pkgs/backports_shutil_get_terminal_size/SPKG.rst b/build/pkgs/backports_shutil_get_terminal_size/SPKG.rst new file mode 100644 index 00000000000..87dd9ddeeb8 --- /dev/null +++ b/build/pkgs/backports_shutil_get_terminal_size/SPKG.rst @@ -0,0 +1,7 @@ +backports.shutil_get_terminal_size +================================== + +Description +----------- + +A backport of the get_terminal_size function from Python 3.3's shutil. diff --git a/build/pkgs/backports_shutil_get_terminal_size/SPKG.txt b/build/pkgs/backports_shutil_get_terminal_size/SPKG.txt deleted file mode 100644 index 6aa6bcfc6ce..00000000000 --- a/build/pkgs/backports_shutil_get_terminal_size/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= backports.shutil_get_terminal_size = - -== Description == - -A backport of the get_terminal_size function from Python 3.3's shutil. diff --git a/build/pkgs/backports_ssl_match_hostname/SPKG.rst b/build/pkgs/backports_ssl_match_hostname/SPKG.rst new file mode 100644 index 00000000000..6e298bae7a6 --- /dev/null +++ b/build/pkgs/backports_ssl_match_hostname/SPKG.rst @@ -0,0 +1,31 @@ +backports.ssl_match_hostname +============================ + +Description +----------- + +This backport brings match_hostname() to users of Python 2.x + +License +------- + +Python Software Foundation License + + +Upstream Contact +---------------- + +Home page: https://pypi.python.org/pypi/backports.ssl_match_hostname + +Dependencies +------------ + +Python, Setuptools + + +Special Update/Build Instructions +--------------------------------- + +- Unpack the tarball +- rename backports.ssl_match_hostname -> backports_ssl_match_hostname +- Tar as backports_ssl_match_hostname.VERSION.tar.gz diff --git a/build/pkgs/backports_ssl_match_hostname/SPKG.txt b/build/pkgs/backports_ssl_match_hostname/SPKG.txt deleted file mode 100644 index 503b01228f0..00000000000 --- a/build/pkgs/backports_ssl_match_hostname/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= backports.ssl_match_hostname = - -== Description == - -This backport brings match_hostname() to users of -Python 2.x - -== License == - -Python Software Foundation License - -== Upstream Contact == - -Home page: https://pypi.python.org/pypi/backports.ssl_match_hostname - -== Dependencies == - -Python, Setuptools - -== Special Update/Build Instructions == - -* Unpack the tarball -* rename backports.ssl_match_hostname -> backports_ssl_match_hostname -* Tar as backports_ssl_match_hostname.VERSION.tar.gz diff --git a/build/pkgs/barvinok/SPKG.rst b/build/pkgs/barvinok/SPKG.rst new file mode 100644 index 00000000000..d24f1f0f9f7 --- /dev/null +++ b/build/pkgs/barvinok/SPKG.rst @@ -0,0 +1,20 @@ +barvinok +======== + +Description +----------- + +barvinok is a library for counting the number of integer points in +parametric and non-parametric polytopes as well as projections of such +sets. + +License +------- + +GPL v2 + + +Upstream Contact +---------------- + +- http://groups.google.com/group/isl-development diff --git a/build/pkgs/barvinok/SPKG.txt b/build/pkgs/barvinok/SPKG.txt deleted file mode 100644 index 6b658a9a21c..00000000000 --- a/build/pkgs/barvinok/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= barvinok = - -== Description == - -barvinok is a library for counting the number of integer points -in parametric and non-parametric polytopes as well as projections -of such sets. - -== License == - -GPL v2 - -== Upstream Contact == - - * http://groups.google.com/group/isl-development diff --git a/build/pkgs/benzene/SPKG.rst b/build/pkgs/benzene/SPKG.rst new file mode 100644 index 00000000000..cfec92c289a --- /dev/null +++ b/build/pkgs/benzene/SPKG.rst @@ -0,0 +1,29 @@ +Benzene +======= + +Description +----------- + +Benzene is a program for the efficient generation of all nonisomorphic +fusenes and benzenoids with a given number of faces. Fusenes are planar +polycyclic hydrocarbons with all bounded faces hexagons. Benzenoids are +fusenes that are subgraphs of the hexagonal lattice. + +License +------- + +Benzene is licensed under the GNU General Public License v2 or later +(June 2007) + + +Upstream Contact +---------------- + +Benzene was written by Gunnar Brinkmann and Gilles Caporossi. This +version was adapted by Gunnar Brinkmann and Nico Van Cleemput for +Grinvin. http://www.grinvin.org/ + +Dependencies +------------ + +- None diff --git a/build/pkgs/benzene/SPKG.txt b/build/pkgs/benzene/SPKG.txt deleted file mode 100644 index 58ff36aa478..00000000000 --- a/build/pkgs/benzene/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= Benzene = - -== Description == -Benzene is a program for the efficient generation of all nonisomorphic fusenes and benzenoids with a given number of faces. Fusenes are planar polycyclic hydrocarbons with all bounded faces hexagons. Benzenoids are fusenes that are subgraphs of the hexagonal lattice. - -== License == -Benzene is licensed under the GNU General Public License v2 or later ( June 2007 ) - -== Upstream Contact == -Benzene was written by Gunnar Brinkmann and Gilles Caporossi. This version was adapted by Gunnar Brinkmann and Nico Van Cleemput for Grinvin. -http://www.grinvin.org/ - -== Dependencies == - * None - diff --git a/build/pkgs/bleach/SPKG.txt b/build/pkgs/bleach/SPKG.rst similarity index 54% rename from build/pkgs/bleach/SPKG.txt rename to build/pkgs/bleach/SPKG.rst index d999ee7f8a5..c003a348c41 100644 --- a/build/pkgs/bleach/SPKG.txt +++ b/build/pkgs/bleach/SPKG.rst @@ -1,17 +1,23 @@ -= bleach = +bleach +====== -== Description == +Description +----------- An easy safelist-based HTML-sanitizing tool. -== License == +License +------- Apache License v2 -== Upstream Contact == + +Upstream Contact +---------------- Home Page: https://github.com/mozilla/bleach -== Dependencies == +Dependencies +------------ Python, html5lib, six diff --git a/build/pkgs/bliss/SPKG.rst b/build/pkgs/bliss/SPKG.rst new file mode 100644 index 00000000000..1ce6bbf9d56 --- /dev/null +++ b/build/pkgs/bliss/SPKG.rst @@ -0,0 +1,32 @@ + +bliss 0.73+debian-1 +=================== + +Description +----------- + +bliss is an open source tool for computing automorphism groups and +canonical forms of graphs. + +License +------- + +LGPL + + +Upstream Contact +---------------- + +Bliss is currently being maintained by Tommi Junttila and Petteri Kaski. + +http://www.tcs.tkk.fi/Software/bliss/index.html + +We apply patches generated from https://github.com/mkoeppe/bliss (branch +apply_debian_patches) as our upstream. This tracks the patches from the +Debian package, adding an autotools build system and adjusting the +include file locations. + +Dependencies +------------ + +None diff --git a/build/pkgs/bliss/SPKG.txt b/build/pkgs/bliss/SPKG.txt deleted file mode 100644 index cff1683e16e..00000000000 --- a/build/pkgs/bliss/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= bliss 0.73+debian-1 = - -== Description == - -bliss is an open source tool for computing automorphism groups and canonical -forms of graphs. - -== License == - -LGPL - -== Upstream Contact == - -Bliss is currently being maintained by Tommi Junttila and Petteri Kaski. - -http://www.tcs.tkk.fi/Software/bliss/index.html - -We apply patches generated from https://github.com/mkoeppe/bliss -(branch apply_debian_patches) as our upstream. This tracks the -patches from the Debian package, adding an autotools build system -and adjusting the include file locations. - -== Dependencies == - -None - diff --git a/build/pkgs/boost/SPKG.txt b/build/pkgs/boost/SPKG.rst similarity index 56% rename from build/pkgs/boost/SPKG.txt rename to build/pkgs/boost/SPKG.rst index 950edcbbcea..13fdbc2df52 100644 --- a/build/pkgs/boost/SPKG.txt +++ b/build/pkgs/boost/SPKG.rst @@ -1,17 +1,23 @@ -= boost = +boost +===== -== Description == +Description +----------- Boost provides free peer-reviewed portable C++ source libraries. -== License == +License +------- Boost software license (GPL compatible) -== Upstream Contact == + +Upstream Contact +---------------- Home page: http://boost.org -== Dependencies == +Dependencies +------------ None diff --git a/build/pkgs/boost_cropped/SPKG.rst b/build/pkgs/boost_cropped/SPKG.rst new file mode 100644 index 00000000000..33336a460f1 --- /dev/null +++ b/build/pkgs/boost_cropped/SPKG.rst @@ -0,0 +1,38 @@ +Boost +===== + +Description +----------- + +Boost provides free peer-reviewed portable C++ source libraries. + +We emphasize libraries that work well with the C++ Standard Library. +Boost libraries are intended to be widely useful, and usable across a +broad spectrum of applications. The Boost license encourages both +commercial and non-commercial use. + +We aim to establish "existing practice" and provide reference +implementations so that Boost libraries are suitable for eventual +standardization. Ten Boost libraries are already included in the C++ +Standards Committee's Library Technical Report (TR1) and will be in the +new C++0x Standard now being finalized. C++0x will also include several +more Boost libraries in addition to those from TR1. More Boost libraries +are proposed for TR2. + +Website: http://www.boost.org/ + +License +------- + +Boost Software License - see http://www.boost.org/users/license.html + + +Upstream Contact +---------------- + +See mailing list page at http://www.boost.org/community/groups.html + +Dependencies +------------ + +None diff --git a/build/pkgs/boost_cropped/SPKG.txt b/build/pkgs/boost_cropped/SPKG.txt deleted file mode 100644 index f23b9d5cc2c..00000000000 --- a/build/pkgs/boost_cropped/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= Boost = - -== Description == - -Boost provides free peer-reviewed portable C++ source libraries. - -We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use. - -We aim to establish "existing practice" and provide reference implementations so that Boost libraries are suitable for eventual standardization. Ten Boost libraries are already included in the C++ Standards Committee's Library Technical Report (TR1) and will be in the new C++0x Standard now being finalized. C++0x will also include several more Boost libraries in addition to those from TR1. More Boost libraries are proposed for TR2. - -Website: http://www.boost.org/ - -== License == - -Boost Software License - see http://www.boost.org/users/license.html - -== Upstream Contact == - -See mailing list page at http://www.boost.org/community/groups.html - -== Dependencies == - -None diff --git a/build/pkgs/brial/SPKG.txt b/build/pkgs/brial/SPKG.rst similarity index 89% rename from build/pkgs/brial/SPKG.txt rename to build/pkgs/brial/SPKG.rst index 3525513c243..93e89b2205f 100644 --- a/build/pkgs/brial/SPKG.txt +++ b/build/pkgs/brial/SPKG.rst @@ -1,6 +1,8 @@ -= BRiAl = +BRiAl +===== -== Description == +Description +----------- BRiAl is the successor to PolyBoRi. @@ -14,10 +16,13 @@ complex polynomial systems, as well as sophisticated and extendable strategies for Gröbner base computation. PolyBoRi features a powerful reference implementation for Gröbner basis computation. -== License == +License +------- GPL version 2 or later -== Upstream Contact == + +Upstream Contact +---------------- https://github.com/BRiAl/BRiAl diff --git a/build/pkgs/buckygen/SPKG.rst b/build/pkgs/buckygen/SPKG.rst new file mode 100644 index 00000000000..62409dc6a3e --- /dev/null +++ b/build/pkgs/buckygen/SPKG.rst @@ -0,0 +1,28 @@ +Buckygen +======== + +Description +----------- + +Buckygen is a program for the efficient generation of all nonisomorphic +fullerenes. These are triangulations where all vertices have degree 5 or +6. Or if the dual representation is used: cubic plane graphs where all +faces are pentagons or hexagons. + +License +------- + +Buckygen is licensed under the GNU General Public License v3 ( June 2007 +) + + +Upstream Contact +---------------- + +Buckygen was mainly written by Jan Goedgebeur, +jan.goedgebeur[at]ugent.be. http://caagt.ugent.be/buckygen/ + +Dependencies +------------ + +- None diff --git a/build/pkgs/buckygen/SPKG.txt b/build/pkgs/buckygen/SPKG.txt deleted file mode 100644 index 884f75d275d..00000000000 --- a/build/pkgs/buckygen/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= Buckygen = - -== Description == -Buckygen is a program for the efficient generation of all nonisomorphic fullerenes. These are triangulations where all vertices have degree 5 or 6. Or if the dual representation is used: cubic plane graphs where all faces are pentagons or hexagons. - -== License == -Buckygen is licensed under the GNU General Public License v3 ( June 2007 ) - -== Upstream Contact == -Buckygen was mainly written by Jan Goedgebeur, jan.goedgebeur[at]ugent.be. -http://caagt.ugent.be/buckygen/ - -== Dependencies == - * None - diff --git a/build/pkgs/bzip2/SPKG.txt b/build/pkgs/bzip2/SPKG.rst similarity index 58% rename from build/pkgs/bzip2/SPKG.txt rename to build/pkgs/bzip2/SPKG.rst index 63950e6014d..b6aeb3c0d61 100644 --- a/build/pkgs/bzip2/SPKG.txt +++ b/build/pkgs/bzip2/SPKG.rst @@ -1,6 +1,8 @@ -= bzip2 = +bzip2 +===== -== Description == +Description +----------- bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available @@ -8,25 +10,33 @@ techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression. -== License == +License +------- BSD-style -== Upstream Contact == - * Website http://bzip.org/ - * Author: Julian Seward +Upstream Contact +---------------- -== Dependencies == +- Website http://bzip.org/ +- Author: Julian Seward + +Dependencies +------------ None -== Special Update/Build Instructions == -This package must not be bzip2 compressed, so create it using -tar c bzip2-1.0.6 | gzip --best >bzip2-1.0.6.spkg +Special Update/Build Instructions +--------------------------------- + +This package must not be bzip2 compressed, so create it using :: + + tar c bzip2-1.0.6 | gzip --best >bzip2-1.0.6.spkg -The build system has been autotoolized based on a patch by the Suse folk at +The build system has been autotoolized based on a patch by the Suse folk +at http://ftp.uni-kl.de/pub/linux/suse/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6-autoconfiscated.patch See patches/autotools and spkg-src for details. diff --git a/build/pkgs/cbc/SPKG.rst b/build/pkgs/cbc/SPKG.rst new file mode 100644 index 00000000000..44c316385c8 --- /dev/null +++ b/build/pkgs/cbc/SPKG.rst @@ -0,0 +1,35 @@ + +COIN-OR / CBC +============= + +Description +----------- + +The Computational Infrastructure for Operations Research (COIN-OR**, or +simply COIN) project is an initiative to spur the development of +open-source software for the operations research community. + +The COIN Branch and Cut solver (CBC) is an open-source mixed-integer +program (MIP) solver written in C++. CBC is intended to be used +primarily as a callable library to create customized branch-and-cut +solvers. A basic, stand-alone executable version is also available. CBC +is an active open-source project led by John Forrest at www.coin-or.org. + +License +------- + +Eclipse Public License, Version 1.0 (EPL-1.0) +(http://opensource.org/licenses/eclipse-1.0) + + +Upstream Contact +---------------- + +- John Forrest +- Robin Lougee-Heimer + + +Project Home Page +----------------- + +- https://projects.coin-or.org/Cbc diff --git a/build/pkgs/cbc/SPKG.txt b/build/pkgs/cbc/SPKG.txt deleted file mode 100644 index 5d0d63b3728..00000000000 --- a/build/pkgs/cbc/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= COIN-OR / CBC = - -== Description == - -The Computational Infrastructure for Operations Research (COIN-OR**, -or simply COIN) project is an initiative to spur the development of -open-source software for the operations research community. - -The COIN Branch and Cut solver (CBC) is an open-source -mixed-integer program (MIP) solver written in C++. CBC is intended to -be used primarily as a callable library to create customized -branch-and-cut solvers. A basic, stand-alone executable version is -also available. CBC is an active open-source project led by John -Forrest at www.coin-or.org. - -== License == - -Eclipse Public License, Version 1.0 (EPL-1.0) -(http://opensource.org/licenses/eclipse-1.0) - -== Upstream Contact == - - * John Forrest - * Robin Lougee-Heimer - -== Project Home Page == - - * https://projects.coin-or.org/Cbc diff --git a/build/pkgs/ccache/SPKG.rst b/build/pkgs/ccache/SPKG.rst new file mode 100644 index 00000000000..bade4edeb0b --- /dev/null +++ b/build/pkgs/ccache/SPKG.rst @@ -0,0 +1,22 @@ +ccache +====== + +Description +----------- + +ccache is a compiler cache. It speeds up recompilation by caching +previous compilations and detecting when the same compilation is being +done again. Supported languages are C, C++, Objective-C and +Objective-C++. + +License +------- + +GNU General Public License version 3 or later + + +Upstream Contact +---------------- + +- Author: Andrew Tridgell +- Website: http://ccache.samba.org/ diff --git a/build/pkgs/ccache/SPKG.txt b/build/pkgs/ccache/SPKG.txt deleted file mode 100644 index f8abc4bb638..00000000000 --- a/build/pkgs/ccache/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= ccache = - -== Description == - -ccache is a compiler cache. It speeds up recompilation by caching -previous compilations and detecting when the same compilation is being -done again. -Supported languages are C, C++, Objective-C and Objective-C++. - -== License == - -GNU General Public License version 3 or later - -== Upstream Contact == - - * Author: Andrew Tridgell - * Website: http://ccache.samba.org/ diff --git a/build/pkgs/cddlib/SPKG.rst b/build/pkgs/cddlib/SPKG.rst new file mode 100644 index 00000000000..406cfb74d91 --- /dev/null +++ b/build/pkgs/cddlib/SPKG.rst @@ -0,0 +1,38 @@ +cddlib +====== + +Description +----------- + +The C-library cddlib is a C implementation of the Double Description +Method of Motzkin et al. for generating all vertices (i.e. extreme +points) and extreme rays of a general convex polyhedron in R^d given by +a system of linear inequalities: + + P = { x=(x1, ..., xd)^T : b - A x >= 0 } + +where A is a given m x d real matrix, b is a given m-vector and 0 is the +m-vector of all zeros. + +The program can be used for the reverse operation (i.e. convex hull +computation). This means that one can move back and forth between an +inequality representation and a generator (i.e. vertex and ray) +representation of a polyhedron with cdd. Also, cdd can solve a linear +programming problem, i.e. a problem of maximizing and minimizing a +linear function over P. + +License +------- + +GPL v2 + + +Upstream Contact +---------------- + +https://github.com/cddlib/cddlib + +Dependencies +------------ + +- gmp (or its fork mpir) diff --git a/build/pkgs/cddlib/SPKG.txt b/build/pkgs/cddlib/SPKG.txt deleted file mode 100644 index 3254e8cef89..00000000000 --- a/build/pkgs/cddlib/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= cddlib = - -== Description == -The C-library cddlib is a C implementation of the Double Description -Method of Motzkin et al. for generating all vertices (i.e. extreme points) -and extreme rays of a general convex polyhedron in R^d given by a system -of linear inequalities: - - P = { x=(x1, ..., xd)^T : b - A x >= 0 } - -where A is a given m x d real matrix, b is a given m-vector -and 0 is the m-vector of all zeros. - -The program can be used for the reverse operation (i.e. convex hull -computation). This means that one can move back and forth between -an inequality representation and a generator (i.e. vertex and ray) -representation of a polyhedron with cdd. Also, cdd can solve a linear -programming problem, i.e. a problem of maximizing and minimizing -a linear function over P. - -== License == -GPL v2 - -== Upstream Contact == -https://github.com/cddlib/cddlib - -== Dependencies == - * gmp (or its fork mpir) diff --git a/build/pkgs/certifi/SPKG.txt b/build/pkgs/certifi/SPKG.rst similarity index 52% rename from build/pkgs/certifi/SPKG.txt rename to build/pkgs/certifi/SPKG.rst index 3985ae82ea4..9fc7bde2d70 100644 --- a/build/pkgs/certifi/SPKG.txt +++ b/build/pkgs/certifi/SPKG.rst @@ -1,18 +1,23 @@ -= Certifi = +Certifi +======= -== Description == +Description +----------- Python package for providing Mozilla's CA Bundle. -== License == +License +------- ISC -== Upstream Contact == + +Upstream Contact +---------------- Home page: https://pypi.python.org/pypi/certifi -== Dependencies == +Dependencies +------------ Python, Setuptools - diff --git a/build/pkgs/cliquer/SPKG.txt b/build/pkgs/cliquer/SPKG.rst similarity index 50% rename from build/pkgs/cliquer/SPKG.txt rename to build/pkgs/cliquer/SPKG.rst index 1dfd7d48e6d..4f65497f1c8 100644 --- a/build/pkgs/cliquer/SPKG.txt +++ b/build/pkgs/cliquer/SPKG.rst @@ -1,19 +1,31 @@ -= Cliquer = +Cliquer +======= + +Description +----------- -== Description == Cliquer is a set of C routines for finding cliques in an arbitrary weighted graph. It uses an exact branch-and-bound algorithm recently developed by Patr Ostergard. -== License == +License +------- + GNU General Public License v2 -== Upstream Contact == -Cliquer was mainly written by Sampo Niskanen, sampo.niskanenQiki.fi (Q=@). -http://users.tkk.fi/pat/cliquer.html -== Dependencies == - * None +Upstream Contact +---------------- + +Cliquer was mainly written by Sampo Niskanen, sampo.niskanenQiki.fi +(Q=@). http://users.tkk.fi/pat/cliquer.html + +Dependencies +------------ + +- None + +Patches +------- -== Patches == - * autotoolized - see https://github.com/dimpase/autocliquer +- autotoolized - see https://github.com/dimpase/autocliquer diff --git a/build/pkgs/cmake/SPKG.rst b/build/pkgs/cmake/SPKG.rst new file mode 100644 index 00000000000..549a231f8dc --- /dev/null +++ b/build/pkgs/cmake/SPKG.rst @@ -0,0 +1,37 @@ +CMake +===== + +Description +----------- + +The "cmake" executable is the CMake command-line interface. It may be +used to configure projects in scripts. Project configuration settings +may be specified on the command line with the -D option. The -i option +will cause cmake to interactively prompt for such settings. + +CMake is a cross-platform build system generator. Projects specify their +build process with platform-independent CMake listfiles included in each +directory of a source tree with the name CMakeLists.txt. Users build a +project by using CMake to generate a build system for a native tool on +their platform. + +Website: www.cmake.org + +License +------- + +CMake is distributed under the OSI-approved BSD 3-clause License. + + +Upstream Contact +---------------- + +- cmake-developers@cmake.org + +Dependencies +------------ + +- curl +- zlib +- bzip2 +- xz diff --git a/build/pkgs/cmake/SPKG.txt b/build/pkgs/cmake/SPKG.txt deleted file mode 100644 index 57770de3604..00000000000 --- a/build/pkgs/cmake/SPKG.txt +++ /dev/null @@ -1,32 +0,0 @@ -= CMake = - -== Description == - -The "cmake" executable is the CMake command-line interface. It may be -used to configure projects in scripts. Project configuration settings -may be specified on the command line with the -D option. The -i -option will cause cmake to interactively prompt for such settings. - -CMake is a cross-platform build system generator. Projects specify -their build process with platform-independent CMake listfiles -included in each directory of a source tree with the name -CMakeLists.txt. Users build a project by using CMake to generate a -build system for a native tool on their platform. - -Website: www.cmake.org - -== License == - -CMake is distributed under the OSI-approved BSD 3-clause License. - -== Upstream Contact == - - * cmake-developers@cmake.org - -== Dependencies == - -* curl -* zlib -* bzip2 -* xz - diff --git a/build/pkgs/cocoalib/SPKG.rst b/build/pkgs/cocoalib/SPKG.rst new file mode 100644 index 00000000000..94e820a9aae --- /dev/null +++ b/build/pkgs/cocoalib/SPKG.rst @@ -0,0 +1,32 @@ +cocoalib +======== + +Description +----------- + +CoCoA is a program to compute with numbers and polynomials. + +License +------- + +- GPL v3 + + +Upstream Contact +---------------- + +- Authors: http://cocoa.dima.unige.it/research/ +- Email: cocoa@dima.unige.it +- Website: http://cocoa.dima.unige.it/ +- Releases: http://cocoa.dima.unige.it/cocoalib/ + +Dependencies +------------ + +- GMP/MPIR + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/cocoalib/SPKG.txt b/build/pkgs/cocoalib/SPKG.txt deleted file mode 100644 index 153cf580470..00000000000 --- a/build/pkgs/cocoalib/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= cocoalib = - -== Description == - -CoCoA is a program to compute with numbers and polynomials. - -== License == - - * GPL v3 - -== Upstream Contact == - - * Authors: http://cocoa.dima.unige.it/research/ - * Email: cocoa@dima.unige.it - * Website: http://cocoa.dima.unige.it/ - * Releases: http://cocoa.dima.unige.it/cocoalib/ - -== Dependencies == - - * GMP/MPIR - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/combinatorial_designs/SPKG.rst b/build/pkgs/combinatorial_designs/SPKG.rst new file mode 100644 index 00000000000..59ad44d893b --- /dev/null +++ b/build/pkgs/combinatorial_designs/SPKG.rst @@ -0,0 +1,27 @@ + +Combinatorial Designs +===================== + +Description +----------- + +Data for Combinatorial Designs. Current content: + +- The table of MOLS (10 000 integers) from the Handbook of + Combinatorial Designs, 2ed. + +License +------- + +Public domain. + + +Upstream Contact +---------------- + + None + +Dependencies +------------ + +N/A diff --git a/build/pkgs/combinatorial_designs/SPKG.txt b/build/pkgs/combinatorial_designs/SPKG.txt deleted file mode 100644 index 197b3cd928b..00000000000 --- a/build/pkgs/combinatorial_designs/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= Combinatorial Designs = - -== Description == - -Data for Combinatorial Designs. Current content: - -- The table of MOLS (10 000 integers) from the Handbook of Combinatorial - Designs, 2ed. - -== License == - -Public domain. - -== Upstream Contact == - - None - -== Dependencies == - -N/A - diff --git a/build/pkgs/compilerwrapper/SPKG.rst b/build/pkgs/compilerwrapper/SPKG.rst new file mode 100644 index 00000000000..0f702b4f423 --- /dev/null +++ b/build/pkgs/compilerwrapper/SPKG.rst @@ -0,0 +1,35 @@ + +Compiler Wrapper +================ + +Description +----------- + +A wrapper for compiler and binutils that sets rpath, removes +optimizations on broken archs and gcc versions, and generally helps to +compile Sage more easily. + +License +------- + +GPL v2+ + + +Upstream Contact +---------------- + +- https://bitbucket.org/vbraun/compilerwrapper +- Volker Braun + +Dependencies +------------ + +- None + + +Special Update/Build Instructions +--------------------------------- + +The src/ subdirectory is a clone of my mercurial repository at +https://bitbucket.org/vbraun/compilerwrapper. You can update the source +tree with "hg pull -u". diff --git a/build/pkgs/compilerwrapper/SPKG.txt b/build/pkgs/compilerwrapper/SPKG.txt deleted file mode 100644 index 8f364a787ff..00000000000 --- a/build/pkgs/compilerwrapper/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= Compiler Wrapper = - -== Description == - -A wrapper for compiler and binutils that sets rpath, removes -optimizations on broken archs and gcc versions, and generally helps to -compile Sage more easily. - -== License == - -GPL v2+ - -== Upstream Contact == - -https://bitbucket.org/vbraun/compilerwrapper -Volker Braun - -== Dependencies == - - * None - -== Special Update/Build Instructions == - -The src/ subdirectory is a clone of my mercurial repository at -https://bitbucket.org/vbraun/compilerwrapper. You can update the -source tree with "hg pull -u". diff --git a/build/pkgs/configparser/SPKG.txt b/build/pkgs/configparser/SPKG.rst similarity index 83% rename from build/pkgs/configparser/SPKG.txt rename to build/pkgs/configparser/SPKG.rst index 6c687197d7d..a059c92aa0e 100644 --- a/build/pkgs/configparser/SPKG.txt +++ b/build/pkgs/configparser/SPKG.rst @@ -1,8 +1,11 @@ -= configparser = +configparser +============ -== Description == +Description +----------- -This library brings the updated configparser from Python 3.5 to Python 2.6-3.5. +This library brings the updated configparser from Python 3.5 to Python +2.6-3.5. The ancient ConfigParser module available in the standard library 2.x has seen a major update in Python 3.2. This is a backport of those @@ -11,12 +14,12 @@ changes so that they can be used directly in Python 2.6 - 3.5. To use the configparser backport instead of the built-in version on both Python 2 and Python 3, simply import it explicitly as a backport: - from backports import configparser + from backports import configparser If you'd like to use the backport on Python 2 and the built-in version on Python 3, use that invocation instead: - import configparser + import configparser For detailed documentation consult the vanilla version at http://docs.python.org/3/library/configparser.html. diff --git a/build/pkgs/configure/SPKG.txt b/build/pkgs/configure/SPKG.rst similarity index 57% rename from build/pkgs/configure/SPKG.txt rename to build/pkgs/configure/SPKG.rst index 72f87196c77..4927e8d64d1 100644 --- a/build/pkgs/configure/SPKG.txt +++ b/build/pkgs/configure/SPKG.rst @@ -1,25 +1,33 @@ -= Configure = +Configure +========= -== Description == +Description +----------- This package contains a tar archive of auto-generated files. They are shipped with Sage in case you do not have a sufficiently recent autotools version installed. -== License == +License +------- GPLv3+ -== Upstream Contact == +Upstream Contact +---------------- -Automatically generated by Sage, use trac and/or sage-devel for questions. +Automatically generated by Sage, use trac and/or sage-devel for +questions. -== Dependencies == +Dependencies +------------ None -== Special Update/Build Instructions == + +Special Update/Build Instructions +--------------------------------- This tarball is automatically generated by Sage whenever you run the $SAGE_ROOT/bootstrap -s or the $SAGE_ROOT/src/bin/sage-update-version diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index 4c52d48dc9f..87816b1af1c 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=1c21f6e635a7b999032dfb5e3bd569fca562cead -md5=b18610cb53599bfff817e4d1f26d09ef -cksum=763933029 +sha1=b46c24804d86a51b879c6bb187fe5e61b391c35b +md5=e1688a365fcadb8e9a82fbf598973b89 +cksum=189029443 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index c881e48d22b..5560beb0ced 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -982d86df0eb7517b9aed2a911e76ed5dd96fe1ac +2fb1ae046cb7336b4e54f668084d7b773e3a8151 diff --git a/build/pkgs/conway_polynomials/SPKG.rst b/build/pkgs/conway_polynomials/SPKG.rst new file mode 100644 index 00000000000..16036a280f2 --- /dev/null +++ b/build/pkgs/conway_polynomials/SPKG.rst @@ -0,0 +1,13 @@ + +Conway Polynomials Database +=========================== + +Description +----------- + + Contains a small database of Conway polynomials. + +Dependencies +------------ + +- Sage library diff --git a/build/pkgs/conway_polynomials/SPKG.txt b/build/pkgs/conway_polynomials/SPKG.txt deleted file mode 100644 index 7a2ddc1e5d2..00000000000 --- a/build/pkgs/conway_polynomials/SPKG.txt +++ /dev/null @@ -1,10 +0,0 @@ -= Conway Polynomials Database = - -== Description == - - Contains a small database of Conway polynomials. - -== Dependencies == - - * Sage library - diff --git a/build/pkgs/coxeter3/SPKG.rst b/build/pkgs/coxeter3/SPKG.rst new file mode 100644 index 00000000000..fc198fa9814 --- /dev/null +++ b/build/pkgs/coxeter3/SPKG.rst @@ -0,0 +1,54 @@ +coxeter3 +======== + +Description +----------- + +This package wraps Fokko Ducloux's Coxeter 3 C++ library + +Features: + +- General Coxeter groups, implemented through the combinatorics of + reduced words; +- Reduced expression and normal form computations; +- Bruhat ordering; +- Ordinary Kazhdan-Lusztig polynomials; +- Kazhdan-Lusztig polynomials with unequal parameters; +- Inverse Kazhdan-Lusztig polynomials; +- Cells and W-graphs; + +http://math.univ-lyon1.fr/~ducloux/coxeter/coxeter3/english/coxeter3_e.html + +This is a patched version done by Mike Hansen 2009-2013 and some fixes +by Nicolas M. Thiéry and Jean-Pierre Flori. + +License +------- + +GPL + + +Upstream Contact +---------------- + +github: https://github.com/tscrim/coxeter + +Alas, Fokko Ducloux passed away in 2006. + +http://math.univ-lyon1.fr/~ducloux/du_Cloux.html + +Dependencies +------------ + +None + + +Special Update/Build Instructions +--------------------------------- + +The source package was created by running :: + + commit=8ac9c71723c8ca57a836d6381aed125261e44e9e + git clone https://github.com/tscrim/coxeter.git + cd coxeter + git archive $commit | bzip2 --best >coxeter-$commit.tar.bz2 diff --git a/build/pkgs/coxeter3/SPKG.txt b/build/pkgs/coxeter3/SPKG.txt deleted file mode 100644 index 773bfc87ab8..00000000000 --- a/build/pkgs/coxeter3/SPKG.txt +++ /dev/null @@ -1,45 +0,0 @@ -= coxeter3 = - -== Description == - -This package wraps Fokko Ducloux's Coxeter 3 C++ library - -Features: - -- General Coxeter groups, implemented through the combinatorics of reduced words; -- Reduced expression and normal form computations; -- Bruhat ordering; -- Ordinary Kazhdan-Lusztig polynomials; -- Kazhdan-Lusztig polynomials with unequal parameters; -- Inverse Kazhdan-Lusztig polynomials; -- Cells and W-graphs; - -http://math.univ-lyon1.fr/~ducloux/coxeter/coxeter3/english/coxeter3_e.html - -This is a patched version done by Mike Hansen 2009-2013 and some fixes -by Nicolas M. Thiéry and Jean-Pierre Flori. - -== License == - -GPL - -== Upstream Contact == - -github: https://github.com/tscrim/coxeter - -Alas, Fokko Ducloux passed away in 2006. - -http://math.univ-lyon1.fr/~ducloux/du_Cloux.html - -== Dependencies == - -None - -== Special Update/Build Instructions == - -The source package was created by running - -commit=8ac9c71723c8ca57a836d6381aed125261e44e9e -git clone https://github.com/tscrim/coxeter.git -cd coxeter -git archive $commit |bzip2 --best >coxeter-$commit.tar.bz2 diff --git a/build/pkgs/cryptominisat/SPKG.rst b/build/pkgs/cryptominisat/SPKG.rst new file mode 100644 index 00000000000..6f7f0ce55d0 --- /dev/null +++ b/build/pkgs/cryptominisat/SPKG.rst @@ -0,0 +1,37 @@ +CryptoMiniSat +============= + +Description +----------- + + CryptoMiniSat is a SAT solver that aims to become a premiere SAT + solver with all the features and speed of successful SAT solvers, + such as MiniSat and PrecoSat. The long-term goals of CryptoMiniSat + are to be an efficient sequential, parallel and distributed + solver. There are solvers that are good at one or the other, + e.g. ManySat (parallel) or PSolver (distributed), but we wish to + excel at all. + + CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted + by researchers and industry. + +License +------- + +MIT License + + +Upstream Contact +---------------- + +- Authors: Mate Soos +- Email: soos.mate@gmail.com +- Website: http://www.msoos.org/ +- Releases: https://github.com/msoos/cryptominisat/releases + + +Special Update/Build Instructions +--------------------------------- + +CryptoMiniSat's tarball downloaded from github is called VERSION.tar.gz +and should be renamed to cryptominisat-VERSION.tar.gz diff --git a/build/pkgs/cryptominisat/SPKG.txt b/build/pkgs/cryptominisat/SPKG.txt deleted file mode 100644 index c1ee354a588..00000000000 --- a/build/pkgs/cryptominisat/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= CryptoMiniSat = - -== Description == - - CryptoMiniSat is a SAT solver that aims to become a premiere SAT - solver with all the features and speed of successful SAT solvers, - such as MiniSat and PrecoSat. The long-term goals of CryptoMiniSat - are to be an efficient sequential, parallel and distributed - solver. There are solvers that are good at one or the other, - e.g. ManySat (parallel) or PSolver (distributed), but we wish to - excel at all. - - CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted - by researchers and industry. - -== License == - -MIT License - -== Upstream Contact == - - * Authors: Mate Soos - * Email: soos.mate@gmail.com - * Website: http://www.msoos.org/ - * Releases: https://github.com/msoos/cryptominisat/releases - -== Special Update/Build Instructions == - -CryptoMiniSat's tarball downloaded from github is called VERSION.tar.gz -and should be renamed to cryptominisat-VERSION.tar.gz - diff --git a/build/pkgs/csdp/SPKG.rst b/build/pkgs/csdp/SPKG.rst new file mode 100644 index 00000000000..88b87acaa88 --- /dev/null +++ b/build/pkgs/csdp/SPKG.rst @@ -0,0 +1,52 @@ +csdp +==== + +Description +----------- + +This is a fast SDP solver written in C, with a callable library namely, +an autotool'ed version of CSDP, by Brian Borchers, see +https://projects.coin-or.org/Csdp + +License +------- + +Common Public License Version 1.0 + + +Upstream Contact +---------------- + +Dmitrii Pasechnik + +Dependencies +------------ + + +Special Update/Build Instructions +--------------------------------- + +csdp is an autotool'ed version of CSDP, see +https://projects.coin-or.org/Csdp, developed in its own repository at +http://github.org/dimpase/csdp. + +To update to a new version, you need to bump the version number in +configure.ac and rerun autotools (autoreconf -fiv). Any changes should +be merged to the upstream repo. + +The build is done with NOSHORTS variable defined; this makes it +compatible with packages, where NOSHORTS must be defined, e.g. +https://github.com/dimpase/pycsdp; also the Sage Cython interface needs +NOSHORTS defined. + +Detailed steps to build the spkg are as follows. You need + +- git +- autotools and libtool (the full autohell suite, version at least + 2.67) + +With these ready: + +- ./spkg-src +- copy the resulting csdp-.tar.gz to SAGE_ROOT/upstream, + or somewhere else appropriate diff --git a/build/pkgs/csdp/SPKG.txt b/build/pkgs/csdp/SPKG.txt deleted file mode 100644 index 993a28bb3c0..00000000000 --- a/build/pkgs/csdp/SPKG.txt +++ /dev/null @@ -1,41 +0,0 @@ -= csdp = - -== Description == - -This is a fast SDP solver written in C, with a callable library -namely, an autotool'ed version of CSDP, by Brian Borchers, -see https://projects.coin-or.org/Csdp - -== License == - -Common Public License Version 1.0 - -== Upstream Contact == - -Dmitrii Pasechnik - -== Dependencies == - - -== Special Update/Build Instructions == - -csdp is an autotool'ed version of CSDP, see https://projects.coin-or.org/Csdp, -developed in its own repository at http://github.org/dimpase/csdp. - -To update to a new version, you need to bump the version number in -configure.ac and rerun autotools (autoreconf -fiv). -Any changes should be merged to the upstream repo. - -The build is done with NOSHORTS variable defined; this makes it compatible -with packages, where NOSHORTS must be defined, e.g. -https://github.com/dimpase/pycsdp; -also the Sage Cython interface needs NOSHORTS defined. - -Detailed steps to build the spkg are as follows. You need - * git - * autotools and libtool (the full autohell suite, version at least 2.67) - -With these ready: - * ./spkg-src - * copy the resulting csdp-.tar.gz to SAGE_ROOT/upstream, - or somewhere else appropriate diff --git a/build/pkgs/curl/SPKG.txt b/build/pkgs/curl/SPKG.rst similarity index 55% rename from build/pkgs/curl/SPKG.txt rename to build/pkgs/curl/SPKG.rst index 682d4e60574..a5afed66d66 100644 --- a/build/pkgs/curl/SPKG.txt +++ b/build/pkgs/curl/SPKG.rst @@ -1,23 +1,31 @@ -= curl = +curl +==== -== Description == +Description +----------- Multiprotocols data transfer library (and utility). -== License == +License +------- "MIT style license" : see file "COPYING" at the root of the source tarball, explanations at https://curl.haxx.se/docs/copyright.html. -== Upstream Contact == -According to the file README at the root of the tarball, contact is -done by mailing https://curl.haxx.se/mail/ +Upstream Contact +---------------- -== Dependencies == +According to the file README at the root of the tarball, contact is done +by mailing https://curl.haxx.se/mail/ + +Dependencies +------------ None listed. -== Special Update/Build Instructions == + +Special Update/Build Instructions +--------------------------------- None. diff --git a/build/pkgs/cvxopt/SPKG.rst b/build/pkgs/cvxopt/SPKG.rst new file mode 100644 index 00000000000..6ab03adb886 --- /dev/null +++ b/build/pkgs/cvxopt/SPKG.rst @@ -0,0 +1,56 @@ +CVXOPT +====== + +Description +----------- + +CVXOPT is a free software package for convex optimization based on the +Python programming language. It can be used with the interactive Python +interpreter, on the command line by executing Python scripts, or +integrated in other software via Python extension modules. Its main +purpose is to make the development of software for convex optimization +applications straightforward by building on Python's extensive standard +library and on the strengths of Python as a high-level programming +language. + + +Upstream Contact +---------------- + +- J. Dahl +- L. Vandenberghe + +Downloaded from http://cvxopt.org + +License +------- + +GPLv3 or later. Includes parts under GPLv2, GNU Lesser General Public +License, v2.1. See src/LICENSE for more details. (Sage-compatible) + +Dependencies +------------ + +- GNU patch +- GSL +- GLPK + + +Special Update/Build Instructions +--------------------------------- + +- cvxopt.h.patch: Fix building with GCC on Solaris. + +- setup.py.patch: look for libraries and includes in $SAGE_LOCAL + instead of /usr. Add fortran, blas,... libraries if needed. + Build with GSL and GLPK support. + +- remove doc/html/, as it can be rebuild by invoking 'sage -sh' and + running 'make html' in doc/ + +- TODO: Add more tests in spkg-check + +- TODO: one might want to enhance the code to allow other Sage + random sources, at the moment only GSL is used in CVXOPT-1.1.3 + spkg, apparently it will need an unclear to me "with seed(..)" + construct. diff --git a/build/pkgs/cvxopt/SPKG.txt b/build/pkgs/cvxopt/SPKG.txt deleted file mode 100644 index 1ca9865e016..00000000000 --- a/build/pkgs/cvxopt/SPKG.txt +++ /dev/null @@ -1,50 +0,0 @@ -= CVXOPT = - -== Description == - -CVXOPT is a free software package for convex optimization based on the -Python programming language. It can be used with the interactive -Python interpreter, on the command line by executing Python scripts, -or integrated in other software via Python extension modules. Its main -purpose is to make the development of software for convex optimization -applications straightforward by building on Python's extensive -standard library and on the strengths of Python as a high-level -programming language. - -== Upstream Contact == - - * J. Dahl - * L. Vandenberghe - -Downloaded from http://cvxopt.org - -== License == - -GPLv3 or later. Includes parts under GPLv2, -GNU Lesser General Public License, v2.1. See src/LICENSE for more details. -(Sage-compatible) - -== Dependencies == - - * GNU patch - * GSL - * GLPK - -== Special Update/Build Instructions == - - * cvxopt.h.patch: Fix building with GCC on Solaris. - - * setup.py.patch: look for libraries and includes in $SAGE_LOCAL - instead of /usr. Add fortran, blas,... libraries if needed. - Build with GSL and GLPK support. - - * remove doc/html/, as it can be rebuild by invoking 'sage -sh' and - running 'make html' in doc/ - - * TODO: Add more tests in spkg-check - - * TODO: one might want to enhance the code to allow other Sage - random sources, at the moment only GSL is used in CVXOPT-1.1.3 - spkg, apparently it will need an unclear to me "with seed(..)" - construct. - diff --git a/build/pkgs/cycler/SPKG.rst b/build/pkgs/cycler/SPKG.rst new file mode 100644 index 00000000000..7849d027a22 --- /dev/null +++ b/build/pkgs/cycler/SPKG.rst @@ -0,0 +1,29 @@ +cycler +====== + +Description +----------- + +Cycler is a small break of of matplotlib to deal with "composable +cycles". It is a required dependency of matplotlib 1.5.0. + +License +------- + +BSD + + +Upstream Contact +---------------- + +cycler is developed on github: https://github.com/matplotlib/cycler + +A more informative webpage about cycler, its motivation and usage is at +http://tacaswell.github.io/cycler/ + +Dependencies +------------ + +- python +- setuptools +- six diff --git a/build/pkgs/cycler/SPKG.txt b/build/pkgs/cycler/SPKG.txt deleted file mode 100644 index 2b8a4665363..00000000000 --- a/build/pkgs/cycler/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= cycler = - -== Description == - -Cycler is a small break of of matplotlib to -deal with "composable cycles". -It is a required dependency of matplotlib 1.5.0. - -== License == -BSD - -== Upstream Contact == - -cycler is developed on github: https://github.com/matplotlib/cycler - -A more informative webpage about cycler, its motivation and usage -is at http://tacaswell.github.io/cycler/ - -== Dependencies == - - * python - * setuptools - * six - diff --git a/build/pkgs/cygwin.txt b/build/pkgs/cygwin.txt index 51c562cb9b9..635afe8f9c9 100644 --- a/build/pkgs/cygwin.txt +++ b/build/pkgs/cygwin.txt @@ -13,7 +13,7 @@ binutils make m4 # a system python is needed for downloading the sage packages, https://trac.sagemath.org/ticket/29090 -python37-urllib python37 +python37-urllib3 python37 perl perl-ExtUtils-MakeMaker tar diff --git a/build/pkgs/cypari/SPKG.rst b/build/pkgs/cypari/SPKG.rst new file mode 100644 index 00000000000..c680d58e2d1 --- /dev/null +++ b/build/pkgs/cypari/SPKG.rst @@ -0,0 +1,26 @@ +cypari2 +======= + +Description +----------- + +A Python interface to the number theory library libpari. + +License +------- + +GPL version 2 or later + + +Upstream Contact +---------------- + +https://github.com/defeo/cypari2 + +Dependencies +------------ + +- Python +- Cython +- PARI +- cysignals diff --git a/build/pkgs/cypari/SPKG.txt b/build/pkgs/cypari/SPKG.txt deleted file mode 100644 index a4a383d0dde..00000000000 --- a/build/pkgs/cypari/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= cypari2 = - -== Description == - -A Python interface to the number theory library libpari. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -https://github.com/defeo/cypari2 - -== Dependencies == - -* Python -* Cython -* PARI -* cysignals diff --git a/build/pkgs/cysignals/SPKG.rst b/build/pkgs/cysignals/SPKG.rst new file mode 100644 index 00000000000..55f1e2b2dd0 --- /dev/null +++ b/build/pkgs/cysignals/SPKG.rst @@ -0,0 +1,25 @@ +cysignals +========= + +Description +----------- + +Interrupt and signal handling for Cython + +License +------- + +LGPL version 3 or later + + +Upstream Contact +---------------- + +https://github.com/sagemath/cysignals + +Dependencies +------------ + +- Python +- Cython +- PARI (optional) diff --git a/build/pkgs/cysignals/SPKG.txt b/build/pkgs/cysignals/SPKG.txt deleted file mode 100644 index acbf6169d3d..00000000000 --- a/build/pkgs/cysignals/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= cysignals = - -== Description == - -Interrupt and signal handling for Cython - -== License == - -LGPL version 3 or later - -== Upstream Contact == - -https://github.com/sagemath/cysignals - -== Dependencies == - -* Python -* Cython -* PARI (optional) diff --git a/build/pkgs/cython/SPKG.rst b/build/pkgs/cython/SPKG.rst new file mode 100644 index 00000000000..8c5b201c86c --- /dev/null +++ b/build/pkgs/cython/SPKG.rst @@ -0,0 +1,36 @@ +Cython +====== + +Description +----------- + +Cython is a language that makes writing C extensions for the Python +language as easy as Python itself. Cython is based on the well-known +Pyrex, but supports more cutting edge functionality and optimizations. + +The Cython language is very close to the Python language, but Cython +additio- nally supports calling C functions and declaring C types on +variables and class attributes. This allows the compiler to generate +very efficient C code from Cython code. + +This makes Cython the ideal language for wrapping for external C +libraries, and for fast C modules that speed up the execution of Python +code. + +Website: http://www.cython.org/ + +License +------- + +Apache License, Version 2.0 + + +Upstream Contact +---------------- + +- cython-devel@python.org + +Dependencies +------------ + +- Python diff --git a/build/pkgs/cython/SPKG.txt b/build/pkgs/cython/SPKG.txt deleted file mode 100644 index 6baffa31c41..00000000000 --- a/build/pkgs/cython/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= Cython = - -== Description == - -Cython is a language that makes writing C extensions for the Python language as -easy as Python itself. Cython is based on the well-known Pyrex, but supports -more cutting edge functionality and optimizations. - -The Cython language is very close to the Python language, but Cython additio- -nally supports calling C functions and declaring C types on variables and class -attributes. This allows the compiler to generate very efficient C code from -Cython code. - -This makes Cython the ideal language for wrapping for external C libraries, and -for fast C modules that speed up the execution of Python code. - -Website: http://www.cython.org/ - -== License == - -Apache License, Version 2.0 - -== Upstream Contact == - * cython-devel@python.org - -== Dependencies == - * Python diff --git a/build/pkgs/cython/checksums.ini b/build/pkgs/cython/checksums.ini index 7e9b0490f41..93cd5fb718a 100644 --- a/build/pkgs/cython/checksums.ini +++ b/build/pkgs/cython/checksums.ini @@ -1,4 +1,5 @@ tarball=Cython-VERSION.tar.gz -sha1=1c0c6cb9ebb875e8769863e1720683b24a755a7c -md5=f212574687a52706ff53738a64f91398 -cksum=1612385007 +sha1=02278e5a972ffc4856451f507903db68d08cfd6e +md5=0936311ccd09f1164ab2f46ca5cd8c3b +cksum=1144843552 +upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz diff --git a/build/pkgs/cython/package-version.txt b/build/pkgs/cython/package-version.txt index fe14ade44a2..9fe45285805 100644 --- a/build/pkgs/cython/package-version.txt +++ b/build/pkgs/cython/package-version.txt @@ -1 +1 @@ -0.29.12.p0 +0.29.17 diff --git a/build/pkgs/d3js/SPKG.rst b/build/pkgs/d3js/SPKG.rst new file mode 100644 index 00000000000..739f46f8f28 --- /dev/null +++ b/build/pkgs/d3js/SPKG.rst @@ -0,0 +1,37 @@ +d3js +==== + +Description +----------- + +D3.js is a JavaScript library for manipulating documents based on data. +The file d3.min.js will be placed into the ${SAGE_SHARE}/d3js/ +directory. + +License +------- + +BSD 3-Clause License + + +Upstream Contact +---------------- + +- Author: Mike Bostock (http://bost.ocks.org/mike/) +- Home page: http://d3js.org/ + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +Two kind of archives can be downloaded from d3.js website: one with all +source code and tests that weights 2,9M (both in zip and tar.gz formats) +and one with the final javascript scripts which weights 121K (zip format +only). Since testing requires node.js that is not shipped with Sage, we +currenlty ship the final js only. Hence we have to transform it from zip +to tar.gz format. Running sage-src should do all the repackaging job. diff --git a/build/pkgs/d3js/SPKG.txt b/build/pkgs/d3js/SPKG.txt deleted file mode 100644 index d7a80a3bc91..00000000000 --- a/build/pkgs/d3js/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= d3js = - -== Description == - -D3.js is a JavaScript library for manipulating documents based on data. -The file d3.min.js will be placed into the ${SAGE_SHARE}/d3js/ directory. - -== License == - -BSD 3-Clause License - -== Upstream Contact == - -Author: Mike Bostock (http://bost.ocks.org/mike/) -Home page: http://d3js.org/ - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -Two kind of archives can be downloaded from d3.js website: one with all source -code and tests that weights 2,9M (both in zip and tar.gz formats) and one with -the final javascript scripts which weights 121K (zip format only). Since -testing requires node.js that is not shipped with Sage, we currenlty ship the -final js only. Hence we have to transform it from zip to tar.gz format. -Running sage-src should do all the repackaging job. - diff --git a/build/pkgs/d3js/spkg-src b/build/pkgs/d3js/spkg-src index d8c8e66062e..134c8f0bc5d 100755 --- a/build/pkgs/d3js/spkg-src +++ b/build/pkgs/d3js/spkg-src @@ -36,6 +36,6 @@ mv "d3js-${ZIP_VERSION}.tar.gz" "${SAGE_ROOT}/upstream/" # update package info cd .. echo "${ZIP_VERSION}" > 'package-version.txt' -sage -sh 'sage-fix-pkg-checksums' +sage --package fix-checksum diff --git a/build/pkgs/database_cremona_ellcurve/SPKG.rst b/build/pkgs/database_cremona_ellcurve/SPKG.rst new file mode 100644 index 00000000000..6a2a75ecfbf --- /dev/null +++ b/build/pkgs/database_cremona_ellcurve/SPKG.rst @@ -0,0 +1,51 @@ +database_cremona_ellcurve +========================= + +Description +----------- + +John Cremona's database of elliptic curves + +See https://github.com/JohnCremona/ecdata + +This is an optional package, not included by default. + +License +------- + +Public Domain + +Dependencies +------------ + +None + +Patches +~~~~~~~ + +- None + + +Upstream Contact +---------------- + +- Author: John Cremona +- Email: john.cremona@gmail.com +- Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/ + + +Update Instructions +------------------- + +Get an up-to-date copy of the git repository ecdata from +https://github.com/JohnCremona/ecdata. + +If the cremona database has already been installed, remove +``SAGE_DATA/cremona/cremona.db``. Then run + +The build script expects to find the files in subfolders allcurves, +allgens, degphi and allbsd of the ecdata folder. It extracts them and +builds the new cremona.db file from the contents. + +Finally, copy ``SAGE_DATA/cremona/cremona.db`` to the src directory of +the spkg. diff --git a/build/pkgs/database_cremona_ellcurve/SPKG.txt b/build/pkgs/database_cremona_ellcurve/SPKG.txt deleted file mode 100644 index 88b2ba0f6af..00000000000 --- a/build/pkgs/database_cremona_ellcurve/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= database_cremona_ellcurve = - -== Description == -John Cremona's database of elliptic curves - -See https://github.com/JohnCremona/ecdata - -This is an optional package, not included by default. - -== License == -Public Domain - -== Dependencies == -None - -=== Patches === - * None - -== Upstream Contact == - - * Author: John Cremona - * Email: john.cremona@gmail.com - * Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/ - -== Update Instructions == - -Get an up-to-date copy of the git repository ecdata from -https://github.com/JohnCremona/ecdata. - -If the cremona database has already been installed, remove -`SAGE_DATA/cremona/cremona.db`. Then run - -{{{ -sage: C = sage.databases.cremona.LargeCremonaDatabase('cremona',False, True) -sage: C._init_from_ftpdata('path/to/ecdata/',0) -}}} - -The build script expects to find the files in subfolders allcurves, -allgens, degphi and allbsd of the ecdata folder. It extracts them and -builds the new cremona.db file from the contents. - -Finally, copy `SAGE_DATA/cremona/cremona.db` to the src directory of -the spkg. - diff --git a/build/pkgs/database_jones_numfield/SPKG.rst b/build/pkgs/database_jones_numfield/SPKG.rst new file mode 100644 index 00000000000..b19f9a99235 --- /dev/null +++ b/build/pkgs/database_jones_numfield/SPKG.rst @@ -0,0 +1,30 @@ +database_jones_numfield +======================= + +Description +----------- + +This is a table of number fields with bounded ramification and degree +at most 6. + +License +------- + +GPLv2+ + + +Upstream Contact +---------------- + +sage-devel@googlegroups.com + +Dependencies +------------ + +None + + +Special Update/Build Instructions +--------------------------------- + +Created by taking the original old-style spkg and removing crud from it. diff --git a/build/pkgs/database_jones_numfield/SPKG.txt b/build/pkgs/database_jones_numfield/SPKG.txt deleted file mode 100644 index 93d41c86cd3..00000000000 --- a/build/pkgs/database_jones_numfield/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= database_jones_numfield = - -== Description == - -This is a table of number fields with bounded ramification and degree ≤6. - -== License == - -GPLv2+ - -== Upstream Contact == - -sage-devel@googlegroups.com - -== Dependencies == - -None - -== Special Update/Build Instructions == - -Created by taking the original old-style spkg and removing crud from it. diff --git a/build/pkgs/database_kohel/SPKG.rst b/build/pkgs/database_kohel/SPKG.rst new file mode 100644 index 00000000000..2208efb7a9d --- /dev/null +++ b/build/pkgs/database_kohel/SPKG.rst @@ -0,0 +1,14 @@ + +Kohel database +============== + +Description +----------- + +Database of modular and Hilbert polynomials. + + +Upstream Contact +---------------- + +- David Kohel diff --git a/build/pkgs/database_kohel/SPKG.txt b/build/pkgs/database_kohel/SPKG.txt deleted file mode 100644 index ee24b701d92..00000000000 --- a/build/pkgs/database_kohel/SPKG.txt +++ /dev/null @@ -1,10 +0,0 @@ -= Kohel database = - -== Description == - -Database of modular and Hilbert polynomials. - -== Upstream Contact == - - * David Kohel - diff --git a/build/pkgs/database_mutation_class/SPKG.rst b/build/pkgs/database_mutation_class/SPKG.rst new file mode 100644 index 00000000000..fbf5ff84fc8 --- /dev/null +++ b/build/pkgs/database_mutation_class/SPKG.rst @@ -0,0 +1,33 @@ + +Mutation class database +======================= + +Description +----------- + +Contains a database of all exceptional mutation classes of quivers. + +Every file in the database is of the form +``mutation_classes_n.dig6`` for some ``n`` and + +- contains a ``cPickle.dump`` of a dictionary where +- the keys are tuples representing irreducible exceptional quiver + mutation types of rank ``n``, and +- the values are all quivers in the given mutation class stored in + canonical form as ``(dig6,edges)`` where +- ``dig6`` is the dig6 data of the given ``DiGraph``, and +- ``edges`` are the non-simply-laced edges thereof. +- is obtained by running the function + + ``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, types='Exceptional', verbose=False)`` + + +SPKG Maintainers +---------------- + +- C. Stump + +Dependencies +------------ + +- None diff --git a/build/pkgs/database_mutation_class/SPKG.txt b/build/pkgs/database_mutation_class/SPKG.txt deleted file mode 100644 index ae3facd5d3d..00000000000 --- a/build/pkgs/database_mutation_class/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= Mutation class database = - -== Description == - - Contains a database of all exceptional mutation classes of quivers. - - Every file in the database is of the form ``mutation_classes_n.dig6`` for some ``n`` and - - contains a ``cPickle.dump`` of a dictionary where - - the keys are tuples representing irreducible exceptional quiver mutation types of rank ``n``, and - - the values are all quivers in the given mutation class stored in canonical form as ``(dig6,edges)`` where - - ``dig6`` is the dig6 data of the given ``DiGraph``, and - - ``edges`` are the non-simply-laced edges thereof. - - is obtained by running the function - ``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, types='Exceptional', verbose=False)`` - -== SPKG Maintainers == - - * C. Stump - -== Dependencies == - - * None - diff --git a/build/pkgs/database_odlyzko_zeta/SPKG.txt b/build/pkgs/database_odlyzko_zeta/SPKG.rst similarity index 59% rename from build/pkgs/database_odlyzko_zeta/SPKG.txt rename to build/pkgs/database_odlyzko_zeta/SPKG.rst index 9103d0bd468..d0865cd907c 100644 --- a/build/pkgs/database_odlyzko_zeta/SPKG.txt +++ b/build/pkgs/database_odlyzko_zeta/SPKG.rst @@ -1,12 +1,16 @@ -= Zeros of the Riemann zeta function = -== Description == +Zeros of the Riemann zeta function +================================== + +Description +----------- Table of zeros of the Riemann zeta function by Andrew Odlyzko. This package contains the file 'zeros6' with the first 2,001,052 zeros of the Riemann zeta function, accurate to within 4*10^(-9). -== Dependencies == +Dependencies +------------ - * Sage library +- Sage library diff --git a/build/pkgs/database_stein_watkins/SPKG.txt b/build/pkgs/database_stein_watkins/SPKG.rst similarity index 60% rename from build/pkgs/database_stein_watkins/SPKG.txt rename to build/pkgs/database_stein_watkins/SPKG.rst index ee6ecb4349f..6cc091b8ec8 100644 --- a/build/pkgs/database_stein_watkins/SPKG.txt +++ b/build/pkgs/database_stein_watkins/SPKG.rst @@ -1,17 +1,26 @@ -= database_stein_watkins = +database_stein_watkins +====================== + +Description +----------- -== Description == The Stein-Watkins database of elliptic curves (full version) See http://modular.math.washington.edu/papers/stein-watkins/ This is an optional (huge) package, not included by default. -== License == +License +------- + Public Domain -== Dependencies == +Dependencies +------------ + None -=== Patches === - * None +Patches +~~~~~~~ + +None diff --git a/build/pkgs/database_stein_watkins_mini/SPKG.txt b/build/pkgs/database_stein_watkins_mini/SPKG.rst similarity index 57% rename from build/pkgs/database_stein_watkins_mini/SPKG.txt rename to build/pkgs/database_stein_watkins_mini/SPKG.rst index 41c575c9a9e..0147cca7e59 100644 --- a/build/pkgs/database_stein_watkins_mini/SPKG.txt +++ b/build/pkgs/database_stein_watkins_mini/SPKG.rst @@ -1,17 +1,26 @@ -= database_stein_watkins_mini = +database_stein_watkins_mini +=========================== + +Description +----------- -== Description == The Stein-Watkins database of elliptic curves (small version) See http://modular.math.washington.edu/papers/stein-watkins/ This is an optional package, not included by default. -== License == +License +------- + Public Domain -== Dependencies == +Dependencies +------------ + None -=== Patches === - * None +Patches +~~~~~~~ + +None diff --git a/build/pkgs/database_symbolic_data/SPKG.rst b/build/pkgs/database_symbolic_data/SPKG.rst new file mode 100644 index 00000000000..ba21d67d5f2 --- /dev/null +++ b/build/pkgs/database_symbolic_data/SPKG.rst @@ -0,0 +1,46 @@ +database_symbolic_data +====================== + +Description +----------- + +The SymbolicData project is set out + +- to develop concepts and tools for profiling, testing and benchmarking + Computer Algebra Software + (CAS) and + +- to collect and interlink relevant data and activities from different + Computer Algebra Communities. + +SymbolicData is an + +- inter-community project that has its roots in the activities of + different Computer Algebra Communities and +- aims at interlinking these activities using modern Semantic Web + concepts. + +Tools and data are designed to be used both + +- on a local site for special testing and profiling purposes +- and to manage a central repository at www.symbolicdata.org. + +License +------- + +GNU General Public License + + +Upstream Contact +---------------- + +- Andreas Nareike + +Dependencies +------------ + + +Special Update/Build Instructions +--------------------------------- + +List patches that need to be applied and what they do diff --git a/build/pkgs/database_symbolic_data/SPKG.txt b/build/pkgs/database_symbolic_data/SPKG.txt deleted file mode 100644 index 65c410df2a2..00000000000 --- a/build/pkgs/database_symbolic_data/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= database_symbolic_data = - -== Description == - -The SymbolicData project is set out - -* to develop concepts and tools for profiling, testing and benchmarking Computer Algebra Software - (CAS) and -* to collect and interlink relevant data and activities from different Computer Algebra Communities. - -SymbolicData is an - -* inter-community project that has its roots in the activities of different Computer Algebra Communities and -* aims at interlinking these activities using modern Semantic Web concepts. - -Tools and data are designed to be used both - -* on a local site for special testing and profiling purposes -* and to manage a central repository at www.symbolicdata.org. - -== License == - -GNU General Public License - -== Upstream Contact == - -* Andreas Nareike - -== Dependencies == - -== Special Update/Build Instructions == - -List patches that need to be applied and what they do - diff --git a/build/pkgs/dateutil/SPKG.rst b/build/pkgs/dateutil/SPKG.rst new file mode 100644 index 00000000000..6bfb61a0b6b --- /dev/null +++ b/build/pkgs/dateutil/SPKG.rst @@ -0,0 +1,26 @@ +dateutil +======== + +Description +----------- + +The dateutil module provides powerful extensions to the standard +datetime module. + +License +------- + +Simplified BSD License + + +Upstream Contact +---------------- + +Author: Gustavo Niemeyer Home page: +http://labix.org/python-dateutil + +Dependencies +------------ + +- Python +- Six diff --git a/build/pkgs/dateutil/SPKG.txt b/build/pkgs/dateutil/SPKG.txt deleted file mode 100644 index becf1aff84a..00000000000 --- a/build/pkgs/dateutil/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= dateutil = - -== Description == - -The dateutil module provides powerful extensions to the standard -datetime module. - -== License == - -Simplified BSD License - -== Upstream Contact == - -Author: Gustavo Niemeyer -Home page: http://labix.org/python-dateutil - -== Dependencies == - -* Python -* Six - diff --git a/build/pkgs/decorator/SPKG.txt b/build/pkgs/decorator/SPKG.rst similarity index 51% rename from build/pkgs/decorator/SPKG.txt rename to build/pkgs/decorator/SPKG.rst index 52aa0271d0a..cbc1b166e6c 100644 --- a/build/pkgs/decorator/SPKG.txt +++ b/build/pkgs/decorator/SPKG.rst @@ -1,5 +1,7 @@ -= decorator = +decorator +========= -== Description == +Description +----------- Better living through Python with decorators diff --git a/build/pkgs/deformation/SPKG.rst b/build/pkgs/deformation/SPKG.rst new file mode 100644 index 00000000000..f8cc5e2a22d --- /dev/null +++ b/build/pkgs/deformation/SPKG.rst @@ -0,0 +1,19 @@ +deformation +=========== + +Description +----------- + +Deformation is a C library for counting points on hypersurfaces using +the deformation method, developed by Sebastian Pancratz. + +License +------- + +GLPv3 + + +Upstream Contact +---------------- + +- Sebastian Pancratz: sebastian.pancratz@gmail.com diff --git a/build/pkgs/deformation/SPKG.txt b/build/pkgs/deformation/SPKG.txt deleted file mode 100644 index 4381842c04f..00000000000 --- a/build/pkgs/deformation/SPKG.txt +++ /dev/null @@ -1,14 +0,0 @@ -= deformation = - -== Description == - -Deformation is a C library for counting points on hypersurfaces -using the deformation method, developed by Sebastian Pancratz. - -== License == - -GLPv3 - -== Upstream Contact == - -* Sebastian Pancratz: sebastian.pancratz@gmail.com diff --git a/build/pkgs/defusedxml/SPKG.txt b/build/pkgs/defusedxml/SPKG.rst similarity index 53% rename from build/pkgs/defusedxml/SPKG.txt rename to build/pkgs/defusedxml/SPKG.rst index c3c8d65701d..e39d1435e33 100644 --- a/build/pkgs/defusedxml/SPKG.txt +++ b/build/pkgs/defusedxml/SPKG.rst @@ -1,23 +1,31 @@ -= defusedxml = +defusedxml +========== -== Description == +Description +----------- defusedxml addresses vulnerabilities of XML parsers and XML libraries. It became a dependency of nbconvert starting with nbconvert 5.4. -== License == +License +------- Python Software Foundation License (PSFL) -== Upstream Contact == + +Upstream Contact +---------------- https://pypi.org/project/defusedxml/ -== Dependencies == +Dependencies +------------ + +- pip -* pip -== Special Update/Build Instructions == +Special Update/Build Instructions +--------------------------------- None. diff --git a/build/pkgs/docutils/SPKG.txt b/build/pkgs/docutils/SPKG.rst similarity index 50% rename from build/pkgs/docutils/SPKG.txt rename to build/pkgs/docutils/SPKG.rst index 14e239e7537..0b3d2f4ab66 100644 --- a/build/pkgs/docutils/SPKG.txt +++ b/build/pkgs/docutils/SPKG.rst @@ -1,26 +1,32 @@ -= docutils = +docutils +======== -== Description == +Description +----------- Docutils is a modular system for processing documentation into useful formats, such as HTML, XML, and LaTeX. For input Docutils supports reStructuredText, an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax. -== License == +License +------- Modified BSD -== Upstream Contact == -Author: David Goodger -Home Page: http://docutils.sourceforge.net/ +Upstream Contact +---------------- -== Dependencies == +Author: David Goodger Home Page: http://docutils.sourceforge.net/ + +Dependencies +------------ None -== Special Update/Build Instructions == -None +Special Update/Build Instructions +--------------------------------- +None diff --git a/build/pkgs/dot2tex/SPKG.rst b/build/pkgs/dot2tex/SPKG.rst new file mode 100644 index 00000000000..2ba3d5aa3a7 --- /dev/null +++ b/build/pkgs/dot2tex/SPKG.rst @@ -0,0 +1,54 @@ +dot2tex +======= + +Description +----------- + +dot2tex is a Python module, whose purpose is to give graphs generated by +Graphviz a more LaTeX friendly look and feel. This is accomplished by +converting xdot output from Graphviz to a series of PSTricks or PGF/TikZ +commands. + +See https://github.com/kjellmf/dot2tex/ + +License +------- + +- MIT + + +Upstream Contact +---------------- + +- Kjell Magne Fauske, km@fauskes.net + +Dependencies +------------ + +graphviz (www.graphviz.org) should be installed and in the path (for +example via the graphviz spkg). + +preview, a LaTeX package for extracting parts of a document. + +Self-tests dependencies: + +- graphviz +- texlive-latex-base +- texlive-pictures +- texlive-pstricks + +Patches +------- + +- remove_test_semicolon.patch: + + Remove the failing semicolon test for the open dot2tex + issue #5 - https://github.com/kjellmf/dot2tex/issues/5 + + +Special Update/Build Instructions +--------------------------------- + +Make sure corresponding optional doctests still pass: + + sage -t --long --optional=dot2tex,graphviz,sage src/ diff --git a/build/pkgs/dot2tex/SPKG.txt b/build/pkgs/dot2tex/SPKG.txt deleted file mode 100644 index 4cbf60564e5..00000000000 --- a/build/pkgs/dot2tex/SPKG.txt +++ /dev/null @@ -1,42 +0,0 @@ -= dot2tex = - -== Description == - -dot2tex is a Python module, whose purpose is to give graphs generated -by Graphviz a more LaTeX friendly look and feel. This is accomplished -by converting xdot output from Graphviz to a series of PSTricks or -PGF/TikZ commands. - -See https://github.com/kjellmf/dot2tex/ - -== License == - * MIT - -== Upstream Contact == - * Kjell Magne Fauske, km@fauskes.net - -== Dependencies == - -graphviz (www.graphviz.org) should be installed and in the path (for -example via the graphviz spkg). - -preview, a LaTeX package for extracting parts of a document. - -Self-tests dependencies: - * graphviz - * texlive-latex-base - * texlive-pictures - * texlive-pstricks - -== Patches == - - * remove_test_semicolon.patch: - Remove the failing semicolon test for the open dot2tex - issue #5 - https://github.com/kjellmf/dot2tex/issues/5 - -== Special Update/Build Instructions == - -Make sure corresponding optional doctests still pass: - - sage -t --long --optional=dot2tex,graphviz,sage src/ - diff --git a/build/pkgs/e_antic/SPKG.rst b/build/pkgs/e_antic/SPKG.rst new file mode 100644 index 00000000000..e6e3ffc29c3 --- /dev/null +++ b/build/pkgs/e_antic/SPKG.rst @@ -0,0 +1,29 @@ + +e-antic +======= + +Description +----------- + +e-antic is a C library for exact computations with real embedded number +field maintained by Vincent Delecroix. + +Website: https://github.com/videlec/e-antic + +License +------- + +e-antic is licensed GPL v3. + + +Upstream Contact +---------------- + +- https://github.com/videlec/e-antic + +Dependencies +------------ + +- GMP/MPIR +- FLINT +- ARB diff --git a/build/pkgs/e_antic/SPKG.txt b/build/pkgs/e_antic/SPKG.txt deleted file mode 100644 index e13b4c97c94..00000000000 --- a/build/pkgs/e_antic/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= e-antic = - -== Description == - -e-antic is a C library for exact computations with real embedded number field -maintained by Vincent Delecroix. - -Website: https://github.com/videlec/e-antic - -== License == - -e-antic is licensed GPL v3. - -== Upstream Contact == - - * https://github.com/videlec/e-antic - -== Dependencies == - - * GMP/MPIR - * FLINT - * ARB diff --git a/build/pkgs/ecl/SPKG.rst b/build/pkgs/ecl/SPKG.rst new file mode 100644 index 00000000000..646abfc6ecf --- /dev/null +++ b/build/pkgs/ecl/SPKG.rst @@ -0,0 +1,70 @@ +ECL +=== + +Description +----------- + +ECL is an implementation of the Common Lisp language as defined by the +ANSI X3J13 specification. The most relevant features: + +- A bytecodes compiler and interpreter. +- Compiles Lisp also with any C/C++ compiler. +- It can build standalone executables and libraries. +- ASDF, Sockets, Gray streams, MOP, and other useful components. +- Extremely portable. +- A reasonable license. + +ECL supports the operating systems Linux, FreeBSD, NetBSD, OpenBSD, +Solaris and Windows, running on top of the Intel, Sparc, Alpha and +PowerPC processors. Porting to other architectures should be rather +easy. + +Website: http://ecls.sourceforge.net/ + +License +------- + +- LGPL V2+ or compatible - for details see + + http://ecls.sourceforge.net/license.html + + +Upstream Contact +---------------- + +- the ECL mailing list - see http://ecls.sourceforge.net/resources.html + +Dependencies +------------ + +- mpir +- boehm_gc + + +Special Update/Build Instructions +--------------------------------- + +- As autotools need to be run after most of the patches are applied, + we do all the patching in spkg-source. + +- Deleting the following directories saves space: without doing + this, the tarball can grow from under 3 megabytes to more than 7 + megabytes. Deleting these files is done automatically by the + ``spkg-src`` script. + +- The directory msvc +- The directory src/gc-unstable +- The directory src/gmp +- The directory src/libffi +- Note: for the time being, ECL is built single threaded library as it + seems to interact badly with the pexpect interface and Sage's signal + handling when built multithreaded. + +- Do NOT quote SAGE_LOCAL when setting CPPFLAGS and/or LDFLAGS, + in spkg-install as this caused the build to break. See + http://trac.sagemath.org/sage_trac/ticket/10187#comment:117 + +- TODO: Add the ECL test suite, and an spkg-check file to run it. +- TODO: Make ECL use Sage's Boehm GC on MacOS X as well (but perhaps + put some changes from ECL's into Sage's Boehm GC), then remove + the src/src/gc directory, too. diff --git a/build/pkgs/ecl/SPKG.txt b/build/pkgs/ecl/SPKG.txt deleted file mode 100644 index be945bb2319..00000000000 --- a/build/pkgs/ecl/SPKG.txt +++ /dev/null @@ -1,56 +0,0 @@ -= ECL = - -== Description == - -ECL is an implementation of the Common Lisp language as defined by the -ANSI X3J13 specification. The most relevant features: - - * A bytecodes compiler and interpreter. - * Compiles Lisp also with any C/C++ compiler. - * It can build standalone executables and libraries. - * ASDF, Sockets, Gray streams, MOP, and other useful components. - * Extremely portable. - * A reasonable license. - -ECL supports the operating systems Linux, FreeBSD, NetBSD, OpenBSD, -Solaris and Windows, running on top of the Intel, Sparc, Alpha and -PowerPC processors. Porting to other architectures should be rather -easy. - -Website: http://ecls.sourceforge.net/ - -== License == - - * LGPL V2+ or compatible - for details see - http://ecls.sourceforge.net/license.html - -== Upstream Contact == - - * the ECL mailing list - see http://ecls.sourceforge.net/resources.html - -== Dependencies == - - * mpir - * boehm_gc - -== Special Update/Build Instructions == - * As autotools need to be run after most of the patches are applied, - we do all the patching in spkg-source. - * Deleting the following directories saves space: without doing - this, the tarball can grow from under 3 megabytes to more than 7 - megabytes. Deleting these files is done automatically by the - `spkg-src` script. - - The directory msvc - - The directory src/gc-unstable - - The directory src/gmp - - The directory src/libffi - * Note: for the time being, ECL is built single threaded library as it - seems to interact badly with the pexpect interface and Sage's signal - handling when built multithreaded. - * Do NOT quote SAGE_LOCAL when setting CPPFLAGS and/or LDFLAGS, - in spkg-install as this caused the build to break. See - http://trac.sagemath.org/sage_trac/ticket/10187#comment:117 - * TODO: Add the ECL test suite, and an spkg-check file to run it. - * TODO: Make ECL use Sage's Boehm GC on MacOS X as well (but perhaps - put some changes from ECL's into Sage's Boehm GC), then remove - the src/src/gc directory, too. diff --git a/build/pkgs/ecl/spkg-src b/build/pkgs/ecl/spkg-src index 6333c7f3c8c..37ac03bf27b 100755 --- a/build/pkgs/ecl/spkg-src +++ b/build/pkgs/ecl/spkg-src @@ -53,5 +53,5 @@ autoreconf -ivf cd ../.. tar c ecl-$ECLVERSION | bzip2 -c >"$ECLTARBALL" -sage-fix-pkg-checksums "$ECLTARBALL" +sage --package fix-checksum "$ECLTARBALL" rm -rf ecl-* diff --git a/build/pkgs/eclib/SPKG.txt b/build/pkgs/eclib/SPKG.rst similarity index 64% rename from build/pkgs/eclib/SPKG.txt rename to build/pkgs/eclib/SPKG.rst index dfbd7424a9b..9c24ab8cebc 100644 --- a/build/pkgs/eclib/SPKG.txt +++ b/build/pkgs/eclib/SPKG.rst @@ -1,6 +1,8 @@ -= eclib = +eclib +===== -== Description == +Description +----------- mwrank is a program written in C++ for computing Mordell-Weil groups of elliptic curves over Q via 2-descent. It is available as source code in @@ -13,19 +15,24 @@ to install Sage (which also of course gives you much much more). I no longer provide a source code distribution of mwrank by itself: use eclib instead. -== License == +License +------- eclib is licensed GPL v2+. -== Upstream Contact == - * Author: John Cremona - * Email: john.cremona@gmail.com - * Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/mwrank/index.html - * Repository: https://github.com/JohnCremona/eclib +Upstream Contact +---------------- -== Dependencies == +- Author: John Cremona +- Email: john.cremona@gmail.com +- Website: + http://homepages.warwick.ac.uk/staff/J.E.Cremona/mwrank/index.html +- Repository: https://github.com/JohnCremona/eclib - * PARI - * NTL - * FLINT +Dependencies +------------ + +- PARI +- NTL +- FLINT diff --git a/build/pkgs/ecm/SPKG.txt b/build/pkgs/ecm/SPKG.rst similarity index 55% rename from build/pkgs/ecm/SPKG.txt rename to build/pkgs/ecm/SPKG.rst index 78c9dacbfa3..e1c84ba21d9 100644 --- a/build/pkgs/ecm/SPKG.txt +++ b/build/pkgs/ecm/SPKG.rst @@ -1,35 +1,48 @@ -= ecm = +ecm +=== -== Description == +Description +----------- GMP-ECM - Elliptic Curve Method for Integer Factorization Sources can be obtained from http://gforge.inria.fr/projects/ecm/ -== License == +License +------- LGPL V3+ -== Upstream Contact == - * ecm-discuss@lists.gforge.inria.fr (requires subscription) +Upstream Contact +---------------- -== Dependencies == +- ecm-discuss@lists.gforge.inria.fr (requires subscription) - * GMP/MPIR (Note: Python is *not* required for ordinary builds.) - * GNU patch +Dependencies +------------ -== Special Update/Build Instructions == +- GMP/MPIR (Note: Python is \*not\* required for ordinary builds.) +- GNU patch - * GMP-ECM comes with a self-tuning feature; we could support + +Special Update/Build Instructions +--------------------------------- + +- GMP-ECM comes with a self-tuning feature; we could support that as an option ($SAGE_TUNE_*=yes) in the future. - * ECM currently does not (by itself) use the CC and CFLAGS settings + +- ECM currently does not (by itself) use the CC and CFLAGS settings from 'gmp.h' since we pass (other) options in CFLAGS, and CC is set - by Sage and might got set by the user. We now at least partially fix that - such that "optimized" code generation options ('-mcpu=...', '-mtune=...') + by Sage and might got set by the user. We now at least partially fix + that + such that "optimized" code generation options ('-mcpu=...', + '-mtune=...') are used by gcc. - Of course a user can also manually enable them by setting the "global" - CFLAGS to e.g. '-march=native' on x86[_64] systems, or '-mcpu=...' and + Of course a user can also manually enable them by setting the + "global" + CFLAGS to e.g. '-march=native' on x86[_64] systems, or '-mcpu=...' + and '-mtune=...' on other architectures where "native" isn't supported. Note that this doesn't affect the packages' selection of processor- specific optimized [assembly] code. @@ -39,9 +52,13 @@ LGPL V3+ "-mcpu=...", and perhaps pass a more generic "--host=..." to 'configure'. (MPIR honors '--enable-fat' to some extent, but this option isn't used on anything other than x86 / x86_64.) - * We currently work around a linker bug on MacOS X 10.5 PPC (with + +- We currently work around a linker bug on MacOS X 10.5 PPC (with GCC 4.2.1) which breaks 'configure' if debug symbols are enabled. - This *might* get fixed in later upstream releases. - * We could save some space by removing the `src/build.vc10/` directory which - isn't used in Sage. (It gets probably more worth in case also directories / + This \*might\* get fixed in later upstream releases. + +- We could save some space by removing the ``src/build.vc10/`` + directory which + isn't used in Sage. (It gets probably more worth in case also + directories / files for later versions of Microsoft Visual C get added.) diff --git a/build/pkgs/elliptic_curves/SPKG.rst b/build/pkgs/elliptic_curves/SPKG.rst new file mode 100644 index 00000000000..dc0064037e0 --- /dev/null +++ b/build/pkgs/elliptic_curves/SPKG.rst @@ -0,0 +1,35 @@ +elliptic_curves +=============== + +Description +----------- + +Includes two databases: + +- A small subset of John Cremona's database of elliptic curves up + to conductor 10000. + +- William Stein's database of interesting curves + + +Upstream Contact +---------------- + +cremona_mini +~~~~~~~~~~~~ + +- Author: John Cremona +- Email: john.cremona@gmail.com +- Website: http://johncremona.github.io/ecdata/ + +ellcurves +~~~~~~~~~ + +- Author: William Stein +- Email: wstein@gmail.com + +Dependencies +------------ + +- sqlite +- python diff --git a/build/pkgs/elliptic_curves/SPKG.txt b/build/pkgs/elliptic_curves/SPKG.txt deleted file mode 100644 index 5c5ac942b06..00000000000 --- a/build/pkgs/elliptic_curves/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= elliptic_curves = - -== Description == - -Includes two databases: - - * A small subset of John Cremona's database of elliptic curves up - to conductor 10000. - * William Stein's database of interesting curves - -== Upstream Contact == - -=== cremona_mini === - - * Author: John Cremona - * Email: john.cremona@gmail.com - * Website: http://johncremona.github.io/ecdata/ - -=== ellcurves === - - * Author: William Stein - * Email: wstein@gmail.com - -== Dependencies == - - * sqlite - * python - diff --git a/build/pkgs/entrypoints/SPKG.txt b/build/pkgs/entrypoints/SPKG.rst similarity index 65% rename from build/pkgs/entrypoints/SPKG.txt rename to build/pkgs/entrypoints/SPKG.rst index 89b2078a05a..e33daf5c768 100644 --- a/build/pkgs/entrypoints/SPKG.txt +++ b/build/pkgs/entrypoints/SPKG.rst @@ -1,14 +1,20 @@ -= entrypoints = +entrypoints +=========== -== Description == +Description +----------- Discover and load entry points from installed packages. -== Upstream Contact == + +Upstream Contact +---------------- https://github.com/takluyver/entrypoints -== Special Update/Build Instructions == + +Special Update/Build Instructions +--------------------------------- Upstream does not provide a source tarball, so the tarball was taken from github and renamed. diff --git a/build/pkgs/enum34/SPKG.txt b/build/pkgs/enum34/SPKG.rst similarity index 87% rename from build/pkgs/enum34/SPKG.txt rename to build/pkgs/enum34/SPKG.rst index 4deba1b8d21..98df0d9b429 100644 --- a/build/pkgs/enum34/SPKG.txt +++ b/build/pkgs/enum34/SPKG.rst @@ -1,6 +1,8 @@ -= enum34 = +enum34 +====== -== Description == +Description +----------- Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4 diff --git a/build/pkgs/fflas_ffpack/SPKG.rst b/build/pkgs/fflas_ffpack/SPKG.rst new file mode 100644 index 00000000000..8373e0f5cfa --- /dev/null +++ b/build/pkgs/fflas_ffpack/SPKG.rst @@ -0,0 +1,38 @@ +FFLAS/FFPACK +============ + +Description +----------- + +FFLAS-FFPACK is a LGPL-2.1+ source code library for dense linear algebra +over word-size finite fields. + +http://linalg.org/projects/fflas-ffpack + +License +------- + +LGPL V2.1 or later + + +SPKG Repository +--------------- + + https://bitbucket.org/malb/fflas-ffpack-spkg + + +Upstream Contact +---------------- + +- + +Dependencies +------------ + +- Givaro +- ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) + +Patches +------- + +- bash.patch: fix shebang line to "#!/usr/bin/env bash" diff --git a/build/pkgs/fflas_ffpack/SPKG.txt b/build/pkgs/fflas_ffpack/SPKG.txt deleted file mode 100644 index b09520745c0..00000000000 --- a/build/pkgs/fflas_ffpack/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= FFLAS/FFPACK = - -== Description == - -FFLAS-FFPACK is a LGPL-2.1+ source code library for dense linear -algebra over word-size finite fields. - -http://linalg.org/projects/fflas-ffpack - -== License == - -LGPL V2.1 or later - -== SPKG Repository == - - https://bitbucket.org/malb/fflas-ffpack-spkg - -== Upstream Contact == - - * - -== Dependencies == - - * Givaro - * ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) - -== Patches == - - * bash.patch: fix shebang line to "#!/usr/bin/env bash" - diff --git a/build/pkgs/flask/SPKG.txt b/build/pkgs/flask/SPKG.rst similarity index 84% rename from build/pkgs/flask/SPKG.txt rename to build/pkgs/flask/SPKG.rst index cf46f1da69e..2b80d810b4b 100644 --- a/build/pkgs/flask/SPKG.txt +++ b/build/pkgs/flask/SPKG.rst @@ -1,6 +1,8 @@ -= Flask = +Flask +===== -== Description == +Description +----------- A microframework based on Werkzeug, Jinja2 and good intentions diff --git a/build/pkgs/flask_autoindex/SPKG.txt b/build/pkgs/flask_autoindex/SPKG.rst similarity index 75% rename from build/pkgs/flask_autoindex/SPKG.txt rename to build/pkgs/flask_autoindex/SPKG.rst index 6ef8325067a..43f8f79e3da 100644 --- a/build/pkgs/flask_autoindex/SPKG.txt +++ b/build/pkgs/flask_autoindex/SPKG.rst @@ -1,6 +1,9 @@ -= Flask-AutoIndex = -== Description == +Flask-AutoIndex +=============== + +Description +----------- The mod_autoindex for Flask diff --git a/build/pkgs/flask_babel/SPKG.txt b/build/pkgs/flask_babel/SPKG.rst similarity index 62% rename from build/pkgs/flask_babel/SPKG.txt rename to build/pkgs/flask_babel/SPKG.rst index f96f6411918..6974facfcf8 100644 --- a/build/pkgs/flask_babel/SPKG.txt +++ b/build/pkgs/flask_babel/SPKG.rst @@ -1,6 +1,9 @@ -= Flask-Babel = -== Description == +Flask-Babel +=========== + +Description +----------- Adds i18n/l10n support to Flask applications with the help of the Babel library. diff --git a/build/pkgs/flask_oldsessions/SPKG.txt b/build/pkgs/flask_oldsessions/SPKG.rst similarity index 54% rename from build/pkgs/flask_oldsessions/SPKG.txt rename to build/pkgs/flask_oldsessions/SPKG.rst index 2af9b2ebb23..9ce3d39c12d 100644 --- a/build/pkgs/flask_oldsessions/SPKG.txt +++ b/build/pkgs/flask_oldsessions/SPKG.rst @@ -1,5 +1,8 @@ -= Flask-OldSessions = -== Description == +Flask-OldSessions +================= + +Description +----------- Provides a session class that works like the one in Flask before 0.10. diff --git a/build/pkgs/flask_openid/SPKG.rst b/build/pkgs/flask_openid/SPKG.rst new file mode 100644 index 00000000000..5ac2ac228e0 --- /dev/null +++ b/build/pkgs/flask_openid/SPKG.rst @@ -0,0 +1,8 @@ + +Flask-OpenID +============ + +Description +----------- + +OpenID support for Flask diff --git a/build/pkgs/flask_openid/SPKG.txt b/build/pkgs/flask_openid/SPKG.txt deleted file mode 100644 index 77aa5b1c152..00000000000 --- a/build/pkgs/flask_openid/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= Flask-OpenID = - -== Description == - -OpenID support for Flask diff --git a/build/pkgs/flask_silk/SPKG.txt b/build/pkgs/flask_silk/SPKG.rst similarity index 60% rename from build/pkgs/flask_silk/SPKG.txt rename to build/pkgs/flask_silk/SPKG.rst index 92d3009a886..6d5b14492c4 100644 --- a/build/pkgs/flask_silk/SPKG.txt +++ b/build/pkgs/flask_silk/SPKG.rst @@ -1,5 +1,8 @@ -= Flask-Silk = -== Description == +Flask-Silk +========== + +Description +----------- Adds silk icons to your Flask application or blueprint, or extension. diff --git a/build/pkgs/flint/SPKG.rst b/build/pkgs/flint/SPKG.rst new file mode 100644 index 00000000000..c62bc607dd8 --- /dev/null +++ b/build/pkgs/flint/SPKG.rst @@ -0,0 +1,30 @@ +flint +===== + +Description +----------- + +FLINT is a C library for doing number theory, maintained by William +Hart. + +Website: www.flintlib.org + +License +------- + +FLINT is licensed GPL v2+. + + +Upstream Contact +---------------- + +- flint-devel Gougle Group + (http://groups.google.co.uk/group/flint-devel) +- William Hart + +Dependencies +------------ + +- MPIR +- MPFR +- NTL diff --git a/build/pkgs/flint/SPKG.txt b/build/pkgs/flint/SPKG.txt deleted file mode 100644 index 935850e3888..00000000000 --- a/build/pkgs/flint/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= flint = - -== Description == - -FLINT is a C library for doing number theory, maintained by William Hart. - -Website: www.flintlib.org - -== License == - -FLINT is licensed GPL v2+. - -== Upstream Contact == - - * flint-devel Gougle Group (http://groups.google.co.uk/group/flint-devel) - * William Hart - -== Dependencies == - - * MPIR - * MPFR - * NTL diff --git a/build/pkgs/flintqs/SPKG.rst b/build/pkgs/flintqs/SPKG.rst new file mode 100644 index 00000000000..1387cbd9624 --- /dev/null +++ b/build/pkgs/flintqs/SPKG.rst @@ -0,0 +1,14 @@ +FlintQS +======= + +Description +----------- + +This is William Hart's GPL'd highly optimized multi-polynomial quadratic +sieve for integer factorization: + + http://www.friedspace.com/QS/ + +See also http://www.maths.warwick.ac.uk/~masfaw/preprint.html + +See also the repository: https://github.com/sagemath/FlintQS diff --git a/build/pkgs/flintqs/SPKG.txt b/build/pkgs/flintqs/SPKG.txt deleted file mode 100644 index 037997b5595..00000000000 --- a/build/pkgs/flintqs/SPKG.txt +++ /dev/null @@ -1,9 +0,0 @@ -This is William Hart's GPL'd highly optimized multi-polynomial -quadratic sieve for integer factorization: - - http://www.friedspace.com/QS/ - -See also http://www.maths.warwick.ac.uk/~masfaw/preprint.html - -See also the repository: https://github.com/sagemath/FlintQS - diff --git a/build/pkgs/fplll/SPKG.rst b/build/pkgs/fplll/SPKG.rst new file mode 100644 index 00000000000..f31484c927a --- /dev/null +++ b/build/pkgs/fplll/SPKG.rst @@ -0,0 +1,29 @@ +fplll +===== + +Description +----------- + +fplll contains implementations of several lattice algorithms. The +implementation relies on floating-point orthogonalization, and LLL is +central to the code, hence the name. + +Website: https://github.com/fplll/fplll + +License +------- + +- LGPL V2.1+ + + +Upstream Contact +---------------- + +- Martin Albrecht +- Mailing List https://groups.google.com/forum/#!forum/fplll-devel + +Dependencies +------------ + +- gmp +- mpfr diff --git a/build/pkgs/fplll/SPKG.txt b/build/pkgs/fplll/SPKG.txt deleted file mode 100644 index 5d806daf910..00000000000 --- a/build/pkgs/fplll/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= fplll = - -== Description == - -fplll contains implementations of several lattice algorithms. The -implementation relies on floating-point orthogonalization, and LLL is -central to the code, hence the name. - -Website: https://github.com/fplll/fplll - -== License == - * LGPL V2.1+ - -== Upstream Contact == - - * Martin Albrecht - * Mailing List https://groups.google.com/forum/#!forum/fplll-devel - -== Dependencies == - * gmp - * mpfr diff --git a/build/pkgs/fpylll/SPKG.rst b/build/pkgs/fpylll/SPKG.rst new file mode 100644 index 00000000000..a583f5757d8 --- /dev/null +++ b/build/pkgs/fpylll/SPKG.rst @@ -0,0 +1,26 @@ +fpylll +====== + +Description +----------- + +A Python interface for https://github.com/fplll/fplll + +License +------- + +GPL version 2 or later + + +Upstream Contact +---------------- + +https://github.com/fplll/fpylll + +Dependencies +------------ + +- Cython +- fplll +- Sage (optional) +- NumPy (optional) diff --git a/build/pkgs/fpylll/SPKG.txt b/build/pkgs/fpylll/SPKG.txt deleted file mode 100644 index 54c48ca58d3..00000000000 --- a/build/pkgs/fpylll/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= fpylll = - -== Description == - -A Python interface for https://github.com/fplll/fplll - -== License == - -GPL version 2 or later - -== Upstream Contact == - -https://github.com/fplll/fpylll - -== Dependencies == - -* Cython -* fplll -* Sage (optional) -* NumPy (optional) diff --git a/build/pkgs/freetype/SPKG.rst b/build/pkgs/freetype/SPKG.rst new file mode 100644 index 00000000000..9314b7047b1 --- /dev/null +++ b/build/pkgs/freetype/SPKG.rst @@ -0,0 +1,52 @@ +FreeType +======== + +Description +----------- + +From the documentation: + +FreeType is a software font engine that is designed to be small, +efficient, highly customizable, and portable while capable of +producing high-quality output (glyph images). It can be used in +graphics libraries, display servers, font conversion tools, text image +generation tools, and many other products as well. + +Note that FreeType is a font service and doesn't provide APIs to +perform higher-level features like text layout or graphics processing +(e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly +simplifies these tasks by providing a simple, easy to use, and uniform +interface to access the content of font files. + +Please note that ‘FreeType’ is also called ‘FreeType 2’, to +distinguish it from the old, deprecated ‘FreeType 1’ library, a +predecessor no longer maintained and supported. + +The package in Sage is called freetype (in lowercase). + +License +------- + +- FreeType (BSD-like) +- GNU Public License v2 + +From the documentation: + +FreeType is released under two open-source licenses: our own BSD-like +FreeType License and the GNU Public License, Version 2. It can thus +be used by any kind of projects, be they proprietary or not. + + +Upstream Contact +---------------- + +- home: https://www.freetype.org +- repo: + + - official: http://git.savannah.gnu.org/cgit/freetype + - mirror: https://github.com/aseprite/freetype2/ + +Dependencies +------------ + +See the ``dependencies`` file. diff --git a/build/pkgs/freetype/SPKG.txt b/build/pkgs/freetype/SPKG.txt deleted file mode 100644 index 51773022212..00000000000 --- a/build/pkgs/freetype/SPKG.txt +++ /dev/null @@ -1,46 +0,0 @@ -= FreeType = - -== Description == - -From the documentation: - -> FreeType is a software font engine that is designed to be small, -> efficient, highly customizable, and portable while capable of -> producing high-quality output (glyph images). It can be used in -> graphics libraries, display servers, font conversion tools, -> text image generation tools, and many other products as well. - -> Note that FreeType is a font service and doesn't provide APIs to -> perform higher-level features like text layout or graphics processing -> (e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly -> simplifies these tasks by providing a simple, easy to use, and uniform -> interface to access the content of font files. - -> Please note that ‘FreeType’ is also called ‘FreeType 2’, to -> distinguish it from the old, deprecated ‘FreeType 1’ library, -> a predecessor no longer maintained and supported. - -The package in Sage is called freetype (in lowercase). - -== License == - - * FreeType (BSD-like) - * GNU Public License v2 - -From the documentation: - -> FreeType is released under two open-source licenses: our own BSD-like -> FreeType License and the GNU Public License, Version 2. It can thus -> be used by any kind of projects, be they proprietary or not. - -== Upstream Contact == - - * home: https://www.freetype.org - * repo: - * official: http://git.savannah.gnu.org/cgit/freetype - * mirror: https://github.com/aseprite/freetype2/ - -== Dependencies == - -See the `dependencies` file. - diff --git a/build/pkgs/fricas/SPKG.rst b/build/pkgs/fricas/SPKG.rst new file mode 100644 index 00000000000..cb86c9c65d3 --- /dev/null +++ b/build/pkgs/fricas/SPKG.rst @@ -0,0 +1,23 @@ +fricas +====== + +Description +----------- + +FriCAS is a general purpose computer algebra system. + +License +------- + +Modified BSD license. + + +Upstream Contact +---------------- + +http://fricas.sourceforge.net/ + +Dependencies +------------ + +- ecl diff --git a/build/pkgs/fricas/SPKG.txt b/build/pkgs/fricas/SPKG.txt deleted file mode 100644 index 753f7318252..00000000000 --- a/build/pkgs/fricas/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= fricas = - -== Description == - -FriCAS is a general purpose computer algebra system. - -== License == - -Modified BSD license. - -== Upstream Contact == - -http://fricas.sourceforge.net/ - -== Dependencies == - - * ecl - - diff --git a/build/pkgs/frobby/SPKG.rst b/build/pkgs/frobby/SPKG.rst new file mode 100644 index 00000000000..43d67a408ee --- /dev/null +++ b/build/pkgs/frobby/SPKG.rst @@ -0,0 +1,44 @@ +Frobby +====== + +Description +----------- + +The software package Frobby provides a number of computations on +monomial ideals. The current main feature is the socle of a monomial +ideal, which is largely equivalent to computing the maximal standard +monomials, the Alexander dual or the irreducible decomposition. + +Operations on monomial ideals are much faster than algorithms designed +for ideals in general, which is what makes a specialized library for +these operations on monomial ideals useful. + +License +------- + +- GPL version 2.0 or later + +Maintainers +----------- + +- Bjarke Hammersholt Roune (www.broune.com) + + +Upstream Contact +---------------- + +- Bjarke Hammersholt Roune (www.broune.com) + +Dependencies +------------ + +- GMP built with support for C++ + + +Special Update/Build instructions +--------------------------------- + +Download Frobby at www.broune.com/ and then type "make spkg VER=blah" +which wil create an spkg named frobby-VER.spkg in bin/. The files +related to doing this is in the sage/ sub-directory of the Frobby source +distribution. diff --git a/build/pkgs/frobby/SPKG.txt b/build/pkgs/frobby/SPKG.txt deleted file mode 100644 index 56abd52173f..00000000000 --- a/build/pkgs/frobby/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= Frobby = - -== Description == -The software package Frobby provides a number of computations on -monomial ideals. The current main feature is the socle of a monomial -ideal, which is largely equivalent to computing the maximal standard -monomials, the Alexander dual or the irreducible decomposition. - -Operations on monomial ideals are much faster than algorithms designed -for ideals in general, which is what makes a specialized library for -these operations on monomial ideals useful. - -== License == - * GPL version 2.0 or later - -== Maintainers == - * Bjarke Hammersholt Roune (www.broune.com) - -== Upstream Contact == - * Bjarke Hammersholt Roune (www.broune.com) - -== Dependencies == - * GMP built with support for C++ - -== Special Update/Build instructions == -Download Frobby at www.broune.com/ and then type "make spkg VER=blah" which wil create an spkg -named frobby-VER.spkg in bin/. The files related to doing this is in the sage/ sub-directory of the -Frobby source distribution. - diff --git a/build/pkgs/functools32/SPKG.txt b/build/pkgs/functools32/SPKG.rst similarity index 56% rename from build/pkgs/functools32/SPKG.txt rename to build/pkgs/functools32/SPKG.rst index 8cab3c8ca44..0a9c6f1370f 100644 --- a/build/pkgs/functools32/SPKG.txt +++ b/build/pkgs/functools32/SPKG.rst @@ -1,18 +1,24 @@ -= functools32 = +functools32 +=========== -== Description == +Description +----------- -Backport of the functools module from Python 3.2.3 for use on 2.7 and PyPy. +Backport of the functools module from Python 3.2.3 for use on 2.7 and +PyPy. -== License == +License +------- Python Software Foundation License -== Upstream Contact == + +Upstream Contact +---------------- Home page: https://pypi.python.org/pypi/functools32 -== Dependencies == +Dependencies +------------ Python, Setuptools - diff --git a/build/pkgs/future/SPKG.rst b/build/pkgs/future/SPKG.rst new file mode 100644 index 00000000000..9bab6bba252 --- /dev/null +++ b/build/pkgs/future/SPKG.rst @@ -0,0 +1,31 @@ +future +====== + +Description +----------- + +Clean single-source support for Python 3 and 2 + +future is the missing compatibility layer between Python 2 and Python 3. +It allows you to use a single, clean Python 3.x-compatible codebase to +support both Python 2 and Python 3 with minimal overhead. + +It is designed to be used as follows: + +.. CODE-BLOCK:: python + + from __future__ import (absolute_import, division, + print_function, unicode_literals) + + from builtins import ( + bytes, dict, int, list, object, range, str, + ascii, chr, hex, input, next, oct, open, + pow, round, super, + filter, map, zip) + +followed by predominantly standard, idiomatic Python 3 code that then +runs similarly on Python 2.6/2.7 and Python 3.3+. + +The imports have no effect on Python 3. On Python 2, they shadow the +corresponding builtins, which normally have different semantics on +Python 3 versus 2, to provide their Python 3 semantics. diff --git a/build/pkgs/future/SPKG.txt b/build/pkgs/future/SPKG.txt deleted file mode 100644 index c3fd24e9b50..00000000000 --- a/build/pkgs/future/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= future = - -== Description == - -Clean single-source support for Python 3 and 2 - -future is the missing compatibility layer between Python 2 and Python -3. It allows you to use a single, clean Python 3.x-compatible codebase -to support both Python 2 and Python 3 with minimal overhead. - -It is designed to be used as follows: - -from __future__ import (absolute_import, division, - print_function, unicode_literals) -from builtins import ( - bytes, dict, int, list, object, range, str, - ascii, chr, hex, input, next, oct, open, - pow, round, super, - filter, map, zip) - -followed by predominantly standard, idiomatic Python 3 code that then -runs similarly on Python 2.6/2.7 and Python 3.3+. - -The imports have no effect on Python 3. On Python 2, they shadow the -corresponding builtins, which normally have different semantics on -Python 3 versus 2, to provide their Python 3 semantics. - diff --git a/build/pkgs/gambit/SPKG.rst b/build/pkgs/gambit/SPKG.rst new file mode 100644 index 00000000000..d40cbdd1637 --- /dev/null +++ b/build/pkgs/gambit/SPKG.rst @@ -0,0 +1,30 @@ +gambit +====== + +Description +----------- + +Gambit is a set of software tools for doing computation on finite, +noncooperative games. The Gambit Project was founded in the mid-1980s by +Richard McKelvey at the California Institute of Technology. + +License +------- + +GPL v2+ + + +Upstream Contact +---------------- + +- Website: http://www.gambit-project.org/ +- Mailing List: http://sourceforge.net/p/gambit/mailman/gambit-devel/ + +Dependencies +------------ + +- python +- cython +- setuptools +- IPython +- scipy diff --git a/build/pkgs/gambit/SPKG.txt b/build/pkgs/gambit/SPKG.txt deleted file mode 100644 index 01710e57d06..00000000000 --- a/build/pkgs/gambit/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= gambit = - -== Description == - -Gambit is a set of software tools for doing computation on finite, -noncooperative games. The Gambit Project was founded in the mid-1980s by -Richard McKelvey at the California Institute of Technology. - -== License == - -GPL v2+ - -== Upstream Contact == - -* Website: http://www.gambit-project.org/ -* Mailing List: http://sourceforge.net/p/gambit/mailman/gambit-devel/ - -== Dependencies == - -* python -* cython -* setuptools -* IPython -* scipy diff --git a/build/pkgs/gap/SPKG.txt b/build/pkgs/gap/SPKG.rst similarity index 55% rename from build/pkgs/gap/SPKG.txt rename to build/pkgs/gap/SPKG.rst index 021c1578fb1..6ecef93ba91 100644 --- a/build/pkgs/gap/SPKG.txt +++ b/build/pkgs/gap/SPKG.rst @@ -1,6 +1,8 @@ -= GAP = +GAP +=== -== Description == +Description +----------- GAP is a system for computational discrete algebra, with particular emphasis on Computational Group Theory. GAP provides a programming @@ -10,38 +12,48 @@ of algebraic objects. See also the overview and the description of the mathematical capabilities. GAP is used in research and teaching for studying groups and their representations, rings, vector spaces, algebras, combinatorial structures, and more. The system, including -source, is distributed freely. You can study and easily modify or -extend it for your special use. +source, is distributed freely. You can study and easily modify or extend +it for your special use. -This is a stripped-down version of GAP. The databases, which are +This is a stripped-down version of GAP. The databases, which are architecture-independent, are in a separate package. -== Upstream Contact == -David Joyner, wdjoyner@gmail.com (on the GAP team, but -Steve Linton, sal@dcs.st-and.ac.uk, is basically the lead developer) +Upstream Contact +---------------- -== Dependencies == +David Joyner, wdjoyner@gmail.com (on the GAP team, but Steve Linton, +sal@dcs.st-and.ac.uk, is basically the lead developer) - * Readline - * MPIR +Dependencies +------------ -== Special Update/Build Instructions == +- Readline +- MPIR + + +Special Update/Build Instructions +--------------------------------- This is a stripped-down version of GAP. The downloading of the sources and removal of unneeded parts is done by the script spkg-src. When you update GAP, please also update and use the spkg-src script. - * Do we really want to copy everything from the build directory??? +- Do we really want to copy everything from the build directory??? + You need the full GAP tree to compile/install many GAP packages. - * There's apparently a command missing (in `spkg-install`) building the - (HTML?) documentation. Earlier changelog entries as well as the description - above state the documentation was removed from the upstream sources... +- There's apparently a command missing (in ``spkg-install``) building + the + (HTML?) documentation. Earlier changelog entries as well as the + description + above state the documentation was removed from the upstream + sources... Since the (pre-)built HTML documentation is currently included, I've - commented out some lines in that part of `spkg-install`. -leif + commented out some lines in that part of ``spkg-install``. -leif -=== Patches === +Patches +~~~~~~~ - * writeandcheck.patch: fix infinite loop in writeandcheck() when +- writeandcheck.patch: fix infinite loop in writeandcheck() when writing an error message fails. diff --git a/build/pkgs/gap3/SPKG.rst b/build/pkgs/gap3/SPKG.rst new file mode 100644 index 00000000000..929b89867c2 --- /dev/null +++ b/build/pkgs/gap3/SPKG.rst @@ -0,0 +1,86 @@ + +Jean Michel's GAP 3 distribution +================================ + +Description +----------- + +This package installs Jean Michel's pre-packaged GAP3, which is a +minimal GAP3 distribution containing packages that have no equivalent in +GAP4. + +Below is the full description from Jean Michel's webpage (accessed 23 +July 2015). + + A pre-packaged GAP3 with everything you need + + To help people who are just interested in GAP3 because they need a + package + which has not been ported to GAP4, I have prepared an easy-to install + minimal GAP3 distribution containing an up-to-date versions of the + packages: + + anusq, arep, autag, chevie, cryst, dce, grim, matrix, meataxe, + monoid, + nq, pcqa, sisyphos, specht, ve, vkcurve. + + These packages have been chosen since most have no equivalent in + GAP4. They + are autoloaded when starting gap. + + This distribution includes only partial lists of small groups, + 2-groups, + 3-groups, character tables from the Atlas and tables of marks. It + does not + include either the packages: + + anupq, grape, kbmag, xgap, cohomolo, gliss, guava, xmod + + which have some equivalent in GAP4. You can get these extra features + at + + http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/GAP3 + + In this distribution: + +- The on-line help includes the documentation of the included packages. +- The html documentation (htm/index.html) also does. +- The manual (manual.pdf) also does. + +License +------- + +Most parts of the GAP distribution, including the core part of the GAP +system, are distributed under the terms of the GNU General Public +License (see http://www.gnu.org/licenses/gpl.html or the file GPL in the +etc directory of the GAP installation). + + +SPKG Maintainers +---------------- + +- Christian Stump + + +Upstream Contact +---------------- + +Jean Michel +http://webusers.imj-prg.fr/~jean.michel/ + + +Special Update/Build Instructions +--------------------------------- + +The difference between the distributed tarball and Jean Michel's +original tarball also contains the binaries + +Patches +~~~~~~~ + +None + +Dependencies +------------ + +None diff --git a/build/pkgs/gap3/SPKG.txt b/build/pkgs/gap3/SPKG.txt deleted file mode 100644 index aee3bc3fe0f..00000000000 --- a/build/pkgs/gap3/SPKG.txt +++ /dev/null @@ -1,67 +0,0 @@ -= Jean Michel's GAP 3 distribution = - -== Description == - -This package installs Jean Michel's pre-packaged GAP3, which is a minimal GAP3 -distribution containing packages that have no equivalent in GAP4. - -Below is the full description from Jean Michel's webpage -(accessed 23 July 2015). - - A pre-packaged GAP3 with everything you need - - To help people who are just interested in GAP3 because they need a package - which has not been ported to GAP4, I have prepared an easy-to install - minimal GAP3 distribution containing an up-to-date versions of the - packages: - - anusq, arep, autag, chevie, cryst, dce, grim, matrix, meataxe, monoid, - nq, pcqa, sisyphos, specht, ve, vkcurve. - - These packages have been chosen since most have no equivalent in GAP4. They - are autoloaded when starting gap. - - This distribution includes only partial lists of small groups, 2-groups, - 3-groups, character tables from the Atlas and tables of marks. It does not - include either the packages: - - anupq, grape, kbmag, xgap, cohomolo, gliss, guava, xmod - - which have some equivalent in GAP4. You can get these extra features at - - http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/GAP3 - - In this distribution: - - - The on-line help includes the documentation of the included packages. - - The html documentation (htm/index.html) also does. - - The manual (manual.pdf) also does. - -== License == - -Most parts of the GAP distribution, including the core part of the GAP system, -are distributed under the terms of the GNU General Public License (see -http://www.gnu.org/licenses/gpl.html or the file GPL in the etc directory of -the GAP installation). - -== SPKG Maintainers == - -* Christian Stump - -== Upstream Contact == - -Jean Michel -http://webusers.imj-prg.fr/~jean.michel/ - -== Special Update/Build Instructions == - -The difference between the distributed tarball and Jean Michel's -original tarball also contains the binaries - -=== Patches === - -None - -== Dependencies === - -None diff --git a/build/pkgs/gap_jupyter/SPKG.rst b/build/pkgs/gap_jupyter/SPKG.rst new file mode 100644 index 00000000000..9e46f9e46a6 --- /dev/null +++ b/build/pkgs/gap_jupyter/SPKG.rst @@ -0,0 +1,22 @@ + +jupyter-kernel-gap +================== + +Description +----------- + +Jupyter kernel for GAP + +This wrapper-kernel is a Jupyter kernel for the GAP Computer Algebra +System based on the same ideas as the bash wrapper kernel. + +License +------- + +3-Clause BSD License + + +Upstream Contact +---------------- + +- https://github.com/gap-packages/jupyter-gap diff --git a/build/pkgs/gap_jupyter/SPKG.txt b/build/pkgs/gap_jupyter/SPKG.txt deleted file mode 100644 index 4e136a47c1c..00000000000 --- a/build/pkgs/gap_jupyter/SPKG.txt +++ /dev/null @@ -1,16 +0,0 @@ -= jupyter-kernel-gap = - -== Description == - -Jupyter kernel for GAP - -This wrapper-kernel is a Jupyter kernel for the GAP Computer Algebra System -based on the same ideas as the bash wrapper kernel. - -== License == - -3-Clause BSD License - -== Upstream Contact == - -* https://github.com/gap-packages/jupyter-gap diff --git a/build/pkgs/gap_packages/SPKG.rst b/build/pkgs/gap_packages/SPKG.rst new file mode 100644 index 00000000000..780d0823563 --- /dev/null +++ b/build/pkgs/gap_packages/SPKG.rst @@ -0,0 +1,148 @@ +gap_packages +============ + +Description +----------- + +Several "official" and "undeposited" GAP packages available from +http://www.gap-system.org/Packages/packages.html + + +Upstream Contact +---------------- + +- Dmitrii Pasechnik, dimpase@gmail.com +- David Joyner, wdjoyner@gmail.com (on the GAP team) +- Steve Linton, sal@dcs.st-and.ac.uk (basically the GAP lead developer) + +Dependencies +------------ + +- GAP (a standard spkg) + +TODO +---- + +The crystallographic group packages are untested/untestable. They rely +on polymake and the dependency "cryst" is missing. This needs to be +cleaned up. + +Notes +----- + +A brief description of each package follows: + +cohomolo - The cohomolo package is a GAP interface to some ``C`` programs +for computing Schur multipliers and covering groups of finite groups and +first and second cohomology groups of finite groups acting on finite +modules. (Author: Max Horn, Markus Pfeiffer) + +CoReLG - Contains functionality for working with real semisimple Lie +algebras. (Author: Heiko Dietrich, Paolo Faccin, Willem Adriaan de +Graaf) + +crime - package to compute the cohomology ring of finite p-groups, +induced maps, and Massey products. (Author: Marcus Bishop) + +cryst - Computing with crystallographic groups (Authors: Bettina Eick, +Franz Gähler, Werner Nickel) + +CTblLib - The GAP Character Table Library (Author: Thomas Breuer) + +DESIGN is a package for classifying, partitioning and studying block +designs. (Author: Leonard H. Soicher) + +FactInt is a package providing routines for factoring integers, in +particular: + +- Pollard's p-1 +- Williams' p+1 +- Elliptic Curves Method (ECM) +- Continued Fraction Algorithm (CFRAC) +- Multiple Polynomial Quadratic Sieve (MPQS) + +(Author: Stefan Kohl) + +GAPDoc is a package containing a definition of a structure for GAP +documentation, based on XML. It also contains conversion programs for +producing text-, DVI-, PDF- or HTML-versions of such documents, with +hyperlinks if possible. (Authors: Frank Luebeck, Max Neunhoeffer) + +GBNP - The GBNP package provides algorithms for computing Grobner bases +of noncommutative polynomials with coefficients from a field implemented +in GAP and with respect to the "total degree first then lexicographical" +ordering. Further provided are some variations, such as a weighted and +truncated version and a tracing facility. The word "algorithm" is to be +interpreted loosely here: in general one cannot expect such an algorithm +to terminate, as it would imply solvability of the word problem for +finitely presented (semi)groups. (Authors: A.M. Cohen, J.W. Knopper) + +GRAPE is a package for computing with graphs and groups, and is +primarily designed for constructing and analysing graphs related to +groups, finite geometries, and designs. (Author: Leonard H. Soicher) + +GUAVA is included here, and with Sage standard. + +HAP (Homological Algebra Programming) is a GAP package providing some +functions for group cohomology computation. (Author: Graham Ellis) + +HAPcryst - an extension package for HAP, which allows for group +cohomology computation for a wider class of groups. (Author: Marc +Roeder) + +hecke - Provides functions for calculating decomposition matrices of +Hecke algebras of the symmetric groups and q-Schur algebras. Hecke is a +port of the GAP 3 package Specht 2.4 to GAP 4. (Author: Dmitriy Traytel) + +LAGUNA - this package provides functionality for calculation of the +normalized unit group of the modular group algebra of the finite p-group +and for investigation of Lie algebra associated with group algebras and +other associative algebras. (Authors :Victor Bovdi, Alexander Konovalov, +Richard Rossmanith, Csaba Schneider) + +liealgdb - A database of Lie algebras (Author: Serena Cicalo', Willem +Adriaan de Graaf, Csaba Schneider) + +LiePRing - Database and algorithms for Lie p-rings (Author: Michael +Vaughan-Lee, Bettina Eick) + +LieRing - contains functionality for working with finitely presented Lie +rings and the Lazard correspondence. (Author: Serena Cicalo', Willem +Adriaan de Graaf) + +loops - Provides researchers in nonassociative algebra with a +computational tool that integrates standard notions of loop theory with +libraries of loops and group-theoretical algorithms of GAP. The package +also expands GAP toward nonassociative structures. (Authors: Gabor Nagy, +Petr Vojtechovsky) + +mapclass - The package calculates the mapping class group orbits for a +given finite group. (Authors: Adam James, Kay Magaard, Sergey +Shpectorov, Helmut Volklein) + +polymake - an interface with the (standalone) polymake program used by +HAPcryst. (Author: Marc Roeder) + +qpa - Quivers and Path Algebras provides data structures and algorithms +for doing computations with finite dimensional quotients of path +algebras, and finitely generated modules over such algebras. The current +version of the QPA package has data structures for quivers, quotients of +path algebras, and modules, homomorphisms and complexes of modules over +quotients of path algebras. (Authors: Edward Green, Oeyvind Solberg) + +quagroup - Contains functionality for working with quantized enveloping +algebras of finite-dimensional semisimple Lie algebras. (Author: Willem +Adriaan de Graaf) + +repsn - The package provides GAP functions for computing characteristic +zero matrix representations of finite groups. (Author: Vahid Dabbaghian) + +sla - a package for doing computations with simple Lie algebras (Author: +Willem Adriaan de Graaf) + +SONATA ("System Of Nearrings And Their Applications") is a package which +constructs finite nearrings and related objects. (Authors: Erhard +Aichinger, Franz Binder, Jürgen Ecker, Peter Mayr, Christof Noebauer) + +TORIC is a GAP package for computing with toric varieties. (Author: +David Joyner) diff --git a/build/pkgs/gap_packages/SPKG.txt b/build/pkgs/gap_packages/SPKG.txt deleted file mode 100644 index b50a4430aff..00000000000 --- a/build/pkgs/gap_packages/SPKG.txt +++ /dev/null @@ -1,152 +0,0 @@ -= gap_packages = - -== Description == - -Several "official" and "undeposited" GAP packages available from -http://www.gap-system.org/Packages/packages.html - -== Upstream Contact == - - * Dmitrii Pasechnik, dimpase@gmail.com - * David Joyner, wdjoyner@gmail.com (on the GAP team) - * Steve Linton, sal@dcs.st-and.ac.uk (basically the GAP lead developer) - -== Dependencies == - - * GAP (a standard spkg) - -== TODO == - -The crystallographic group packages are untested/untestable. They rely -on polymake and the dependency "cryst" is missing. This needs to be -cleaned up. - -== Notes == - -A brief description of each package follows: - -cohomolo - The cohomolo package is a GAP interface to some -`C' programs for computing Schur multipliers and covering groups -of finite groups and first and second cohomology groups of finite -groups acting on finite modules. -(Author: Max Horn, Markus Pfeiffer) - -CoReLG - Contains functionality for working with real semisimple -Lie algebras. -(Author: Heiko Dietrich, Paolo Faccin, Willem Adriaan de Graaf) - -crime - package to compute the cohomology ring of finite -p-groups, induced maps, and Massey products. -(Author: Marcus Bishop) - -cryst - Computing with crystallographic groups -(Authors: Bettina Eick, Franz Gähler, Werner Nickel) - -CTblLib - The GAP Character Table Library -(Author: Thomas Breuer) - -DESIGN is a package for classifying, partitioning and studying block designs. -(Author: Leonard H. Soicher) - -FactInt is a package providing routines for factoring integers, in particular: - * Pollard's p-1 - * Williams' p+1 - * Elliptic Curves Method (ECM) - * Continued Fraction Algorithm (CFRAC) - * Multiple Polynomial Quadratic Sieve (MPQS) -(Author: Stefan Kohl) - -GAPDoc is a package containing a definition of a structure for -GAP documentation, based on XML. It also contains conversion -programs for producing text-, DVI-, PDF- or HTML-versions of such -documents, with hyperlinks if possible. -(Authors: Frank Luebeck, Max Neunhoeffer) - -GBNP - The GBNP package provides algorithms for computing Grobner bases -of noncommutative polynomials with coefficients from a field implemented -in GAP and with respect to the "total degree first then lexicographical" -ordering. Further provided are some variations, such as a weighted and -truncated version and a tracing facility. The word "algorithm" is to be -interpreted loosely here: in general one cannot expect such an algorithm -to terminate, as it would imply solvability of the word problem for -finitely presented (semi)groups. -(Authors: A.M. Cohen, J.W. Knopper) - -GRAPE is a package for computing with graphs and groups, and is primarily -designed for constructing and analysing graphs related to groups, -finite geometries, and designs. -(Author: Leonard H. Soicher) - -GUAVA is included here, and with Sage standard. - -HAP (Homological Algebra Programming) is a GAP package -providing some functions for group cohomology computation. -(Author: Graham Ellis) - -HAPcryst - an extension package for HAP, which allows for -group cohomology computation for a wider class of groups. -(Author: Marc Roeder) - -hecke - Provides functions for calculating decomposition matrices -of Hecke algebras of the symmetric groups and q-Schur algebras. -Hecke is a port of the GAP 3 package Specht 2.4 to GAP 4. -(Author: Dmitriy Traytel) - -LAGUNA - this package provides functionality for calculation of the -normalized unit group of the modular group algebra of the finite -p-group and for investigation of Lie algebra associated with group -algebras and other associative algebras. -(Authors :Victor Bovdi, Alexander Konovalov, Richard Rossmanith, -Csaba Schneider) - -liealgdb - A database of Lie algebras -(Author: Serena Cicalo', Willem Adriaan de Graaf, Csaba Schneider) - -LiePRing - Database and algorithms for Lie p-rings -(Author: Michael Vaughan-Lee, Bettina Eick) - -LieRing - contains functionality for working with finitely -presented Lie rings and the Lazard correspondence. -(Author: Serena Cicalo', Willem Adriaan de Graaf) - -loops - Provides researchers in nonassociative algebra with a -computational tool that integrates standard notions of loop theory -with libraries of loops and group-theoretical algorithms of GAP. -The package also expands GAP toward nonassociative structures. -(Authors: Gabor Nagy, Petr Vojtechovsky) - -mapclass - The package calculates the mapping class group orbits -for a given finite group. -(Authors: Adam James, Kay Magaard, Sergey Shpectorov, Helmut Volklein) - -polymake - an interface with the (standalone) polymake program -used by HAPcryst. -(Author: Marc Roeder) - -qpa - Quivers and Path Algebras provides data structures and -algorithms for doing computations with finite dimensional quotients -of path algebras, and finitely generated modules over such algebras. -The current version of the QPA package has data structures for quivers, -quotients of path algebras, and modules, homomorphisms and complexes -of modules over quotients of path algebras. -(Authors: Edward Green, Oeyvind Solberg) - -quagroup - Contains functionality for working with quantized -enveloping algebras of finite-dimensional semisimple Lie algebras. -(Author: Willem Adriaan de Graaf) - -repsn - The package provides GAP functions for computing -characteristic zero matrix representations of finite groups. -(Author: Vahid Dabbaghian) - -sla - a package for doing computations with simple Lie algebras -(Author: Willem Adriaan de Graaf) - -SONATA ("System Of Nearrings And Their Applications") is a package -which constructs finite nearrings and related objects. -(Authors: Erhard Aichinger, Franz Binder, Jürgen Ecker, Peter Mayr, -Christof Noebauer) - -TORIC is a GAP package for computing with toric varieties. -(Author: David Joyner) - diff --git a/build/pkgs/gc/SPKG.rst b/build/pkgs/gc/SPKG.rst new file mode 100644 index 00000000000..e6bf7c35fbf --- /dev/null +++ b/build/pkgs/gc/SPKG.rst @@ -0,0 +1,35 @@ +gc +== + +Description +----------- + +The Boehm-Demers-Weiser conservative garbage collector. + +License +------- + +- Permissive BSD + GPL 2.0+ + + +Upstream Contact +---------------- + +Webpage: http://www.hboehm.info/gc/ Email List: +bdwgc@lists.opendylan.org + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +None. + +Patches +~~~~~~~ + +- cygwin64.patch: let libgc build on Cygwin64. diff --git a/build/pkgs/gc/SPKG.txt b/build/pkgs/gc/SPKG.txt deleted file mode 100644 index fc72c50600f..00000000000 --- a/build/pkgs/gc/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= gc = - -== Description == - -The Boehm-Demers-Weiser conservative garbage collector. - -== License == - -* Permissive BSD + GPL 2.0+ - -== Upstream Contact == - -Webpage: http://www.hboehm.info/gc/ -Email List: bdwgc@lists.opendylan.org - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - -=== Patches === - * cygwin64.patch: let libgc build on Cygwin64. diff --git a/build/pkgs/gcc/SPKG.rst b/build/pkgs/gcc/SPKG.rst new file mode 100644 index 00000000000..0fe63a12e96 --- /dev/null +++ b/build/pkgs/gcc/SPKG.rst @@ -0,0 +1,32 @@ +gcc +=== + +Description +----------- + +The GNU Compiler Collection, including the C, C++ and Fortran compiler. + +License +------- + +GPL version 2 or version 3 + + +Upstream Contact +---------------- + +http://gcc.gnu.org/ + +Dependencies +------------ + +- zlib +- MPIR +- MPFR +- MPC + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/gcc/SPKG.txt b/build/pkgs/gcc/SPKG.txt deleted file mode 100644 index 3af5759c43c..00000000000 --- a/build/pkgs/gcc/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= gcc = - -== Description == - -The GNU Compiler Collection, including the C, C++ and Fortran compiler. - -== License == - -GPL version 2 or version 3 - -== Upstream Contact == - -http://gcc.gnu.org/ - -== Dependencies == - - * zlib - * MPIR - * MPFR - * MPC - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/gdb/SPKG.rst b/build/pkgs/gdb/SPKG.rst new file mode 100644 index 00000000000..d4975db94da --- /dev/null +++ b/build/pkgs/gdb/SPKG.rst @@ -0,0 +1,36 @@ +GDB +=== + +Description +----------- + +GDB, the GNU Project debugger, allows you to see what is going on +"inside" another program while it executes -- or what another program +was doing at the moment it crashed. + +License +------- + +GPL v3+ + + +Upstream Contact +---------------- + +http://www.gnu.org/software/gdb/ + +Dependencies +------------ + +- python +- mpc +- mpfr +- ppl +- gmp/mpir +- makeinfo (external) + + +Special Update/Build Instructions +--------------------------------- + +Current version needs makeinfo installed to build successfully. diff --git a/build/pkgs/gdb/SPKG.txt b/build/pkgs/gdb/SPKG.txt deleted file mode 100644 index 865c08f30ac..00000000000 --- a/build/pkgs/gdb/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= GDB = - -== Description == - -GDB, the GNU Project debugger, allows you to see what is going on -"inside" another program while it executes -- or what another program -was doing at the moment it crashed. - -== License == - -GPL v3+ - -== Upstream Contact == - -http://www.gnu.org/software/gdb/ - -== Dependencies == - -* python -* mpc -* mpfr -* ppl -* gmp/mpir -* makeinfo (external) - -== Special Update/Build Instructions == - -Current version needs makeinfo installed -to build successfully. diff --git a/build/pkgs/gf2x/SPKG.rst b/build/pkgs/gf2x/SPKG.rst new file mode 100644 index 00000000000..cee64e7ff1f --- /dev/null +++ b/build/pkgs/gf2x/SPKG.rst @@ -0,0 +1,62 @@ +gf2x +==== + +Description +----------- + +gf2x is a C/C++ software package containing routines for fast arithmetic +in GF(2)[x] (multiplication, squaring, GCD) and searching for +irreducible/primitive trinomials. + +Website: http://gf2x.gforge.inria.fr/ + +License +------- + +- GNU GPLv2+. + + +Upstream Contact +---------------- + +- Richard Brent +- Pierrick Gaudry +- Emmanuel Thomé +- Paul Zimmermann + +Dependencies +------------ + +- None + + +Special Update/Build Instructions +--------------------------------- + +- As some patches touch config/acinclude.m4, we have to touch + aclocal.m4, + configure, Makefile.in and gf2x/gf2x-config.h.in to prevent autotools + to try to regenerate these files. + +Patches +~~~~~~~ + +- 0001-Trac-15014-Let-gf2x-build-a-shared-library-on-Cygwin.patch: pass + -no-undefined flag to libtool. +- 0002-tr-portability.patch: backport upstream fix for non-portable tr + use +- 0003-Improve-detection-of-sse2-support.patch: backport upstream + improved check for sse2 + +- 0004-Add-disable-hardware-specific-code.patch: add option + -disable-hardware-specific-code to build system. This is partly + backported from upstream. + +- 0005-Update-autotooled-files.patch: the above patches make changes to + code used by autotools for generation of the build system. This + patches + those files, so that autotools need not be installed. + +- 0006-Fix_make_check_not_failing_on_errors.patch: (upstream patch) + Fix bug in shell script such that 'make check' always fails upon + errors. diff --git a/build/pkgs/gf2x/SPKG.txt b/build/pkgs/gf2x/SPKG.txt deleted file mode 100644 index f383bef530c..00000000000 --- a/build/pkgs/gf2x/SPKG.txt +++ /dev/null @@ -1,40 +0,0 @@ -= gf2x = - -== Description == -gf2x is a C/C++ software package containing routines for fast arithmetic -in GF(2)[x] (multiplication, squaring, GCD) and searching for -irreducible/primitive trinomials. - -Website: http://gf2x.gforge.inria.fr/ - -== License == - * GNU GPLv2+. - -== Upstream Contact == - * Richard Brent - * Pierrick Gaudry - * Emmanuel Thomé - * Paul Zimmermann - -== Dependencies == - * None - -== Special Update/Build Instructions == - * As some patches touch config/acinclude.m4, we have to touch aclocal.m4, - configure, Makefile.in and gf2x/gf2x-config.h.in to prevent autotools - to try to regenerate these files. - -=== Patches === - * 0001-Trac-15014-Let-gf2x-build-a-shared-library-on-Cygwin.patch: pass - -no-undefined flag to libtool. - * 0002-tr-portability.patch: backport upstream fix for non-portable tr use - * 0003-Improve-detection-of-sse2-support.patch: backport upstream improved - check for sse2 - * 0004-Add-disable-hardware-specific-code.patch: add option - --disable-hardware-specific-code to build system. This is partly - backported from upstream. - * 0005-Update-autotooled-files.patch: the above patches make changes to - code used by autotools for generation of the build system. This patches - those files, so that autotools need not be installed. - * 0006-Fix_make_check_not_failing_on_errors.patch: (upstream patch) - Fix bug in shell script such that 'make check' always fails upon errors. diff --git a/build/pkgs/gfan/SPKG.rst b/build/pkgs/gfan/SPKG.rst new file mode 100644 index 00000000000..292dfe62166 --- /dev/null +++ b/build/pkgs/gfan/SPKG.rst @@ -0,0 +1,46 @@ +gfan +==== + +Description +----------- + +Gfan is a software package for computing Groebner fans and tropical +varieties. These are polyhedral fans associated to polynomial ideals. +The maximal cones of a Groebner fan are in bijection with the marked +reduced Groebner bases of its defining ideal. The software computes all +marked reduced Groebner bases of an ideal. Their union is a universal +Groebner basis. The tropical variety of a polynomial ideal is a certain +subcomplex of the Groebner fan. Gfan contains algorithms for computing +this complex for general ideals and specialized algorithms for tropical +curves, tropical hypersurfaces and tropical varieties of prime ideals. +In addition to the above core functions the package contains many tools +which are useful in the study of Groebner bases, initial ideals and +tropical geometry. The full list of commands can be found in Appendix B +of the manual. For ordinary Groebner basis computations Gfan is not +competitive in speed compared to programs such as CoCoA, Singular and +Macaulay2. + +License +------- + +- GPL version 2 or version 3 (according to the gfan website) + + +Upstream Contact +---------------- + +Anders Nedergaard Jensen; for contact info check out +http://home.imf.au.dk/jensen/software/gfan/gfan.html + +Dependencies +------------ + +- GMP/MPIR +- CDDLIB + + +Special Update/Build Instructions +--------------------------------- + +Remove the doc, homepage, and examples subdirectories, which take up +most of the space. diff --git a/build/pkgs/gfan/SPKG.txt b/build/pkgs/gfan/SPKG.txt deleted file mode 100644 index 022c47d1c0b..00000000000 --- a/build/pkgs/gfan/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= gfan = - -== Description == - -Gfan is a software package for computing Groebner fans and tropical varieties. -These are polyhedral fans associated to polynomial ideals. The maximal cones -of a Groebner fan are in bijection with the marked reduced Groebner bases of -its defining ideal. The software computes all marked reduced Groebner bases of -an ideal. Their union is a universal Groebner basis. The tropical variety of a -polynomial ideal is a certain subcomplex of the Groebner fan. Gfan contains -algorithms for computing this complex for general ideals and specialized -algorithms for tropical curves, tropical hypersurfaces and tropical varieties -of prime ideals. In addition to the above core functions the package contains -many tools which are useful in the study of Groebner bases, initial ideals and -tropical geometry. The full list of commands can be found in Appendix B of the -manual. For ordinary Groebner basis computations Gfan is not competitive in -speed compared to programs such as CoCoA, Singular and Macaulay2. - -== License == - - * GPL version 2 or version 3 (according to the gfan website) - -== Upstream Contact == - -Anders Nedergaard Jensen; for contact info check out -http://home.imf.au.dk/jensen/software/gfan/gfan.html - -== Dependencies == - - * GMP/MPIR - * CDDLIB - -== Special Update/Build Instructions == - -Remove the doc, homepage, and examples subdirectories, which take up -most of the space. diff --git a/build/pkgs/gfortran/SPKG.rst b/build/pkgs/gfortran/SPKG.rst new file mode 100644 index 00000000000..3b4352444d1 --- /dev/null +++ b/build/pkgs/gfortran/SPKG.rst @@ -0,0 +1,33 @@ +gfortran +======== + +Description +----------- + +The GNU Compiler Collection, including the C, C++ and Fortran compiler. +This particular package is meant to only make gfortran available. + +License +------- + +GPL version 2 or version 3 + + +Upstream Contact +---------------- + +http://gcc.gnu.org/ + +Dependencies +------------ + +- zlib +- MPIR +- MPFR +- MPC + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/gfortran/SPKG.txt b/build/pkgs/gfortran/SPKG.txt deleted file mode 100644 index 0f9c79bf9dc..00000000000 --- a/build/pkgs/gfortran/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= gfortran = - -== Description == - -The GNU Compiler Collection, including the C, C++ and Fortran compiler. -This particular package is meant to only make gfortran available. - -== License == - -GPL version 2 or version 3 - -== Upstream Contact == - -http://gcc.gnu.org/ - -== Dependencies == - - * zlib - * MPIR - * MPFR - * MPC - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/giac/SPKG.rst b/build/pkgs/giac/SPKG.rst new file mode 100644 index 00000000000..2bfa3918dec --- /dev/null +++ b/build/pkgs/giac/SPKG.rst @@ -0,0 +1,57 @@ +GIAC +==== + +Description +----------- + +- Giac is a general purpose Computer algebra system by Bernard Parisse. + It consists of: +- a C++ library (libgiac). +- a command line interpreter (icas or giac). +- the built of the FLTK-based GUI (xcas) has been disabled in the + spkg-install file. + +- The english documentation will be installed in: + + $SAGE_LOCAL/share/giac/doc/en/cascmd_en/index.html + +- Author's website with debian, ubuntu, macosx, windows package: + + http://www-fourier.ujf-grenoble.fr/~parisse/giac.html + +- The Freebsd port is math/giacxcas + +Licence +------- + +GPLv3+ + +Note: except the french html documentation which is freely +redistributable for non commercial only purposes. This doc has been +removed in the Sage package, see spkg-src + + +Upstream Contact +---------------- + +- Bernard Parisse: + http://www-fourier.ujf-grenoble.fr/~parisse/giac.html +- Source file (giac-x.y.z-t.tar.gz) in: + + http://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/ + +Dependencies +------------ + +- gettext, readline +- giac will benefit of ntl, pari, mpfr, gsl, lapack but they should be + already installed by sage. +- giac can also benefit of mpfi for arithmetic on intervals. +- The Documentation is pre-built, hevea or latex or ... are not needed + to install the package. + + +Special Update/Build Instructions +--------------------------------- + +- Use spkg-src to update this package diff --git a/build/pkgs/giac/SPKG.txt b/build/pkgs/giac/SPKG.txt deleted file mode 100644 index d4d0a35ba5b..00000000000 --- a/build/pkgs/giac/SPKG.txt +++ /dev/null @@ -1,40 +0,0 @@ -= GIAC = - -== Description == - - * Giac is a general purpose Computer algebra system by Bernard Parisse. It consists of: - - a C++ library (libgiac). - - a command line interpreter (icas or giac). - - the built of the FLTK-based GUI (xcas) has been disabled in the spkg-install file. - - * The english documentation will be installed in: - $SAGE_LOCAL/share/giac/doc/en/cascmd_en/index.html - - * -Author's website with debian, ubuntu, macosx, windows package: - http://www-fourier.ujf-grenoble.fr/~parisse/giac.html - -The Freebsd port is math/giacxcas - -== Licence == - -GPLv3+ - -Note: except the french html documentation which is freely -redistributable for non commercial only purposes. This doc has been -removed in the Sage package, see spkg-src - -== Upstream Contact == - - * Bernard Parisse: http://www-fourier.ujf-grenoble.fr/~parisse/giac.html - * Source file (giac-x.y.z-t.tar.gz) in: - http://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/ - -== Dependencies == - - * gettext, readline - * giac will benefit of ntl, pari, mpfr, gsl, lapack but they should be already installed by sage. - * giac can also benefit of mpfi for arithmetic on intervals. - * The Documentation is pre-built, hevea or latex or ... are not needed to install the package. - -== Special Update/Build Instructions == - - * Use spkg-src to update this package diff --git a/build/pkgs/giacpy_sage/SPKG.rst b/build/pkgs/giacpy_sage/SPKG.rst new file mode 100644 index 00000000000..af4bd19500c --- /dev/null +++ b/build/pkgs/giacpy_sage/SPKG.rst @@ -0,0 +1,31 @@ +GIACPY +====== + +Description +----------- + +- Giacpy is a cython frontend to the c++ library giac. This is the sage + version. +- The sage version of giacpy after 0.6 is renamed to giacpy_sage + +Licence +------- + +GPLv2 or above + + +Upstream Contact +---------------- + +- Han Frederic: frederic.han@imj-prg.fr + + https://www.imj-prg.fr/~frederic.han/xcas/giacpy/ + +Dependencies +------------ + +- gmp, giac (the C++ library libgiac and headers) + + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/giacpy_sage/SPKG.txt b/build/pkgs/giacpy_sage/SPKG.txt deleted file mode 100644 index 37a49a2ec9a..00000000000 --- a/build/pkgs/giacpy_sage/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= GIACPY = - -== Description == - - * Giacpy is a cython frontend to the c++ library giac. This is the sage version. - * The sage version of giacpy after 0.6 is renamed to giacpy_sage - -== Licence == - -GPLv2 or above - -== Upstream Contact == - - * Han Frederic: frederic.han@imj-prg.fr - https://www.imj-prg.fr/~frederic.han/xcas/giacpy/ - -== Dependencies == - - * gmp, giac (the C++ library libgiac and headers) - -== Special Update/Build Instructions == - diff --git a/build/pkgs/git/SPKG.rst b/build/pkgs/git/SPKG.rst new file mode 100644 index 00000000000..408192996a7 --- /dev/null +++ b/build/pkgs/git/SPKG.rst @@ -0,0 +1,28 @@ + +git - the stupid content tracker +================================ + +Description +----------- + + Git is a fast, scalable, distributed revision control system with an + unusually rich command set that provides both high-operations and + full access to internals. + +- ``man git`` + + +Upstream Contact +---------------- + +- Maintainer: Junio C. Hamano +- Website: http://git-scm.com/ + +Dependencies +------------ + +- zlib + +Note: excluding libcurl and expat because they are large and only +required if you're communicating with repositories over HTTP. If you +need to do so, please use an external version of git. diff --git a/build/pkgs/git/SPKG.txt b/build/pkgs/git/SPKG.txt deleted file mode 100644 index a2c8e31260a..00000000000 --- a/build/pkgs/git/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= git - the stupid content tracker = - -== Description == - - Git is a fast, scalable, distributed revision control system with an - unusually rich command set that provides both high-operations and - full access to internals. - - -- `man git` - -== Upstream Contact == - - * Maintainer: Junio C. Hamano - * Website: http://git-scm.com/ - -== Dependencies == - - * zlib - -Note: excluding libcurl and expat because they are large and only -required if you're communicating with repositories over HTTP. If you -need to do so, please use an external version of git. - diff --git a/build/pkgs/git_trac/SPKG.rst b/build/pkgs/git_trac/SPKG.rst new file mode 100644 index 00000000000..d11ec626fbe --- /dev/null +++ b/build/pkgs/git_trac/SPKG.rst @@ -0,0 +1,32 @@ + +Git-Trac +======== + +Description +----------- + +This module implements a "git trac" subcommand of the git suite that +interfaces with trac over XMLRPC. + +License +------- + +GPLv3+ + + +Upstream Contact +---------------- + +- https://github.com/sagemath/git-trac-command +- Volker Braun + +Dependencies +------------ + +- python 2.7 or 3.3+ + + +Special Update/Build Instructions +--------------------------------- + +Nothing special, just use the provided setup.py diff --git a/build/pkgs/git_trac/SPKG.txt b/build/pkgs/git_trac/SPKG.txt deleted file mode 100644 index 08c3b2b7683..00000000000 --- a/build/pkgs/git_trac/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= Git-Trac = - -== Description == - -This module implements a "git trac" subcommand of the git suite that -interfaces with trac over XMLRPC. - -== License == - -GPLv3+ - -== Upstream Contact == - -https://github.com/sagemath/git-trac-command -Volker Braun - -== Dependencies == - -* python 2.7 or 3.3+ - -== Special Update/Build Instructions == - -Nothing special, just use the provided setup.py - diff --git a/build/pkgs/givaro/SPKG.rst b/build/pkgs/givaro/SPKG.rst new file mode 100644 index 00000000000..54198224ef2 --- /dev/null +++ b/build/pkgs/givaro/SPKG.rst @@ -0,0 +1,36 @@ +Givaro +====== + +Description +----------- + +Givaro is a C++ library for arithmetic and algebraic computations. Its +main features are implementations of the basic arithmetic of many +mathematical entities: Primes fields, Extensions Fields, Finite Fields, +Finite Rings, Polynomials, Algebraic numbers, Arbitrary precision +integers and rationals (C++ wrappers over gmp) It also provides +data-structures and templated classes for the manipulation of basic +algebraic objects, such as vectors, matrices (dense, sparse, +structured), univariate polynomials (and therefore recursive +multivariate). + +Website: http://www-lmc.imag.fr/CASYS/LOGICIELS/givaro/ + +SPKG Repository: https://bitbucket.org/malb/givaro-spkg + +License +------- + +- GNU GPL + + +Upstream Contact +---------------- + +- Clement Pernet + +Dependencies +------------ + +- GNU patch +- GMP/MPIR diff --git a/build/pkgs/givaro/SPKG.txt b/build/pkgs/givaro/SPKG.txt deleted file mode 100644 index 276d555dc03..00000000000 --- a/build/pkgs/givaro/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= Givaro = - -== Description == - -Givaro is a C++ library for arithmetic and algebraic computations. Its -main features are implementations of the basic arithmetic of many -mathematical entities: Primes fields, Extensions Fields, Finite -Fields, Finite Rings, Polynomials, Algebraic numbers, Arbitrary -precision integers and rationals (C++ wrappers over gmp) It also -provides data-structures and templated classes for the manipulation of -basic algebraic objects, such as vectors, matrices (dense, sparse, -structured), univariate polynomials (and therefore recursive -multivariate). - -Website: http://www-lmc.imag.fr/CASYS/LOGICIELS/givaro/ - -SPKG Repository: https://bitbucket.org/malb/givaro-spkg - -== License == - - * GNU GPL - -== Upstream Contact == - - * Clement Pernet - -== Dependencies == - - * GNU patch - * GMP/MPIR - diff --git a/build/pkgs/glpk/SPKG.rst b/build/pkgs/glpk/SPKG.rst new file mode 100644 index 00000000000..5dfc404acd5 --- /dev/null +++ b/build/pkgs/glpk/SPKG.rst @@ -0,0 +1,72 @@ +GLPK +==== + +Description +----------- + +The GLPK (GNU Linear Programming Kit) package is intended for solving +large-scale linear programming (LP), mixed integer programming (MIP), +and other related problems. It is a set of routines written in ANSI C +and organized in the form of a callable library. + +GLPK supports the GNU MathProg modelling language, which is a subset of +the AMPL language. + +The GLPK package includes the following main components: + +- primal and dual simplex methods +- primal-dual interior-point method +- branch-and-cut method +- translator for GNU MathProg +- application program interface (API) +- stand-alone LP/MIP solver + +License +------- + +The GLPK package is GPL version 3. + + +Upstream Contact +---------------- + +GLPK is currently being maintained by: + +- Andrew Makhorin (mao@gnu.org, mao@mai2.rcnet.ru) + +http://www.gnu.org/software/glpk/#maintainer + +Dependencies +------------ + +- GMP/MPIR +- zlib + + +Special Update/Build Instructions +--------------------------------- + +- ``configure`` doesn't support specifying the location of the GMP + library to use; only ``--with-gmp[=yes]`` or ``--with-gmp=no`` + are valid options. (So we \*have to\* add Sage's include and + library directories to ``CPPFLAGS`` and ``LDFLAGS``, respectively.) + +- Do we need the ``--disable-static``? The stand-alone solver presumably + runs faster when built with a static library; also other + (stand-alone) + programs using it would. + (Instead, we should perhaps use ``--enable-static --enable-shared`` + to + go safe.) + +Patches +~~~~~~~ + +- All patches below are currently used by spkg-src +- src/01-zlib.patch: don't build the included zlib library. +- src/02-cygwin_sharedlib.patch: Let a shared library be built on + Cygwin by + passing the -no-undefined flag to libtool. + + The numbering reflect the order in which they have been created from + glpk pristine's sources diff --git a/build/pkgs/glpk/SPKG.txt b/build/pkgs/glpk/SPKG.txt deleted file mode 100644 index 5dfc5a169e0..00000000000 --- a/build/pkgs/glpk/SPKG.txt +++ /dev/null @@ -1,59 +0,0 @@ -= GLPK = - -== Description == - -The GLPK (GNU Linear Programming Kit) package is intended for solving -large-scale linear programming (LP), mixed integer programming (MIP), -and other related problems. It is a set of routines written in ANSI C -and organized in the form of a callable library. - -GLPK supports the GNU MathProg modelling language, which is a subset of -the AMPL language. - -The GLPK package includes the following main components: - - * primal and dual simplex methods - * primal-dual interior-point method - * branch-and-cut method - * translator for GNU MathProg - * application program interface (API) - * stand-alone LP/MIP solver - -== License == - -The GLPK package is GPL version 3. - -== Upstream Contact == - -GLPK is currently being maintained by: - - * Andrew Makhorin (mao@gnu.org, mao@mai2.rcnet.ru) - -http://www.gnu.org/software/glpk/#maintainer - -== Dependencies == - - * GMP/MPIR - * zlib - -== Special Update/Build Instructions == - - * `configure` doesn't support specifying the location of the GMP - library to use; only `--with-gmp[=yes]` or `--with-gmp=no` - are valid options. (So we *have to* add Sage's include and - library directories to `CPPFLAGS` and `LDFLAGS`, respectively.) - * Do we need the `--disable-static`? The stand-alone solver presumably - runs faster when built with a static library; also other (stand-alone) - programs using it would. - (Instead, we should perhaps use `--enable-static --enable-shared` to - go safe.) - -=== Patches === - - * All patches below are currently used by spkg-src - * src/01-zlib.patch: don't build the included zlib library. - * src/02-cygwin_sharedlib.patch: Let a shared library be built on Cygwin by - passing the -no-undefined flag to libtool. - - The numbering reflect the order in which they have been created from - glpk pristine's sources diff --git a/build/pkgs/glucose/SPKG.rst b/build/pkgs/glucose/SPKG.rst new file mode 100644 index 00000000000..d37117825b2 --- /dev/null +++ b/build/pkgs/glucose/SPKG.rst @@ -0,0 +1,45 @@ +glucose +======= + +Description +----------- + +Glucose is a SAT solver. + +Citing its website: \*The name of the solver is a contraction of the +concept of "glue clauses", a particular kind of clauses that glucose +detects and preserves during search. Glucose is heavily based on +Minisat, so please do cite Minisat also if you want to cite Glucose.\* + +License +------- + +- nonparallel glucose: MIT + +- parallel glucose-syrup: MIT modified with: + + The parallel version of Glucose (all files modified since Glucose 3.0 + releases, 2013) cannot be used in any competitive event (sat + competitions/evaluations) without the express permission of the + authors + (Gilles Audemard / Laurent Simon). This is also the case for any + competitive + event using Glucose Parallel as an embedded SAT engine (single core + or not). + + +Upstream Contact +---------------- + +Website: http://www.labri.fr/perso/lsimon/glucose/ + +Dependencies +------------ + +zlib + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/glucose/SPKG.txt b/build/pkgs/glucose/SPKG.txt deleted file mode 100644 index e2871477ba4..00000000000 --- a/build/pkgs/glucose/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= glucose = - -== Description == - -Glucose is a SAT solver. - -Citing its website: *The name of the solver is a contraction of the concept of -"glue clauses", a particular kind of clauses that glucose detects and preserves -during search. Glucose is heavily based on Minisat, so please do cite Minisat -also if you want to cite Glucose.* - -== License == - -- nonparallel glucose: MIT - -- parallel glucose-syrup: MIT modified with: - - The parallel version of Glucose (all files modified since Glucose 3.0 - releases, 2013) cannot be used in any competitive event (sat - competitions/evaluations) without the express permission of the authors - (Gilles Audemard / Laurent Simon). This is also the case for any competitive - event using Glucose Parallel as an embedded SAT engine (single core or not). - -== Upstream Contact == - -Website: http://www.labri.fr/perso/lsimon/glucose/ - -== Dependencies == - -zlib - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/gmp/SPKG.rst b/build/pkgs/gmp/SPKG.rst new file mode 100644 index 00000000000..c9103d3e5ca --- /dev/null +++ b/build/pkgs/gmp/SPKG.rst @@ -0,0 +1,22 @@ +GMP +=== + +Description +----------- + +GMP is a free library for arbitrary precision arithmetic, operating on +signed integers, rational numbers, and floating-point numbers. There is +no practical limit to the precision except the ones implied by the +available memory in the machine GMP runs on. GMP has a rich set of +functions, and the functions have a regular interface. + +License +------- + +- LGPL V3 + + +Upstream Contact +---------------- + +- http://gmplib.org diff --git a/build/pkgs/gmp/SPKG.txt b/build/pkgs/gmp/SPKG.txt deleted file mode 100644 index 2d0a54911db..00000000000 --- a/build/pkgs/gmp/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= GMP = - -== Description == - -GMP is a free library for arbitrary precision arithmetic, operating on signed -integers, rational numbers, and floating-point numbers. -There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on. -GMP has a rich set of functions, and the functions have a regular interface. - -== License == - * LGPL V3 - -== Upstream Contact == - * http://gmplib.org - diff --git a/build/pkgs/gmpy2/SPKG.rst b/build/pkgs/gmpy2/SPKG.rst new file mode 100644 index 00000000000..a31c7512872 --- /dev/null +++ b/build/pkgs/gmpy2/SPKG.rst @@ -0,0 +1,13 @@ +gmpy2 +===== + +Description +----------- + +GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x + +gmpy2 is a C-coded Python extension module that supports +multiple-precision arithmetic. In addition to supporting GMP or MPIR for +multiple-precision integer and rational arithmetic, gmpy2 adds support +for the MPFR (correctly rounded real floating-point arithmetic) and MPC +(correctly rounded complex floating-point arithmetic) libraries. diff --git a/build/pkgs/gmpy2/SPKG.txt b/build/pkgs/gmpy2/SPKG.txt deleted file mode 100644 index 8e8d7d35327..00000000000 --- a/build/pkgs/gmpy2/SPKG.txt +++ /dev/null @@ -1,11 +0,0 @@ -= gmpy2 = - -== Description == - -GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x - -gmpy2 is a C-coded Python extension module that supports multiple-precision -arithmetic. In addition to supporting GMP or MPIR for multiple-precision -integer and rational arithmetic, gmpy2 adds support for the MPFR (correctly -rounded real floating-point arithmetic) and MPC (correctly rounded complex -floating-point arithmetic) libraries. diff --git a/build/pkgs/gp2c/SPKG.rst b/build/pkgs/gp2c/SPKG.rst new file mode 100644 index 00000000000..35a232f6cae --- /dev/null +++ b/build/pkgs/gp2c/SPKG.rst @@ -0,0 +1,26 @@ +gp2c +==== + +Description +----------- + +The gp2c compiler is a package for translating GP routines into the C +programming language, so that they can be compiled and used with the +PARI system or the GP calculator. + +License +------- + +GPL version 2+ + + +Upstream Contact +---------------- + +- http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- PARI +- Perl diff --git a/build/pkgs/gp2c/SPKG.txt b/build/pkgs/gp2c/SPKG.txt deleted file mode 100644 index 984b63c7865..00000000000 --- a/build/pkgs/gp2c/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= gp2c = - -== Description == - -The gp2c compiler is a package for translating GP routines into the C -programming language, so that they can be compiled and used with the PARI -system or the GP calculator. - -== License == - -GPL version 2+ - -== Upstream Contact == - * http://pari.math.u-bordeaux.fr/ - -== Dependencies == - * PARI - * Perl diff --git a/build/pkgs/graphs/SPKG.txt b/build/pkgs/graphs/SPKG.rst similarity index 53% rename from build/pkgs/graphs/SPKG.txt rename to build/pkgs/graphs/SPKG.rst index 17e12fb75e9..e4c2960a5e5 100644 --- a/build/pkgs/graphs/SPKG.txt +++ b/build/pkgs/graphs/SPKG.rst @@ -1,26 +1,32 @@ -= graphs = +graphs +====== -== Description == +Description +----------- -A database of graphs. Created by Emily Kirkman based on the work of Jason -Grout. Since April 2012 it also contains the ISGCI graph database. +A database of graphs. Created by Emily Kirkman based on the work of +Jason Grout. Since April 2012 it also contains the ISGCI graph database. -== Upstream Contact == - * For ISGCI: +Upstream Contact +---------------- + +- For ISGCI: H.N. de Ridder (hnridder@graphclasses.org) - * For Andries Brouwer's database: +- For Andries Brouwer's database: The data is taken from from Andries E. Brouwer's website - (https://www.win.tue.nl/~aeb/). Anything related to the data should be + (https://www.win.tue.nl/~aeb/). Anything related to the data should + be reported to him directly (aeb@cwi.nl) - The code used to parse the data and create the .json file is available at + The code used to parse the data and create the .json file is + available at https://github.com/nathanncohen/strongly_regular_graphs_database. -== Dependencies == +Dependencies +------------ N/A - diff --git a/build/pkgs/gsl/SPKG.rst b/build/pkgs/gsl/SPKG.rst new file mode 100644 index 00000000000..851294e080a --- /dev/null +++ b/build/pkgs/gsl/SPKG.rst @@ -0,0 +1,58 @@ +gsl +=== + +Description +----------- + +Website: http://www.gnu.org/software/gsl/ + +From the website above: The GNU Scientific Library (GSL) is a numerical +library for C and C++ programmers. It is free software under the GNU +General Public License. + +The library provides a wide range of mathematical routines such as +random number generators, special functions and least-squares fitting. +There are over 1000 functions in total with an extensive test suite. If +the variable SAGE_CHECK is exported to the value "yes" when building +Sage, GSL's test suite is run. + +License +------- + +- GPL V3 + + +Upstream Contact +---------------- + +- http://www.gnu.org/software/gsl/ + +GSL mailing lists: + +- Bug-gsl mailing list -- bug reports for the GNU + Scientific Library should be sent to bug-gsl@gnu.org + +- Help-gsl users mailing list -- for questions about + installation, how GSL works and how it is used, or general questions + concerning GSL. + +- Info-gsl mailing list -- announcements of new + releases + are made there. + +Dependencies +------------ + +- None - GSL does not depend on any other Sage package to compile, link + and pass all of GSL's self-tests. Despite that fact, BLAS is listed + as + a dependency. (It comes with its own CBLAS implementation that is + e.g. + used when running the GSL test suite during installation; however, + the + Sage library only uses it as a fall-back, if e.g. BLAS library is not + present.) + + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/gsl/SPKG.txt b/build/pkgs/gsl/SPKG.txt deleted file mode 100644 index cd433ab7954..00000000000 --- a/build/pkgs/gsl/SPKG.txt +++ /dev/null @@ -1,45 +0,0 @@ -= gsl = - -== Description == - -Website: http://www.gnu.org/software/gsl/ - -From the website above: The GNU Scientific Library (GSL) is a numerical -library for C and C++ programmers. It is free software under the GNU General -Public License. - -The library provides a wide range of mathematical routines such as random -number generators, special functions and least-squares fitting. There are -over 1000 functions in total with an extensive test suite. If the variable -SAGE_CHECK is exported to the value "yes" when building Sage, GSL's test suite -is run. - -== License == - - * GPL V3 - -== Upstream Contact == - - * http://www.gnu.org/software/gsl/ - -GSL mailing lists: - - * Bug-gsl mailing list -- bug reports for the GNU - Scientific Library should be sent to bug-gsl@gnu.org - * Help-gsl users mailing list -- for questions about - installation, how GSL works and how it is used, or general questions - concerning GSL. - * Info-gsl mailing list -- announcements of new releases - are made there. - -== Dependencies == - - * None - GSL does not depend on any other Sage package to compile, link - and pass all of GSL's self-tests. Despite that fact, BLAS is listed as - a dependency. (It comes with its own CBLAS implementation that is e.g. - used when running the GSL test suite during installation; however, the - Sage library only uses it as a fall-back, if e.g. BLAS library is not - present.) - -== Special Update/Build Instructions == - diff --git a/build/pkgs/html5lib/SPKG.txt b/build/pkgs/html5lib/SPKG.rst similarity index 57% rename from build/pkgs/html5lib/SPKG.txt rename to build/pkgs/html5lib/SPKG.rst index cb3191bac15..1f20ca08cdb 100644 --- a/build/pkgs/html5lib/SPKG.txt +++ b/build/pkgs/html5lib/SPKG.rst @@ -1,17 +1,23 @@ -= html5lib = +html5lib +======== -== Description == +Description +----------- HTML parser based on the WHATWG HTML specification. -== License == +License +------- MIT License -== Upstream Contact == + +Upstream Contact +---------------- Home Page: https://github.com/html5lib/html5lib-python/issues -== Dependencies == +Dependencies +------------ Python, webencodings, six diff --git a/build/pkgs/iconv/SPKG.rst b/build/pkgs/iconv/SPKG.rst new file mode 100644 index 00000000000..85e009c0c85 --- /dev/null +++ b/build/pkgs/iconv/SPKG.rst @@ -0,0 +1,33 @@ +iconv +===== + +Description +----------- + +GNU libiconv is a library that is used to enable different languages, +with different characters to be handled properly. + +License +------- + +- GPL 3 and LGPL 3. So we can safely link against the library in Sage. + + +Upstream Contact +---------------- + +- http://www.gnu.org/software/libiconv/ +- Bug reports to bug-gnu-libiconv@gnu.org + +Dependencies +------------ + +- None for the purposes of Sage, but in general gettext. + + +Special Update/Build Instructions +--------------------------------- + +- None, other than anyone updating this package should be familiar with + how + to write shell scripts. diff --git a/build/pkgs/iconv/SPKG.txt b/build/pkgs/iconv/SPKG.txt deleted file mode 100644 index 3b15e243885..00000000000 --- a/build/pkgs/iconv/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= iconv = - -== Description == -GNU libiconv is a library that is used to enable different -languages, with different characters to be handled properly. - -== License == - * GPL 3 and LGPL 3. So we can safely link against the library in Sage. - -== Upstream Contact == - * http://www.gnu.org/software/libiconv/ - * Bug reports to bug-gnu-libiconv@gnu.org - -== Dependencies == - * None for the purposes of Sage, but in general gettext. - -== Special Update/Build Instructions == - * None, other than anyone updating this package should be familiar with how - to write shell scripts. - diff --git a/build/pkgs/igraph/SPKG.rst b/build/pkgs/igraph/SPKG.rst new file mode 100644 index 00000000000..1ba18e70031 --- /dev/null +++ b/build/pkgs/igraph/SPKG.rst @@ -0,0 +1,32 @@ +igraph +====== + +Description +----------- + +igraph is a library for creating and manipulating graphs. It is intended +to be as powerful (ie. fast) as possible to enable the analysis of large +graphs. + +License +------- + +GPL version 2 + + +Upstream Contact +---------------- + +http://igraph.org/c/ + +Dependencies +------------ + +- GMP/MPIR +- libxml2, but this is not shipped with Sage, so the user has to + install + libxml2-dev from her distro. + + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/igraph/SPKG.txt b/build/pkgs/igraph/SPKG.txt deleted file mode 100644 index e70329d56a4..00000000000 --- a/build/pkgs/igraph/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= igraph = - -== Description == - -igraph is a library for creating and manipulating graphs. -It is intended to be as powerful (ie. fast) as possible to enable the -analysis of large graphs. - -== License == - -GPL version 2 - -== Upstream Contact == - -http://igraph.org/c/ - -== Dependencies == - -* GMP/MPIR -* libxml2, but this is not shipped with Sage, so the user has to install - libxml2-dev from her distro. - -== Special Update/Build Instructions == diff --git a/build/pkgs/imagesize/SPKG.txt b/build/pkgs/imagesize/SPKG.rst similarity index 55% rename from build/pkgs/imagesize/SPKG.txt rename to build/pkgs/imagesize/SPKG.rst index 2ec0272eda7..8bd0d46070b 100644 --- a/build/pkgs/imagesize/SPKG.txt +++ b/build/pkgs/imagesize/SPKG.rst @@ -1,5 +1,7 @@ -= imagesize = +imagesize +========= -== Description == +Description +----------- It parses image files' header and return image size. diff --git a/build/pkgs/iml/SPKG.txt b/build/pkgs/iml/SPKG.rst similarity index 53% rename from build/pkgs/iml/SPKG.txt rename to build/pkgs/iml/SPKG.rst index 88c3e68ab00..1981fced5d8 100644 --- a/build/pkgs/iml/SPKG.txt +++ b/build/pkgs/iml/SPKG.rst @@ -1,36 +1,46 @@ -= IML = +IML +=== -== Description == +Description +----------- IML is a free library of C source code which implements algorithms for computing exact solutions to dense systems of linear equations over the -integers. IML is designed to be used with the ATLAS/BLAS library and -GMP bignum library. +integers. IML is designed to be used with the ATLAS/BLAS library and GMP +bignum library. Written in portable C, IML can be used on both 32-bit and 64-bit machines. It can be called from C++. Website: http://www.cs.uwaterloo.ca/~astorjoh/iml.html -== License == +License +------- - * GPLv2+ +- GPLv2+ -== Upstream Contact == - * Zhuliang Chen z4chen@uwaterloo.ca - * Arne Storjohann astorjoh@uwaterloo.ca +Upstream Contact +---------------- -== Dependencies == - * GMP - * ATLAS +- Zhuliang Chen z4chen@uwaterloo.ca +- Arne Storjohann astorjoh@uwaterloo.ca -== Special Update/Build Instructions == +Dependencies +------------ - * As of version 1.0.4, you need to repackage the upstream tarball +- GMP +- ATLAS + + +Special Update/Build Instructions +--------------------------------- + +- As of version 1.0.4, you need to repackage the upstream tarball using the spkg-src script because there was a bugfix version of 1.0.4 reposted upstream without version number bump. -=== Patches === +Patches +~~~~~~~ - * examples.patch: Modified some of the examples. +- examples.patch: Modified some of the examples. diff --git a/build/pkgs/ipaddress/SPKG.txt b/build/pkgs/ipaddress/SPKG.rst similarity index 54% rename from build/pkgs/ipaddress/SPKG.txt rename to build/pkgs/ipaddress/SPKG.rst index e9c9755006b..ee9b69be864 100644 --- a/build/pkgs/ipaddress/SPKG.txt +++ b/build/pkgs/ipaddress/SPKG.rst @@ -1,5 +1,7 @@ -= ipaddress = +ipaddress +========= -== Description == +Description +----------- Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2. diff --git a/build/pkgs/ipykernel/SPKG.txt b/build/pkgs/ipykernel/SPKG.rst similarity index 65% rename from build/pkgs/ipykernel/SPKG.txt rename to build/pkgs/ipykernel/SPKG.rst index de67f28d0b2..15fd660b6aa 100644 --- a/build/pkgs/ipykernel/SPKG.txt +++ b/build/pkgs/ipykernel/SPKG.rst @@ -1,6 +1,8 @@ -= ipykernel = +ipykernel +========= -== Description == +Description +----------- IPython Kernel for Jupyter diff --git a/build/pkgs/ipython/SPKG.txt b/build/pkgs/ipython/SPKG.rst similarity index 62% rename from build/pkgs/ipython/SPKG.txt rename to build/pkgs/ipython/SPKG.rst index c342a637a18..ad92a49fcab 100644 --- a/build/pkgs/ipython/SPKG.txt +++ b/build/pkgs/ipython/SPKG.rst @@ -1,25 +1,34 @@ -= IPython = +IPython +======= + +Description +----------- -== Description == From the IPython website: -IPython is a multiplatform, Free Software project (BSD licensed) that offers: +IPython is a multiplatform, Free Software project (BSD licensed) that +offers: - * An enhanced Python shell designed for efficient interactive +- An enhanced Python shell designed for efficient interactive work. It includes many enhancements over the default Python shell, including the ability for controlling interactively all major GUI toolkits in a non-blocking manner. - * A library to build customized interactive environments using Python + +- A library to build customized interactive environments using Python as the basic language (but with the possibility of having extended or alternate syntaxes). - * A system for interactive distributed and parallel computing (this is + +- A system for interactive distributed and parallel computing (this is part of IPython's new development). -== License == +License +------- BSD -== Upstream Contact == + +Upstream Contact +---------------- http://ipython.scipy.org/ diff --git a/build/pkgs/ipython_genutils/SPKG.rst b/build/pkgs/ipython_genutils/SPKG.rst new file mode 100644 index 00000000000..ae072987fbc --- /dev/null +++ b/build/pkgs/ipython_genutils/SPKG.rst @@ -0,0 +1,7 @@ +ipython_genutils +================ + +Description +----------- + +Vestigial utilities from IPython diff --git a/build/pkgs/ipython_genutils/SPKG.txt b/build/pkgs/ipython_genutils/SPKG.txt deleted file mode 100644 index e6b7acbe301..00000000000 --- a/build/pkgs/ipython_genutils/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= ipython_genutils = - -== Description == - -Vestigial utilities from IPython diff --git a/build/pkgs/ipywidgets/SPKG.txt b/build/pkgs/ipywidgets/SPKG.rst similarity index 61% rename from build/pkgs/ipywidgets/SPKG.txt rename to build/pkgs/ipywidgets/SPKG.rst index 7fd95c0eddd..92343dbe112 100644 --- a/build/pkgs/ipywidgets/SPKG.txt +++ b/build/pkgs/ipywidgets/SPKG.rst @@ -1,5 +1,7 @@ -= ipywidgets = +ipywidgets +========== -== Description == +Description +----------- Interactive HTML widgets for Jupyter notebooks and the IPython kernel. diff --git a/build/pkgs/isl/SPKG.rst b/build/pkgs/isl/SPKG.rst new file mode 100644 index 00000000000..edf794be2ce --- /dev/null +++ b/build/pkgs/isl/SPKG.rst @@ -0,0 +1,42 @@ +isl +=== + +Description +----------- + +isl is a thread-safe C library for manipulating sets and relations of +integer points bounded by affine constraints. The descriptions of the +sets and relations may involve both parameters and existentially +quantified variables. All computations are performed in exact integer +arithmetic using GMP. + +License +------- + +isl is released under the MIT license, but depends on the LGPL GMP +library. + + +Upstream Contact +---------------- + +- http://groups.google.com/group/isl-development + +Citation +-------- + +:: + + @incollection{Verdoolaege2010isl, + author = {Verdoolaege, Sven}, + title = {isl: An Integer Set Library for the Polyhedral Model}, + booktitle = {Mathematical Software - ICMS 2010}, + series = {Lecture Notes in Computer Science}, + editor = {Fukuda, Komei and Hoeven, Joris and Joswig, Michael and + Takayama, Nobuki}, + publisher = {Springer}, + isbn = {978-3-642-15581-9}, + pages = {299-302}, + volume = {6327}, + year = {2010} + } diff --git a/build/pkgs/isl/SPKG.txt b/build/pkgs/isl/SPKG.txt deleted file mode 100644 index d0ea17aa5e3..00000000000 --- a/build/pkgs/isl/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= isl = - -== Description == - -isl is a thread-safe C library for manipulating sets and relations -of integer points bounded by affine constraints. The descriptions of -the sets and relations may involve both parameters and existentially -quantified variables. All computations are performed in exact integer -arithmetic using GMP. - -== License == - -isl is released under the MIT license, but depends on the LGPL GMP library. - -== Upstream Contact == - - * http://groups.google.com/group/isl-development - -== Citation == - -@incollection{Verdoolaege2010isl, - author = {Verdoolaege, Sven}, - title = {isl: An Integer Set Library for the Polyhedral Model}, - booktitle = {Mathematical Software - ICMS 2010}, - series = {Lecture Notes in Computer Science}, - editor = {Fukuda, Komei and Hoeven, Joris and Joswig, Michael and - Takayama, Nobuki}, - publisher = {Springer}, - isbn = {978-3-642-15581-9}, - pages = {299-302}, - volume = {6327}, - year = {2010} -} diff --git a/build/pkgs/itsdangerous/SPKG.rst b/build/pkgs/itsdangerous/SPKG.rst new file mode 100644 index 00000000000..51e0b6f16c9 --- /dev/null +++ b/build/pkgs/itsdangerous/SPKG.rst @@ -0,0 +1,8 @@ +itsdangerous +============ + +Description +----------- + +Various helpers to pass data to untrusted environments and to get it +back safe and sound. diff --git a/build/pkgs/itsdangerous/SPKG.txt b/build/pkgs/itsdangerous/SPKG.txt deleted file mode 100644 index 32264811471..00000000000 --- a/build/pkgs/itsdangerous/SPKG.txt +++ /dev/null @@ -1,6 +0,0 @@ -= itsdangerous = - -== Description == - -Various helpers to pass data to untrusted environments and to get it back -safe and sound. diff --git a/build/pkgs/jinja2/SPKG.rst b/build/pkgs/jinja2/SPKG.rst new file mode 100644 index 00000000000..9c2eb9e4355 --- /dev/null +++ b/build/pkgs/jinja2/SPKG.rst @@ -0,0 +1,39 @@ +Jinja2 +====== + +Description +----------- + +Jinja2 is a library for Python 2.4 and onwards that is designed to be +flexible, fast and secure. + +If you have any exposure to other text-based template languages, such as +Smarty or Django, you should feel right at home with Jinja2. It's both +designer and developer friendly by sticking to Python's principles and +adding functionality useful for templating environments. + +License +------- + +Modified BSD License + + +Upstream Contact +---------------- + +Author: Pocoo Team Homepage: http://jinja.pocoo.org/ + +Dependencies +------------ + +- Python (>= 2.4) +- setuptools (or distribute) +- Pygments (according to 'spkg/standard/deps') +- docutils (dito, as a note only) + + +Special Update/Build Instructions +--------------------------------- + +None. (Just make sure its prerequisites are new enough in Sage, to avoid +downloads during the build / installation.) diff --git a/build/pkgs/jinja2/SPKG.txt b/build/pkgs/jinja2/SPKG.txt deleted file mode 100644 index 3ff6cd895b5..00000000000 --- a/build/pkgs/jinja2/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= Jinja2 = - -== Description == - -Jinja2 is a library for Python 2.4 and onwards that is designed to be -flexible, fast and secure. - -If you have any exposure to other text-based template languages, such -as Smarty or Django, you should feel right at home with Jinja2. It's -both designer and developer friendly by sticking to Python's -principles and adding functionality useful for templating -environments. - -== License == - -Modified BSD License - -== Upstream Contact == - -Author: Pocoo Team -Homepage: http://jinja.pocoo.org/ - -== Dependencies == - - * Python (>= 2.4) - * setuptools (or distribute) - * Pygments (according to 'spkg/standard/deps') - * docutils (dito, as a note only) - -== Special Update/Build Instructions == - -None. (Just make sure its prerequisites are new enough in Sage, to avoid -downloads during the build / installation.) - diff --git a/build/pkgs/jmol/SPKG.rst b/build/pkgs/jmol/SPKG.rst new file mode 100644 index 00000000000..8c021b6fe8e --- /dev/null +++ b/build/pkgs/jmol/SPKG.rst @@ -0,0 +1,42 @@ + +Jmol for Sage +============= + +Description +----------- + +This provides files necessary for Jmol(java) and JSmol (javascript) to +operate from the command line and the Notebook. It does not contain the +Notebook javascript library jmol_lib.js or changes to Notebook or Sage +code. + +License +------- + +GPLv2+ + + +Upstream Contact +---------------- + +- Bob Hanson +- e-mail: hansonr@stolaf.edu +- Homepage: https://www.stolaf.edu/people/hansonr/ +- Development page: https://github.com/BobHanson/Jmol-SwingJS +- Download page: https://sourceforge.net/projects/jmol/files/Jmol/ + +Dependencies +------------ + +No build-time dependencies. + +The commandline jmol requires java at runtime. + + +Special Build Instructions +-------------------------- + +To avoid depending on ``unzip`` at build time, we have to repack the +tarball, see ``spkg-src``. We take the opportunity to remove some +unnecessary subdirectories, see +http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#In_detail diff --git a/build/pkgs/jmol/SPKG.txt b/build/pkgs/jmol/SPKG.txt deleted file mode 100644 index 4f7e555186c..00000000000 --- a/build/pkgs/jmol/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= Jmol for Sage = - -== Description == - -This provides files necessary for Jmol(java) and JSmol -(javascript) to operate from the command line and the -Notebook. It does not contain the Notebook javascript -library jmol_lib.js or changes to Notebook or Sage code. - -== License == - -GPLv2+ - -== Upstream Contact == - - * Bob Hanson - * e-mail: hansonr@stolaf.edu - * Homepage: https://www.stolaf.edu/people/hansonr/ - * Development page: https://github.com/BobHanson/Jmol-SwingJS - * Download page: https://sourceforge.net/projects/jmol/files/Jmol/ - -== Dependencies == - -No build-time dependencies. - -The commandline jmol requires java at runtime. - -== Special Build Instructions == - -To avoid depending on `unzip` at build time, we have to repack the tarball, see -`spkg-src`. We take the opportunity to remove some unnecessary subdirectories, -see http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#In_detail - diff --git a/build/pkgs/jsonschema/SPKG.txt b/build/pkgs/jsonschema/SPKG.rst similarity index 54% rename from build/pkgs/jsonschema/SPKG.txt rename to build/pkgs/jsonschema/SPKG.rst index 168b4052940..57e9a4c353f 100644 --- a/build/pkgs/jsonschema/SPKG.txt +++ b/build/pkgs/jsonschema/SPKG.rst @@ -1,19 +1,23 @@ -= jsonschema = +jsonschema +========== -== Description == +Description +----------- jsonschema is an implementation of JSON Schema for Python -== License == +License +------- MIT License -== Upstream Contact == + +Upstream Contact +---------------- Home page: http://github.com/Julian/jsonschema -== Dependencies == +Dependencies +------------ Python, Setuptools - - diff --git a/build/pkgs/jupymake/SPKG.rst b/build/pkgs/jupymake/SPKG.rst new file mode 100644 index 00000000000..538dc6e445a --- /dev/null +++ b/build/pkgs/jupymake/SPKG.rst @@ -0,0 +1,28 @@ +jupymake +======== + +Description +----------- + +The Python module JuPyMake provides an interface to polymake. + +License +------- + +- GPL v2 + + +Upstream Contact +---------------- + + https://github.com/polymake/JuPyMake + +Dependencies +------------ + +- pip +- polymake + + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/jupymake/SPKG.txt b/build/pkgs/jupymake/SPKG.txt deleted file mode 100644 index f5a98bf06fc..00000000000 --- a/build/pkgs/jupymake/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= jupymake = - -== Description == - -The Python module JuPyMake provides an interface to polymake. - -== License == - - * GPL v2 - -== Upstream Contact == - - https://github.com/polymake/JuPyMake - -== Dependencies == - - * pip - * polymake - -== Special Update/Build Instructions == diff --git a/build/pkgs/jupyter_client/SPKG.txt b/build/pkgs/jupyter_client/SPKG.rst similarity index 85% rename from build/pkgs/jupyter_client/SPKG.txt rename to build/pkgs/jupyter_client/SPKG.rst index 3fedb1e4efd..a9348a28d55 100644 --- a/build/pkgs/jupyter_client/SPKG.txt +++ b/build/pkgs/jupyter_client/SPKG.rst @@ -1,6 +1,8 @@ -= jupyter_client = +jupyter_client +============== -== Description == +Description +----------- Jupyter protocol implementation and client libraries diff --git a/build/pkgs/jupyter_core/SPKG.txt b/build/pkgs/jupyter_core/SPKG.rst similarity index 58% rename from build/pkgs/jupyter_core/SPKG.txt rename to build/pkgs/jupyter_core/SPKG.rst index dbed147e7af..934ee810110 100644 --- a/build/pkgs/jupyter_core/SPKG.txt +++ b/build/pkgs/jupyter_core/SPKG.rst @@ -1,5 +1,7 @@ -= jupyter_core = +jupyter_core +============ -== Description == +Description +----------- Jupyter core package. A base package on which Jupyter projects rely. diff --git a/build/pkgs/kenzo/SPKG.rst b/build/pkgs/kenzo/SPKG.rst new file mode 100644 index 00000000000..faa055b87ee --- /dev/null +++ b/build/pkgs/kenzo/SPKG.rst @@ -0,0 +1,25 @@ +Kenzo +===== + +Description +----------- + +Kenzo is a package to compute properties (mainly homology groups) of +topological spaces. It allows defining spaces created from others by +constuctions like loop spaces, classifying spaces and so on. + +License +------- + +GPL + + +Upstream Contact +---------------- + +- https://github.com/gheber/kenzo + +Dependencies +------------ + +- ECL (Embedded Common Lisp) diff --git a/build/pkgs/kenzo/SPKG.txt b/build/pkgs/kenzo/SPKG.txt deleted file mode 100644 index e0f96ea81c6..00000000000 --- a/build/pkgs/kenzo/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= Kenzo = - -== Description == - -Kenzo is a package to compute properties (mainly homology groups) -of topological spaces. It allows defining spaces created from others -by constuctions like loop spaces, classifying spaces and so on. - - -== License == - -GPL - -== Upstream Contact == - - * https://github.com/gheber/kenzo - -== Dependencies == - - * ECL (Embedded Common Lisp) - diff --git a/build/pkgs/kenzo/checksums.ini b/build/pkgs/kenzo/checksums.ini index abd092f806f..22ef2a25127 100644 --- a/build/pkgs/kenzo/checksums.ini +++ b/build/pkgs/kenzo/checksums.ini @@ -1,4 +1,5 @@ -tarball=kenzo-1.1.7-r3.tar.gz -sha1=92433fee5f83d575483bbbd9730c2cb094c292a4 -md5=7dc2207eb8071a2710df825ac9409324 -cksum=3315029495 +tarball=kenzo-1.1.9.tar.gz +upstream_url=https://github.com/miguelmarco/kenzo/releases/download/1.1.9/kenzo-1.1.9.tar.gz +sha1=f153b0c172b6c11851a5f248947b61b0bf5be527 +md5=98adc197c6f23716a6ddd115115ab4f6 +cksum=880933361 diff --git a/build/pkgs/kenzo/package-version.txt b/build/pkgs/kenzo/package-version.txt index 6ba101eb19d..512a1faa680 100644 --- a/build/pkgs/kenzo/package-version.txt +++ b/build/pkgs/kenzo/package-version.txt @@ -1 +1 @@ -1.1.7-r3 +1.1.9 diff --git a/build/pkgs/kenzo/spkg-install.in b/build/pkgs/kenzo/spkg-install.in index cd64e0213c4..3c8e5946547 100644 --- a/build/pkgs/kenzo/spkg-install.in +++ b/build/pkgs/kenzo/spkg-install.in @@ -1,15 +1,17 @@ cd src - - # create a short lisp file with the instructions to load kenzo from ecl # This will compile the lisp files since it is the first time they are loaded ecl < compile.lisp -echo "moving kenzo--all-systems.fasb to $SAGE_LOCAL/lib/ecl/kenzo.fas" -mv kenzo--all-systems.fasb $SAGE_LOCAL/lib/ecl/kenzo.fas - +# Install Kenzo into ECL's library directory (installation procedure +# copied from Maxima's spkg-install.in file): +ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"` +echo +echo "Now installing Kenzo as '$ECLLIB/kenzo.fas'..." +cp -f kenzo--all-systems.fasb "$ECLLIB/kenzo.fas" \ + || sdh_die "Failed to install 'kenzo--all-systems.fasb' as '$ECLLIB/kenzo.fas'." if [ $? -ne 0 ]; then echo >&2 "Error installing Kenzo." diff --git a/build/pkgs/kiwisolver/SPKG.rst b/build/pkgs/kiwisolver/SPKG.rst new file mode 100644 index 00000000000..8b8e86dd28b --- /dev/null +++ b/build/pkgs/kiwisolver/SPKG.rst @@ -0,0 +1,37 @@ +kiwisolver +========== + +Description +----------- + +From https://pypi.org/project/kiwisolver/ + +A fast implementation of the Cassowary constraint solver + +Kiwi is an efficient C++ implementation of the Cassowary constraint +solving algorithm. Kiwi is an implementation of the algorithm based on +the seminal Cassowary paper. It is not a refactoring of the original C++ +solver. Kiwi has been designed from the ground up to be lightweight and +fast. Kiwi ranges from 10x to 500x faster than the original Cassowary +solver with typical use cases gaining a 40x improvement. Memory savings +are consistently > 5x. + +In addition to the C++ solver, Kiwi ships with hand-rolled Python +bindings. + +License +------- + +Modified BSD License + + +Upstream Contact +---------------- + +https://github.com/nucleic/kiwi + +Dependencies +------------ + +- python +- setuptools diff --git a/build/pkgs/kiwisolver/SPKG.txt b/build/pkgs/kiwisolver/SPKG.txt deleted file mode 100644 index 537b9aae123..00000000000 --- a/build/pkgs/kiwisolver/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= kiwisolver = - -== Description == - -From https://pypi.org/project/kiwisolver/ - -A fast implementation of the Cassowary constraint solver - -Kiwi is an efficient C++ implementation of the Cassowary constraint -solving algorithm. Kiwi is an implementation of the algorithm based -on the seminal Cassowary paper. It is not a refactoring of the -original C++ solver. Kiwi has been designed from the ground up to be -lightweight and fast. Kiwi ranges from 10x to 500x faster than the -original Cassowary solver with typical use cases gaining a 40x -improvement. Memory savings are consistently > 5x. - -In addition to the C++ solver, Kiwi ships with hand-rolled Python -bindings. - -== License == - -Modified BSD License - -== Upstream Contact == - -https://github.com/nucleic/kiwi - -== Dependencies == - - * python - * setuptools diff --git a/build/pkgs/latte_int/SPKG.rst b/build/pkgs/latte_int/SPKG.rst new file mode 100644 index 00000000000..6691a363287 --- /dev/null +++ b/build/pkgs/latte_int/SPKG.rst @@ -0,0 +1,24 @@ +LattE_Integrale +=============== + +Description +----------- + +LattE (Lattice point Enumeration) Integrale solves the problems of +counting lattice points in and integration over convex polytopes. + +License +------- + +GPLv2 + + +Upstream Contact +---------------- + +Matthias Köppe, UC Davis, CA, USA + +Dependencies +------------ + +GMP (MPIR), 4ti2, NTL, cddlib. diff --git a/build/pkgs/latte_int/SPKG.txt b/build/pkgs/latte_int/SPKG.txt deleted file mode 100644 index 24a6da7e78b..00000000000 --- a/build/pkgs/latte_int/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= LattE_Integrale = - -== Description == - -LattE (Lattice point Enumeration) Integrale solves the problems of counting -lattice points in and integration over convex polytopes. - -== License == - -GPLv2 - -== Upstream Contact == - -Matthias Köppe, UC Davis, CA, USA - -== Dependencies == - -GMP (MPIR), 4ti2, NTL, cddlib. - diff --git a/build/pkgs/lcalc/SPKG.rst b/build/pkgs/lcalc/SPKG.rst new file mode 100644 index 00000000000..3dd99db88fe --- /dev/null +++ b/build/pkgs/lcalc/SPKG.rst @@ -0,0 +1,122 @@ +lcalc +===== + +Description +----------- + +Michael Rubinstein's L-function calculator. + +License +------- + +- LGPL V2+ + + +Upstream contact +---------------- + +Michael Rubinstein + +Sources: http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html + +Newer beta version 1.3 (not yet in Sage): +http://code.google.com/p/l-calc/ + +Dependencies +------------ + +- GMP/MPIR +- MPFR +- PARI +- GNU patch + + +Special Update/Build Instructions +--------------------------------- + +- There is some garbage in the upstream sources which should be + removed:: + + src/include/.Lexplicit_formula.h.swp + src/include/.Lvalue.h.swp + src/include/._.DS_Store + src/include/.DS_Store + src/include/Lexplicit_formula.h.swap.crap + src/include/Lvalue.h.bak + src/src/Makefile.old + src/src/.Makefile.old.swp + src/src/._.DS_Store + src/src/.DS_Store + src/src/.Lcommandline.ggo.swp + src/src/libLfunction.a + +- We (and apparently also upstream) currently don't build Lcalc's tests + (see Makefile), hence there's no spkg-check. + This might change in newer upstream versions. + +- The original Makefile uses $(CC) to compile C++ (also using + $(CCFLAGS)), + which it defines to 'g++', and hardcodes 'g++' when linking the + shared + library. (It should use $(CXX) instead, which might \*default\* to + 'g++'.) + We now (lcalc-1.23.p10) patch the Makefile also to use $(CXX) for + compiling + and linking C++; $(CXX) now \*defaults\* to 'g++', and $(CC) to + 'gcc', but + both can be overridden by simply setting their respective environment + variables. (Same for $(INSTALL_DIR) btw.) + +Patches +------- + +- Makefile.patch: + + We change a lot there, since Lcalc doesn't have a 'configure' script, + and hence the Makefile is supposed to be edited to customize Lcalc + (build + options, locations of headers and libraries etc.). + Besides that, we + + - put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, + - remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just + LDFLAGS, + - use $(MAKE) instead of 'make' in the crude build receipts, + - use CXXFLAG64 when linking the shared library, + - now use $(CXX) for compiling and linking C++, which \*defaults\* to + 'g++', + but can be overridden by setting the environment variable of the same + name. ($(CC) now \*defaults\* to 'gcc', although currently not really + used as far as I can see.) + - $(INSTALL_DIR) can now be overridden by simply setting the + environment + variable of the same name. + +- Lcommon.h.patch: + + Uncomment the definition of lcalc_to_double(const long double& x). + (Necessary for GCC >= 4.6.0, cf. #10892.) + Comment from there: + The reason is the following code horror from + src/src/include/Lcommon.h: + [...] + But somebody who is familiar with the codebase should really rewrite + lcalc + to not redefine the double() cast, thats just fragile and will sooner + or + later again fail inside some system headers. + +- pari-2.7.patch: + + Various changes to port to newer versions of PARI. + +- time.h.patch: + + (Patches src/include/Lcommandline_numbertheory.h) + Include also in Lcommandline_numbertheory.h (at least + required + on Cygwin, cf. #9845). + This should get reported upstream. + +- lcalc-1.23_default_parameters_1.patch: Make Lcalc (1.23) build with + GCC 4.9 diff --git a/build/pkgs/lcalc/SPKG.txt b/build/pkgs/lcalc/SPKG.txt deleted file mode 100644 index 2958ec6d12c..00000000000 --- a/build/pkgs/lcalc/SPKG.txt +++ /dev/null @@ -1,91 +0,0 @@ -= lcalc = - -== Description == - -Michael Rubinstein's L-function calculator. - -== License == - - * LGPL V2+ - -== Upstream contact == - -Michael Rubinstein - -Sources: http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html - -Newer beta version 1.3 (not yet in Sage): -http://code.google.com/p/l-calc/ - -== Dependencies == - - * GMP/MPIR - * MPFR - * PARI - * GNU patch - -== Special Update/Build Instructions == - - * There is some garbage in the upstream sources which should be removed: - src/include/.Lexplicit_formula.h.swp - src/include/.Lvalue.h.swp - src/include/._.DS_Store - src/include/.DS_Store - src/include/Lexplicit_formula.h.swap.crap - src/include/Lvalue.h.bak - src/src/Makefile.old - src/src/.Makefile.old.swp - src/src/._.DS_Store - src/src/.DS_Store - src/src/.Lcommandline.ggo.swp - src/src/libLfunction.a - * We (and apparently also upstream) currently don't build Lcalc's tests - (see Makefile), hence there's no spkg-check. - This might change in newer upstream versions. - * The original Makefile uses $(CC) to compile C++ (also using $(CCFLAGS)), - which it defines to 'g++', and hardcodes 'g++' when linking the shared - library. (It should use $(CXX) instead, which might *default* to 'g++'.) - We now (lcalc-1.23.p10) patch the Makefile also to use $(CXX) for compiling - and linking C++; $(CXX) now *defaults* to 'g++', and $(CC) to 'gcc', but - both can be overridden by simply setting their respective environment - variables. (Same for $(INSTALL_DIR) btw.) - -== Patches == - - * Makefile.patch: - We change a lot there, since Lcalc doesn't have a 'configure' script, - and hence the Makefile is supposed to be edited to customize Lcalc (build - options, locations of headers and libraries etc.). - Besides that, we - - put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, - - remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just LDFLAGS, - - use $(MAKE) instead of 'make' in the crude build receipts, - - use CXXFLAG64 when linking the shared library, - - now use $(CXX) for compiling and linking C++, which *defaults* to 'g++', - but can be overridden by setting the environment variable of the same - name. ($(CC) now *defaults* to 'gcc', although currently not really - used as far as I can see.) - - $(INSTALL_DIR) can now be overridden by simply setting the environment - variable of the same name. - - * Lcommon.h.patch: - Uncomment the definition of lcalc_to_double(const long double& x). - (Necessary for GCC >= 4.6.0, cf. #10892.) - Comment from there: - The reason is the following code horror from src/src/include/Lcommon.h: - [...] - But somebody who is familiar with the codebase should really rewrite lcalc - to not redefine the double() cast, thats just fragile and will sooner or - later again fail inside some system headers. - - * pari-2.7.patch: - Various changes to port to newer versions of PARI. - - * time.h.patch: - (Patches src/include/Lcommandline_numbertheory.h) - Include also in Lcommandline_numbertheory.h (at least required - on Cygwin, cf. #9845). - This should get reported upstream. - - * lcalc-1.23_default_parameters_1.patch: Make Lcalc (1.23) build with - GCC 4.9 diff --git a/build/pkgs/libatomic_ops/SPKG.rst b/build/pkgs/libatomic_ops/SPKG.rst new file mode 100644 index 00000000000..131e2629409 --- /dev/null +++ b/build/pkgs/libatomic_ops/SPKG.rst @@ -0,0 +1,30 @@ +libatomic_ops +============= + +Description +----------- + +A part of the Boehm-Demers-Weiser conservative garbage collector. + +License +------- + +- Permissive BSD + GPL 2.0+ + + +Upstream Contact +---------------- + +- Webpage: http://www.hboehm.info/gc/ +- Email List: bdwgc@lists.opendylan.org + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/libatomic_ops/SPKG.txt b/build/pkgs/libatomic_ops/SPKG.txt deleted file mode 100644 index 9f1cd0ffd91..00000000000 --- a/build/pkgs/libatomic_ops/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= libatomic_ops = - -== Description == - -A part of the Boehm-Demers-Weiser conservative garbage collector. - -== License == - -* Permissive BSD + GPL 2.0+ - -== Upstream Contact == - -Webpage: http://www.hboehm.info/gc/ -Email List: bdwgc@lists.opendylan.org - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/libbraiding/SPKG.rst b/build/pkgs/libbraiding/SPKG.rst new file mode 100644 index 00000000000..f4075593ab9 --- /dev/null +++ b/build/pkgs/libbraiding/SPKG.rst @@ -0,0 +1,25 @@ +LIBBRAIDING +=========== + +Description +----------- + +libbraiding is a library to compute several properties of braids, +including centralizer and conjugacy check. + +License +------- + +GPLv3+ + + +SPKG Maintainers +---------------- + +- Miguel Marco + + +Upstream Contact +---------------- + +Miguel Marco (mmarco@unizar.es) diff --git a/build/pkgs/libbraiding/SPKG.txt b/build/pkgs/libbraiding/SPKG.txt deleted file mode 100644 index 4afec494530..00000000000 --- a/build/pkgs/libbraiding/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= LIBBRAIDING = - -== Description == - -libbraiding is a library to compute several properties of braids, including centralizer and conjugacy check. - -== License == - -GPLv3+ - -== SPKG Maintainers == - -* Miguel Marco - -== Upstream Contact == - -Miguel Marco (mmarco@unizar.es) diff --git a/build/pkgs/libffi/SPKG.txt b/build/pkgs/libffi/SPKG.rst similarity index 81% rename from build/pkgs/libffi/SPKG.txt rename to build/pkgs/libffi/SPKG.rst index aea62b6fbc7..33e4e17f4b5 100644 --- a/build/pkgs/libffi/SPKG.txt +++ b/build/pkgs/libffi/SPKG.rst @@ -1,6 +1,8 @@ -= libffi = +libffi +====== -== Description == +Description +----------- Compilers for high level languages generate code that follow certain conventions. These conventions are necessary, in part, for separate @@ -28,20 +30,21 @@ featured foreign function interface. A layer must exist above libffi that handles type conversions for values passed between the two languages. -== License == +License +------- -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -``Software''), to deal in the Software without restriction, including +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -49,7 +52,9 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -== Upstream Contact == -https://sourceware.org/libffi/ -https://github.com/libffi/libffi +Upstream Contact +---------------- + +- https://sourceware.org/libffi/ +- https://github.com/libffi/libffi diff --git a/build/pkgs/libgd/SPKG.rst b/build/pkgs/libgd/SPKG.rst new file mode 100644 index 00000000000..804855e3a1e --- /dev/null +++ b/build/pkgs/libgd/SPKG.rst @@ -0,0 +1,38 @@ +gd +== + +Description +----------- + +GD is an open source code library for the dynamic creation of images by +programmers. GD is written in C, and "wrappers" are available for Perl, +PHP and other languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP +images, among other formats. GD is commonly used to generate charts, +graphics, thumbnails, and most anything else, on the fly. While not +restricted to use on the web, the most common applications of GD involve +website development. + +License +------- + +- Custom (BSD-ish) + + +Upstream Contact +---------------- + +- Pierre Joye (http://blog.thepimp.net) +- http://libgd.bitbucket.org/ + +Dependencies +------------ + +- libpng +- freetype +- iconv + + +Special Update/Build Instructions +--------------------------------- + +See spkg-src script. diff --git a/build/pkgs/libgd/SPKG.txt b/build/pkgs/libgd/SPKG.txt deleted file mode 100644 index ba400fdb876..00000000000 --- a/build/pkgs/libgd/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= gd = - -== Description == - -GD is an open source code library for the dynamic creation of images -by programmers. GD is written in C, and "wrappers" are available for -Perl, PHP and other languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP -images, among other formats. GD is commonly used to generate charts, -graphics, thumbnails, and most anything else, on the fly. -While not restricted to use on the web, the most common applications of -GD involve website development. - -== License == - -* Custom (BSD-ish) - -== Upstream Contact == - -* Pierre Joye (http://blog.thepimp.net) -* http://libgd.bitbucket.org/ - -== Dependencies == - -* libpng -* freetype -* iconv - -== Special Update/Build Instructions == - -See spkg-src script. diff --git a/build/pkgs/libhomfly/SPKG.rst b/build/pkgs/libhomfly/SPKG.rst new file mode 100644 index 00000000000..b7da49a70c8 --- /dev/null +++ b/build/pkgs/libhomfly/SPKG.rst @@ -0,0 +1,30 @@ +LIBHOMFLY +========= + +Description +----------- + +libhomfly is a library to compute the homfly polynomial of knots and +links. + +License +------- + +Public domain + + +SPKG Maintainers +---------------- + +- Miguel Marco + + +Upstream Contact +---------------- + +Miguel Marco (mmarco@unizar.es) + +Dependencies +------------ + +- gc diff --git a/build/pkgs/libhomfly/SPKG.txt b/build/pkgs/libhomfly/SPKG.txt deleted file mode 100644 index 895be6c645e..00000000000 --- a/build/pkgs/libhomfly/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= LIBHOMFLY = - -== Description == - -libhomfly is a library to compute the homfly polynomial of knots and links. - -== License == - -Public domain - -== SPKG Maintainers == - -* Miguel Marco - -== Upstream Contact == - -Miguel Marco (mmarco@unizar.es) - -== Dependencies == - -* gc diff --git a/build/pkgs/libogg/SPKG.rst b/build/pkgs/libogg/SPKG.rst new file mode 100644 index 00000000000..8c0da263050 --- /dev/null +++ b/build/pkgs/libogg/SPKG.rst @@ -0,0 +1,63 @@ +libogg +====== + +Description +----------- + +libogg is the official reference library for the Ogg multimedia +container format, and the native file and stream format for the Xiph.org +multimedia codecs. As with all Xiph.org technology is it an open format +free for anyone to use. + +Website: http://www.xiph.org/ogg + +License +------- + +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Upstream Contact +---------------- + +The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo + +Dependencies +------------ + +This spkg provides dependencies for + +- the Sage library + + +Special Update/Build Instructions +--------------------------------- + +- No changes went into src. diff --git a/build/pkgs/libogg/SPKG.txt b/build/pkgs/libogg/SPKG.txt deleted file mode 100644 index d6c01f19e11..00000000000 --- a/build/pkgs/libogg/SPKG.txt +++ /dev/null @@ -1,55 +0,0 @@ -= libogg = - -== Description == - -libogg is the official reference library for the Ogg multimedia container format, and the native file and -stream format for the Xiph.org multimedia codecs. As with all Xiph.org technology is it an open format free -for anyone to use. - -Website: http://www.xiph.org/ogg - -== License == - -Copyright (c) 2002, Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -== Upstream Contact == - -The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo - -== Dependencies == - -This spkg provides dependencies for - - * the Sage library - -== Special Update/Build Instructions == - - * No changes went into src. - diff --git a/build/pkgs/libpng/SPKG.txt b/build/pkgs/libpng/SPKG.rst similarity index 50% rename from build/pkgs/libpng/SPKG.txt rename to build/pkgs/libpng/SPKG.rst index 177fd285291..583872b5a50 100644 --- a/build/pkgs/libpng/SPKG.txt +++ b/build/pkgs/libpng/SPKG.rst @@ -1,36 +1,47 @@ -= libpng = +libpng +====== -== Description == +Description +----------- libpng is the official PNG reference library. It supports almost all PNG -features, is extensible, and has been extensively tested for over 13 years. -The home site for development versions (i.e., may be buggy or subject to -change or include experimental features) is http://libpng.sourceforge.net/, -and the place to go for questions about the library is the png-mng-implement -mailing list. +features, is extensible, and has been extensively tested for over 13 +years. The home site for development versions (i.e., may be buggy or +subject to change or include experimental features) is +http://libpng.sourceforge.net/, and the place to go for questions about +the library is the png-mng-implement mailing list. Website: http://www.libpng.org/pub/png/libpng.html -== License == +License +------- -The libpng license - see http://www.libpng.org/pub/png/src/libpng-LICENSE.txt +The libpng license - see +http://www.libpng.org/pub/png/src/libpng-LICENSE.txt -== Upstream Contact == -The png mailing lists - see http://www.libpng.org/pub/png/pngmisc.html#lists +Upstream Contact +---------------- -== Dependencies == +The png mailing lists - see +http://www.libpng.org/pub/png/pngmisc.html#lists + +Dependencies +------------ This spkg depends on: - * libz +- libz + -== Special Update/Build Instructions == +Special Update/Build Instructions +--------------------------------- - * On old versions of Darwin, the symbolic links libpng.* created by libpng16 may +- On old versions of Darwin, the symbolic links libpng.\* created by + libpng16 may interfere with a system-wide libPng.dylib. - --- the following is very likely to be obsolete in 2014 --- + -- the following is very likely to be obsolete in 2014 --- This system-wide library is likely to be a different version and on top of that, the symbols exported there are prefixed with "_cg" @@ -44,13 +55,14 @@ This spkg depends on: Note there would be no problem if the system-wide library was not looked for when Sage is being built or run, but that's not the case either; it is at least looked for by the "ImageIO" framework: - - when Python is built with Mac OS extensions, fixed in #4008; - - when Mercurial is built because it uses $EDITOR, cf. #4678; - - when R is built and it finds -lpng, cf. #4409 and #11696. - --- this is no longer done, as of #27186 --- + - when Python is built with Mac OS extensions, fixed in #4008; + - when Mercurial is built because it uses $EDITOR, cf. #4678; + - when R is built and it finds ``-lpng``, cf. #4409 and #11696. + + -- this is no longer done, as of #27186 --- As not all of these problems are easily dealt with and new ones may - arise, we chose to delete the $SAGE_LOCAL/lib/libpng.* symlinks. + arise, we chose to delete the $SAGE_LOCAL/lib/libpng.\* symlinks. Therefore, some packages like Tachyon, which by default look for - -lpng are patched to look for -lpng16 instead. + ``-lpng`` are patched to look for ``-lpng16`` instead. diff --git a/build/pkgs/libsemigroups/SPKG.rst b/build/pkgs/libsemigroups/SPKG.rst new file mode 100644 index 00000000000..cf3b81d8de7 --- /dev/null +++ b/build/pkgs/libsemigroups/SPKG.rst @@ -0,0 +1,20 @@ +libffi +====== + +Description +----------- + +C++ library for semigroups and monoids; used in GAP's package +Semigroups. + +License +------- + +GPL-3.0 + + +Upstream Contact +---------------- + +http://james-d-mitchell.github.io/libsemigroups +https://github.com/james-d-mitchell/libsemigroups diff --git a/build/pkgs/libsemigroups/SPKG.txt b/build/pkgs/libsemigroups/SPKG.txt deleted file mode 100644 index 3d4c9478a9b..00000000000 --- a/build/pkgs/libsemigroups/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= libffi = - -== Description == - -C++ library for semigroups and monoids; -used in GAP's package Semigroups. - -== License == - -GPL-3.0 - -== Upstream Contact == - -http://james-d-mitchell.github.io/libsemigroups -https://github.com/james-d-mitchell/libsemigroups diff --git a/build/pkgs/libtheora/SPKG.rst b/build/pkgs/libtheora/SPKG.rst new file mode 100644 index 00000000000..b964288c8e2 --- /dev/null +++ b/build/pkgs/libtheora/SPKG.rst @@ -0,0 +1,67 @@ +libtheora +========= + +Description +----------- + +libtheora is the official reference library for the Theora video codec. +Theora is a free and open video compression format from the Xiph.org +Foundation. + +Website: http://www.xiph.org/theora + +License +------- + +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Upstream Contact +---------------- + +The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo + +Dependencies +------------ + +This spkg depends on + +- libogg +- libpng + +This spkg provides dependencies for + +- the Sage library + + +Special Update/Build Instructions +--------------------------------- + +- No changes went into src. diff --git a/build/pkgs/libtheora/SPKG.txt b/build/pkgs/libtheora/SPKG.txt deleted file mode 100644 index 259f162066d..00000000000 --- a/build/pkgs/libtheora/SPKG.txt +++ /dev/null @@ -1,59 +0,0 @@ -= libtheora = - -== Description == - -libtheora is the official reference library for the Theora video codec. -Theora is a free and open video compression format from the Xiph.org Foundation. - -Website: http://www.xiph.org/theora - -== License == - -Copyright (c) 2002, Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -== Upstream Contact == - -The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo - -== Dependencies == - -This spkg depends on - - * libogg - * libpng - -This spkg provides dependencies for - - * the Sage library - -== Special Update/Build Instructions == - - * No changes went into src. - diff --git a/build/pkgs/lidia/SPKG.txt b/build/pkgs/lidia/SPKG.rst similarity index 60% rename from build/pkgs/lidia/SPKG.txt rename to build/pkgs/lidia/SPKG.rst index 412345cd8a7..a2edd189623 100644 --- a/build/pkgs/lidia/SPKG.txt +++ b/build/pkgs/lidia/SPKG.rst @@ -1,25 +1,32 @@ -= lidia = +lidia +===== -== Description == +Description +----------- A library for computational number theory. Abandoned upstream and has disappeared from the web at TU Darmstadt. -We use as our new upstream a version minimally maintained for the -LattE project. +We use as our new upstream a version minimally maintained for the LattE +project. https://www.math.ucdavis.edu/~latte/software/packages/lidia/current/lidia-2.3.0+latte-patches-2014-10-04.tar.gz -== License == -lidia is released under the GPL, or so it is claimed. -See https://groups.google.com/forum/#!msg/sage-devel/kTxgPSqrbUM/5Txj3_IKhlQJ +License +------- + +lidia is released under the GPL, or so it is claimed. See +https://groups.google.com/forum/#!msg/sage-devel/kTxgPSqrbUM/5Txj3_IKhlQJ and https://lists.debian.org/debian-legal/2007/07/msg00120.html -== Upstream Contact == + +Upstream Contact +---------------- Matthias Köppe, UC Davis, CA, USA -== Dependencies == +Dependencies +------------ GMP. diff --git a/build/pkgs/lie/SPKG.txt b/build/pkgs/lie/SPKG.rst similarity index 87% rename from build/pkgs/lie/SPKG.txt rename to build/pkgs/lie/SPKG.rst index dba5cbdc69f..115261d7446 100644 --- a/build/pkgs/lie/SPKG.txt +++ b/build/pkgs/lie/SPKG.rst @@ -1,6 +1,8 @@ -= LiE = +LiE +=== -== Description == +Description +----------- LiE is the name of a software package that enables mathematicians and physicists to perform computations of a Lie group theoretic nature. It @@ -32,17 +34,20 @@ and about currently valid definitions and values. (from http://www-math.univ-poitiers.fr/~maavl/LiE/description.html ) -== License == +License +------- GNU Lesser General Public License (LGPL), version unspecified -== Upstream Contact == - * Marc van Leeuwen, http://www-math.univ-poitiers.fr/~maavl/ +Upstream Contact +---------------- -== Dependencies == +- Marc van Leeuwen, http://www-math.univ-poitiers.fr/~maavl/ - * readline - * ncurses - * bison (not included in this package or in Sage!) +Dependencies +------------ +- readline +- ncurses +- bison (not included in this package or in Sage!) diff --git a/build/pkgs/linbox/SPKG.rst b/build/pkgs/linbox/SPKG.rst new file mode 100644 index 00000000000..93c854986ed --- /dev/null +++ b/build/pkgs/linbox/SPKG.rst @@ -0,0 +1,57 @@ +LinBox +====== + +Description +----------- + +From http://linalg.org/: LinBox is a C++ template library for exact, +high-performance linear algebra computation with dense, sparse, and +structured matrices over the integers and over finite fields. + +License +------- + +LGPL V2 or later + + +Upstream Contact +---------------- + +- +- + + +SPKG Repository +--------------- + + https://bitbucket.org/malb/linbox-spkg + +Dependencies +------------ + +- GNU patch +- GMP/MPIR +- MPFR +- NTL +- fpLLL +- IML +- M4RI +- M4RIE +- Givaro +- FFLAS/FFPACK +- ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) +- ATLAS (non-MacOS X) / The Accelerate FrameWork (on MacOS X), or GSL's + CBLAS + + +Special Update/Build Instructions +--------------------------------- + +TODO: + +- spkg-check is disabled for now, should work in the next release + after 1.3.2. + +- Check whether ``make fullcheck`` works/builds, is worth running, and + doesn't + take ages. (Version 1.1.6 doesn't seem to have such a target.) diff --git a/build/pkgs/linbox/SPKG.txt b/build/pkgs/linbox/SPKG.txt deleted file mode 100644 index d4d5bbbecc0..00000000000 --- a/build/pkgs/linbox/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= LinBox = - -== Description == - -From http://linalg.org/: LinBox is a C++ template library for exact, -high-performance linear algebra computation with dense, sparse, and -structured matrices over the integers and over finite fields. - -== License == - -LGPL V2 or later - -== Upstream Contact == - - * - * - -== SPKG Repository == - - https://bitbucket.org/malb/linbox-spkg - -== Dependencies == - - * GNU patch - * GMP/MPIR - * MPFR - * NTL - * fpLLL - * IML - * M4RI - * M4RIE - * Givaro - * FFLAS/FFPACK - * ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) - * ATLAS (non-MacOS X) / The Accelerate FrameWork (on MacOS X), or GSL's CBLAS - -== Special Update/Build Instructions == - -TODO: - - spkg-check is disabled for now, should work in the next release - after 1.3.2. - - Check whether `make fullcheck` works/builds, is worth running, and doesn't - take ages. (Version 1.1.6 doesn't seem to have such a target.) - diff --git a/build/pkgs/lrcalc/SPKG.txt b/build/pkgs/lrcalc/SPKG.rst similarity index 67% rename from build/pkgs/lrcalc/SPKG.txt rename to build/pkgs/lrcalc/SPKG.rst index 2ac951c59fd..80f8bb08448 100644 --- a/build/pkgs/lrcalc/SPKG.txt +++ b/build/pkgs/lrcalc/SPKG.rst @@ -1,16 +1,21 @@ -= lrcalc = +lrcalc +====== -== Description == +Description +----------- Littlewood-Richardson Calculator http://math.rutgers.edu/~asbuch/lrcalc/ -== License == +License +------- GNU General Public License V2+ -== Upstream Contact == + +Upstream Contact +---------------- Anders S. Buch (asbuch@math.rutgers.edu) diff --git a/build/pkgs/lrslib/SPKG.txt b/build/pkgs/lrslib/SPKG.rst similarity index 57% rename from build/pkgs/lrslib/SPKG.txt rename to build/pkgs/lrslib/SPKG.rst index a940babecbb..852810abb5e 100644 --- a/build/pkgs/lrslib/SPKG.txt +++ b/build/pkgs/lrslib/SPKG.rst @@ -1,30 +1,39 @@ -= lrslib = +lrslib +====== -== Description == +Description +----------- -lrslib implements the linear reverse search algorithm of Avis and Fukuda. +lrslib implements the linear reverse search algorithm of Avis and +Fukuda. See the homepage (http://cgm.cs.mcgill.ca/~avis/C/lrs.html) for details. -We use an autotoolized version from https://github.com/mkoeppe/lrslib/tree/autoconfiscation +We use an autotoolized version from +https://github.com/mkoeppe/lrslib/tree/autoconfiscation + +License +------- -== License == lrslib is released under a GPL v2+ license. -== Upstream Contact == + +Upstream Contact +---------------- David Avis, avis at cs dot mcgill dot edu. -== Dependencies == +Dependencies +------------ To build and install the "plrs" binary, a multi-thread version of lrs, need to first install the full Boost package ("sage -i boost"). -If the package finds an MPI C++ compiler script (mpic++), it also -builds and installs the "mplrs" binary, a distributed version of lrs -using MPI. +If the package finds an MPI C++ compiler script (mpic++), it also builds +and installs the "mplrs" binary, a distributed version of lrs using MPI. (Sage currently does not make use of plrs and mplrs.) -== Special Update/Build Instructions == +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/m4ri/SPKG.rst b/build/pkgs/m4ri/SPKG.rst new file mode 100644 index 00000000000..6b71b777848 --- /dev/null +++ b/build/pkgs/m4ri/SPKG.rst @@ -0,0 +1,36 @@ +M4RI +==== + +Description +----------- + +M4RI: Library for matrix multiplication, reduction and inversion over +GF(2). (See also m4ri/README for a brief overview.) + +License +------- + +- GNU General Public License Version 2 or later (see src/COPYING) + + +Upstream Contact +---------------- + +- Authors: Martin Albrecht et al. +- Email: +- Website: https://bitbucket.org/malb/m4ri + +Dependencies +------------ + +- libPNG + + +Special Update/Build Instructions +--------------------------------- + +- Delete the upstream Mercurial repositories (file m4ri/.hgtags, + directory m4ri/.hg). +- Delete the directory m4ri/autom4te.cache (if present). +- Delete m4ri.vcproj (and perhaps other unnecessary baggage). +- Touch m4ri/configure to make sure it is newer than its sources. diff --git a/build/pkgs/m4ri/SPKG.txt b/build/pkgs/m4ri/SPKG.txt deleted file mode 100644 index cfade2147e1..00000000000 --- a/build/pkgs/m4ri/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= M4RI = - -== Description == - -M4RI: Library for matrix multiplication, reduction and inversion over -GF(2). (See also m4ri/README for a brief overview.) - -== License == - - * GNU General Public License Version 2 or later (see src/COPYING) - -== Upstream Contact == - - * Authors: Martin Albrecht et al. - * Email: - * Website: https://bitbucket.org/malb/m4ri - -== Dependencies == - - * libPNG - -== Special Update/Build Instructions == - * Delete the upstream Mercurial repositories (file m4ri/.hgtags, directory m4ri/.hg). - * Delete the directory m4ri/autom4te.cache (if present). - * Delete m4ri.vcproj (and perhaps other unnecessary baggage). - * Touch m4ri/configure to make sure it is newer than its sources. - diff --git a/build/pkgs/m4rie/SPKG.rst b/build/pkgs/m4rie/SPKG.rst new file mode 100644 index 00000000000..34f5b73f732 --- /dev/null +++ b/build/pkgs/m4rie/SPKG.rst @@ -0,0 +1,27 @@ +M4RIE +===== + +Description +----------- + +M4RIE: Library for matrix multiplication, reduction and inversion over +GF(2^k) for 2 <= k <= 10. + +License +------- + +- GNU General Public License Version 2 or later (see src/COPYING) + + +Upstream Contact +---------------- + +- Authors: Martin Albrecht +- Email: +- Website: http://m4ri.sagemath.org + +Dependencies +------------ + +- M4RI +- Givaro diff --git a/build/pkgs/m4rie/SPKG.txt b/build/pkgs/m4rie/SPKG.txt deleted file mode 100644 index 8aa21cd846a..00000000000 --- a/build/pkgs/m4rie/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= M4RIE = - -== Description == - -M4RIE: Library for matrix multiplication, reduction and inversion over -GF(2^k) for 2 <= k <= 10. - -== License == - - * GNU General Public License Version 2 or later (see src/COPYING) - -== Upstream Contact == - - * Authors: Martin Albrecht - * Email: - * Website: http://m4ri.sagemath.org - -== Dependencies == - - * M4RI - * Givaro - diff --git a/build/pkgs/markupsafe/SPKG.txt b/build/pkgs/markupsafe/SPKG.rst similarity index 55% rename from build/pkgs/markupsafe/SPKG.txt rename to build/pkgs/markupsafe/SPKG.rst index e0b5a22e19f..b2f117dae5b 100644 --- a/build/pkgs/markupsafe/SPKG.txt +++ b/build/pkgs/markupsafe/SPKG.rst @@ -1,19 +1,23 @@ -= markupsafe = +markupsafe +========== -== Description == +Description +----------- Implements a XML/HTML/XHTML Markup safe string for Python -== License == +License +------- Simplified BSD -== Upstream Contact == + +Upstream Contact +---------------- Home page: http://github.com/mitsuhiko/markupsafe -== Dependencies == +Dependencies +------------ Python, setuptools - - diff --git a/build/pkgs/mathjax/SPKG.rst b/build/pkgs/mathjax/SPKG.rst new file mode 100644 index 00000000000..94b165256d2 --- /dev/null +++ b/build/pkgs/mathjax/SPKG.rst @@ -0,0 +1,37 @@ +MathJax +======= + +Description +----------- + +MathJax is a JavaScript library for displaying mathematical formulas. +Mathjax is used by both sagenb and ipython notebooks. + +License +------- + +Apache License, version 2.0 + + +Upstream Contact +---------------- + +Home page: http://www.mathjax.org/ + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +None. + +Patches +------- + +- nopng_config.patch: prevent font warning messages since png files are + removed. See section "Trimming II -- not strictly necessary" of + https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation diff --git a/build/pkgs/mathjax/SPKG.txt b/build/pkgs/mathjax/SPKG.txt deleted file mode 100644 index ae499963726..00000000000 --- a/build/pkgs/mathjax/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= MathJax = - -== Description == - -MathJax is a JavaScript library for displaying mathematical formulas. -Mathjax is used by both sagenb and ipython notebooks. - -== License == - -Apache License, version 2.0 - -== Upstream Contact == - -Home page: http://www.mathjax.org/ - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - -== Patches == - -* nopng_config.patch: prevent font warning messages since png files are - removed. See section "Trimming II -- not strictly necessary" of - https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation - diff --git a/build/pkgs/matplotlib/SPKG.rst b/build/pkgs/matplotlib/SPKG.rst new file mode 100644 index 00000000000..d559f2ae488 --- /dev/null +++ b/build/pkgs/matplotlib/SPKG.rst @@ -0,0 +1,60 @@ +matplotlib +========== + +Description +----------- + +From the Matplotlib website: matplotlib is a python 2D plotting library +which produces publication quality figures in a variety of hardcopy +formats and interactive environments across platforms. matplotlib can be +used in python scripts, the python and ipython shell (ala matlab or +mathematica), web application servers, and six graphical user interface +toolkits. + +License +------- + +The Matplotlib license - see +http://matplotlib.sourceforge.net/users/license.html: Matplotlib only +uses BSD compatible code, and its license is based on the PSF license. +See the Open Source Initiative licenses page for details on individual +licenses. Non-BSD compatible licenses (eg LGPL) are acceptable in +matplotlib Toolkits. For a discussion of the motivations behind the +licencing choice, see Licenses. + + +Upstream Contact +---------------- + +The matplotlib mailing lists: see +http://sourceforge.net/projects/matplotlib + +Dependencies +------------ + +- python +- numpy +- setuptools (>= 0.7) +- freetype +- patch (used in spkg-install) +- dateutil +- pyparsing +- tornado +- kiwisolver + + +Build Instructions/Changes +-------------------------- + +- NOTE: To drastically cut down on spkg size, we delete the internal + testing images. To do this, we repackage the tarball by removing + the contents of ``lib/matplotlib/tests/baseline_images/*``, this is + done by the ``spkg-src`` script. + +- ``setup.py.patch``: disable loading of Tests. Otherwise, ``setup.py`` + raises an error because it can't find the deleted files + from ``src/lib/matplotlib/tests/baseline_images/*`` + +- NOTE: as of matplotlib-1.0.0 and Sage 4.6, Sage does not use + $HOME/.matplotlib by default. Instead, it sets MPLCONFIGDIR to + a subdirectory in $DOT_SAGE, see src/bin/sage-env diff --git a/build/pkgs/matplotlib/SPKG.txt b/build/pkgs/matplotlib/SPKG.txt deleted file mode 100644 index 5b8e0e6ea63..00000000000 --- a/build/pkgs/matplotlib/SPKG.txt +++ /dev/null @@ -1,51 +0,0 @@ -= matplotlib = - -== Description == - -From the Matplotlib website: matplotlib is a python 2D plotting -library which produces publication quality figures in a variety of -hardcopy formats and interactive environments across -platforms. matplotlib can be used in python scripts, the python and -ipython shell (ala matlab or mathematica), web application servers, -and six graphical user interface toolkits. - -== License == - -The Matplotlib license - see -http://matplotlib.sourceforge.net/users/license.html: Matplotlib only -uses BSD compatible code, and its license is based on the PSF -license. See the Open Source Initiative licenses page for details on -individual licenses. Non-BSD compatible licenses (eg LGPL) are -acceptable in matplotlib Toolkits. For a discussion of the motivations -behind the licencing choice, see Licenses. - -== Upstream Contact == - -The matplotlib mailing lists: see http://sourceforge.net/projects/matplotlib - -== Dependencies == - - * python - * numpy - * setuptools (>= 0.7) - * freetype - * patch (used in spkg-install) - * dateutil - * pyparsing - * tornado - * kiwisolver - -== Build Instructions/Changes == - - * NOTE: To drastically cut down on spkg size, we delete the internal - testing images. To do this, we repackage the tarball by removing - the contents of lib/matplotlib/tests/baseline_images/*, this is - done by the spkg-src script. - - * setup.py.patch: disable loading of Tests. Otherwise, setup.py - raises an error because it can't find the deleted files - from src/lib/matplotlib/tests/baseline_images/* - - * NOTE: as of matplotlib-1.0.0 and Sage 4.6, Sage does not use - $HOME/.matplotlib by default. Instead, it sets MPLCONFIGDIR to - a subdirectory in $DOT_SAGE, see src/bin/sage-env diff --git a/build/pkgs/matplotlib/checksums.ini b/build/pkgs/matplotlib/checksums.ini index 11f9acfaca1..f9fdd8483d9 100644 --- a/build/pkgs/matplotlib/checksums.ini +++ b/build/pkgs/matplotlib/checksums.ini @@ -1,5 +1,5 @@ tarball=matplotlib-VERSION.tar.gz -sha1=fdb01bd4b35a0947e0b10b4a349d32dca305d7fd -md5=422fc58e7323b7ba3f19382424f9ab7b -cksum=2814562579 +sha1=8263c2e1ceb3f610c898b85dfeb8b68bf338e86f +md5=6c018a644a88120886cc7211f7c826f0 +cksum=3466825812 upstream_url=https://pypi.io/packages/source/m/matplotlib/matplotlib-VERSION.tar.gz diff --git a/build/pkgs/matplotlib/package-version.txt b/build/pkgs/matplotlib/package-version.txt index 21bb5e156fb..e4604e3afd0 100644 --- a/build/pkgs/matplotlib/package-version.txt +++ b/build/pkgs/matplotlib/package-version.txt @@ -1 +1 @@ -2.2.5 +3.2.1 diff --git a/build/pkgs/matplotlib/patches/15104.patch b/build/pkgs/matplotlib/patches/15104.patch new file mode 100644 index 00000000000..d9c08172c98 --- /dev/null +++ b/build/pkgs/matplotlib/patches/15104.patch @@ -0,0 +1,689 @@ +From 97477d7214b400f5b2b69f2cf5ffb0784cf8237d Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Wed, 21 Aug 2019 17:51:16 +0200 +Subject: [PATCH 1/3] Simplify file handling in ft2font. + +Just call the Python-level seek(), read() and close() instead of trying +to play with C-level FILE*. + +Note that unlike the png case, we can't just pass restrict ourselves to +passing in file-like objects because FT2Font is public API. +--- + src/file_compat.h | 220 ---------------------------------------- + src/ft2font_wrapper.cpp | 141 +++++++++---------------- + 2 files changed, 49 insertions(+), 312 deletions(-) + delete mode 100644 src/file_compat.h + +diff --git a/src/file_compat.h b/src/file_compat.h +deleted file mode 100644 +index 4115d23e63f..00000000000 +--- a/src/file_compat.h ++++ /dev/null +@@ -1,220 +0,0 @@ +-#ifndef MPL_FILE_COMPAT_H +-#define MPL_FILE_COMPAT_H +-#define PY_SSIZE_T_CLEAN +-#include +-#include +-#include "numpy/npy_common.h" +-#include "numpy/ndarrayobject.h" +-#include "mplutils.h" +- +-#ifdef __cplusplus +-extern "C" { +-#endif +-#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400) +- #include +- #define mpl_fseek _fseeki64 +- #define mpl_ftell _ftelli64 +- #define mpl_lseek _lseeki64 +- #define mpl_off_t npy_int64 +- +- #if NPY_SIZEOF_INT == 8 +- #define MPL_OFF_T_PYFMT "i" +- #elif NPY_SIZEOF_LONG == 8 +- #define MPL_OFF_T_PYFMT "l" +- #elif NPY_SIZEOF_LONGLONG == 8 +- #define MPL_OFF_T_PYFMT "L" +- #else +- #error Unsupported size for type off_t +- #endif +-#else +- #define mpl_fseek fseek +- #define mpl_ftell ftell +- #define mpl_lseek lseek +- #define mpl_off_t off_t +- +- #if NPY_SIZEOF_INT == NPY_SIZEOF_SHORT +- #define MPL_OFF_T_PYFMT "h" +- #elif NPY_SIZEOF_INT == NPY_SIZEOF_INT +- #define MPL_OFF_T_PYFMT "i" +- #elif NPY_SIZEOF_INT == NPY_SIZEOF_LONG +- #define MPL_OFF_T_PYFMT "l" +- #elif NPY_SIZEOF_INT == NPY_SIZEOF_LONGLONG +- #define MPL_OFF_T_PYFMT "L" +- #else +- #error Unsupported size for type off_t +- #endif +-#endif +- +-/* +- * PyFile_* compatibility +- */ +- +-/* +- * Get a FILE* handle to the file represented by the Python object +- */ +-static NPY_INLINE FILE *mpl_PyFile_Dup(PyObject *file, char *mode, mpl_off_t *orig_pos) +-{ +- int fd, fd2; +- PyObject *ret, *os; +- mpl_off_t pos; +- FILE *handle; +- +- if (mode[0] != 'r') { +- /* Flush first to ensure things end up in the file in the correct order */ +- ret = PyObject_CallMethod(file, (char *)"flush", (char *)""); +- if (ret == NULL) { +- return NULL; +- } +- Py_DECREF(ret); +- } +- +- fd = PyObject_AsFileDescriptor(file); +- if (fd == -1) { +- return NULL; +- } +- +- /* The handle needs to be dup'd because we have to call fclose +- at the end */ +- os = PyImport_ImportModule("os"); +- if (os == NULL) { +- return NULL; +- } +- ret = PyObject_CallMethod(os, (char *)"dup", (char *)"i", fd); +- Py_DECREF(os); +- if (ret == NULL) { +- return NULL; +- } +- fd2 = (int)PyNumber_AsSsize_t(ret, NULL); +- Py_DECREF(ret); +- +-/* Convert to FILE* handle */ +-#ifdef _WIN32 +- handle = _fdopen(fd2, mode); +-#else +- handle = fdopen(fd2, mode); +-#endif +- if (handle == NULL) { +- PyErr_SetString(PyExc_IOError, "Getting a FILE* from a Python file object failed"); +- return NULL; +- } +- +- /* Record the original raw file handle position */ +- *orig_pos = mpl_ftell(handle); +- if (*orig_pos == -1) { +- // handle is a stream, so we don't have to worry about this +- return handle; +- } +- +- /* Seek raw handle to the Python-side position */ +- ret = PyObject_CallMethod(file, (char *)"tell", (char *)""); +- if (ret == NULL) { +- fclose(handle); +- return NULL; +- } +- pos = PyNumber_AsSsize_t(ret, PyExc_OverflowError); +- Py_DECREF(ret); +- if (PyErr_Occurred()) { +- fclose(handle); +- return NULL; +- } +- if (mpl_fseek(handle, pos, SEEK_SET) == -1) { +- PyErr_SetString(PyExc_IOError, "seeking file failed"); +- return NULL; +- } +- return handle; +-} +- +-/* +- * Close the dup-ed file handle, and seek the Python one to the current position +- */ +-static NPY_INLINE int mpl_PyFile_DupClose(PyObject *file, FILE *handle, mpl_off_t orig_pos) +-{ +- PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL; +- PyErr_Fetch(&exc_type, &exc_value, &exc_tb); +- +- int fd; +- PyObject *ret; +- mpl_off_t position; +- +- position = mpl_ftell(handle); +- +- /* Close the FILE* handle */ +- fclose(handle); +- +- /* Restore original file handle position, in order to not confuse +- Python-side data structures. Note that this would fail if an exception +- is currently set, which can happen as this function is called in cleanup +- code, so we need to carefully fetch and restore the exception state. */ +- fd = PyObject_AsFileDescriptor(file); +- if (fd == -1) { +- goto fail; +- } +- if (mpl_lseek(fd, orig_pos, SEEK_SET) != -1) { +- if (position == -1) { +- PyErr_SetString(PyExc_IOError, "obtaining file position failed"); +- goto fail; +- } +- +- /* Seek Python-side handle to the FILE* handle position */ +- ret = PyObject_CallMethod(file, (char *)"seek", (char *)(MPL_OFF_T_PYFMT "i"), position, 0); +- if (ret == NULL) { +- goto fail; +- } +- Py_DECREF(ret); +- } +- PyErr_Restore(exc_type, exc_value, exc_tb); +- return 0; +-fail: +- Py_XDECREF(exc_type); +- Py_XDECREF(exc_value); +- Py_XDECREF(exc_tb); +- return -1; +-} +- +-static NPY_INLINE int mpl_PyFile_Check(PyObject *file) +-{ +- int fd; +- fd = PyObject_AsFileDescriptor(file); +- if (fd == -1) { +- PyErr_Clear(); +- return 0; +- } +- return 1; +-} +- +-static NPY_INLINE PyObject *mpl_PyFile_OpenFile(PyObject *filename, const char *mode) +-{ +- PyObject *open; +- open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); +- if (open == NULL) { +- return NULL; +- } +- return PyObject_CallFunction(open, (char *)"Os", filename, mode); +-} +- +-static NPY_INLINE int mpl_PyFile_CloseFile(PyObject *file) +-{ +- PyObject *type, *value, *tb; +- PyErr_Fetch(&type, &value, &tb); +- +- PyObject *ret; +- +- ret = PyObject_CallMethod(file, (char *)"close", NULL); +- if (ret == NULL) { +- goto fail; +- } +- Py_DECREF(ret); +- PyErr_Restore(type, value, tb); +- return 0; +-fail: +- Py_XDECREF(type); +- Py_XDECREF(value); +- Py_XDECREF(tb); +- return -1; +-} +- +-#ifdef __cplusplus +-} +-#endif +- +-#endif /* ifndef MPL_FILE_COMPAT_H */ +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index e4a12d9eee2..0f5b1edcbb0 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -1,6 +1,5 @@ + #include "mplutils.h" + #include "ft2font.h" +-#include "file_compat.h" + #include "py_converters.h" + #include "py_exceptions.h" + #include "numpy_cpp.h" +@@ -365,12 +364,8 @@ typedef struct + FT2Font *x; + PyObject *fname; + PyObject *py_file; +- FILE *fp; + int close_file; +- mpl_off_t offset; + FT_StreamRec stream; +- FT_Byte *mem; +- size_t mem_size; + Py_ssize_t shape[2]; + Py_ssize_t strides[2]; + Py_ssize_t suboffsets[2]; +@@ -381,115 +376,84 @@ static unsigned long read_from_file_callback(FT_Stream stream, + unsigned char *buffer, + unsigned long count) + { +- +- PyFT2Font *def = (PyFT2Font *)stream->descriptor.pointer; +- +- if (fseek(def->fp, offset, SEEK_SET) == -1) { +- return 0; ++ PyObject *py_file = ((PyFT2Font *)stream->descriptor.pointer)->py_file; ++ PyObject *seek_result = NULL, *read_result = NULL; ++ Py_ssize_t n_read = 0; ++ if (!(seek_result = PyObject_CallMethod(py_file, "seek", "k", offset)) ++ || !(read_result = PyObject_CallMethod(py_file, "read", "k", count))) { ++ goto exit; + } +- +- if (count > 0) { +- return fread(buffer, 1, count, def->fp); ++ char *tmpbuf; ++ if (PyBytes_AsStringAndSize(read_result, &tmpbuf, &n_read) == -1) { ++ goto exit; + } +- +- return 0; ++ memcpy(buffer, tmpbuf, n_read); ++exit: ++ Py_XDECREF(seek_result); ++ Py_XDECREF(read_result); ++ if (PyErr_Occurred()) { ++ PyErr_WriteUnraisable(py_file); ++ if (!count) { ++ return 1; // Non-zero signals error, when count == 0. ++ } ++ } ++ return n_read; + } + + static void close_file_callback(FT_Stream stream) + { +- PyFT2Font *def = (PyFT2Font *)stream->descriptor.pointer; +- +- if (mpl_PyFile_DupClose(def->py_file, def->fp, def->offset)) { +- throw std::runtime_error("Couldn't close file"); ++ PyObject *py_file = ((PyFT2Font *)stream->descriptor.pointer)->py_file; ++ PyObject *close_result = NULL; ++ if (!(close_result = PyObject_CallMethod(py_file, "close", ""))) { ++ goto exit; + } +- +- if (def->close_file) { +- mpl_PyFile_CloseFile(def->py_file); ++exit: ++ Py_XDECREF(close_result); ++ Py_DECREF(py_file); ++ if (PyErr_Occurred()) { ++ PyErr_WriteUnraisable(py_file); + } +- +- Py_DECREF(def->py_file); +- def->py_file = NULL; + } + + static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Args *open_args) + { +- PyObject *py_file = NULL; +- int close_file = 0; +- FILE *fp; ++ PyObject *open = NULL; + PyObject *data = NULL; +- char *data_ptr; +- Py_ssize_t data_len; +- long file_size; +- FT_Byte *new_memory; +- mpl_off_t offset = 0; + + int result = 0; + + memset((void *)open_args, 0, sizeof(FT_Open_Args)); + + if (PyBytes_Check(py_file_arg) || PyUnicode_Check(py_file_arg)) { +- if ((py_file = mpl_PyFile_OpenFile(py_file_arg, (char *)"rb")) == NULL) { ++ if (!(open = PyDict_GetItemString(PyEval_GetBuiltins(), "open")) // Borrowed reference. ++ || !(self->py_file = PyObject_CallFunction(open, "Os", py_file_arg, "rb"))) { + goto exit; + } +- close_file = 1; ++ self->close_file = 1; ++ } else if (!PyObject_HasAttrString(py_file_arg, "read") ++ || !(data = PyObject_CallMethod(py_file_arg, "read", "i", 0)) ++ || !PyBytes_Check(data)) { ++ PyErr_SetString(PyExc_TypeError, ++ "First argument must be a path or binary-mode file object"); ++ goto exit; + } else { ++ self->py_file = py_file_arg; + Py_INCREF(py_file_arg); +- py_file = py_file_arg; +- } +- +- if ((fp = mpl_PyFile_Dup(py_file, (char *)"rb", &offset))) { +- Py_INCREF(py_file); +- self->py_file = py_file; +- self->close_file = close_file; +- self->fp = fp; +- self->offset = offset; +- fseek(fp, 0, SEEK_END); +- file_size = ftell(fp); +- fseek(fp, 0, SEEK_SET); +- +- self->stream.base = NULL; +- self->stream.size = (unsigned long)file_size; +- self->stream.pos = 0; +- self->stream.descriptor.pointer = self; +- self->stream.read = &read_from_file_callback; +- self->stream.close = &close_file_callback; +- +- open_args->flags = FT_OPEN_STREAM; +- open_args->stream = &self->stream; +- } else { +- if (PyObject_HasAttrString(py_file_arg, "read") && +- (data = PyObject_CallMethod(py_file_arg, (char *)"read", (char *)""))) { +- if (PyBytes_AsStringAndSize(data, &data_ptr, &data_len)) { +- goto exit; +- } +- +- if (self->mem) { +- free(self->mem); +- } +- self->mem = (FT_Byte *)malloc((self->mem_size + data_len) * sizeof(FT_Byte)); +- if (self->mem == NULL) { +- goto exit; +- } +- new_memory = self->mem + self->mem_size; +- self->mem_size += data_len; +- +- memcpy(new_memory, data_ptr, data_len); +- open_args->flags = FT_OPEN_MEMORY; +- open_args->memory_base = new_memory; +- open_args->memory_size = data_len; +- open_args->stream = NULL; +- } else { +- PyErr_SetString(PyExc_TypeError, +- "First argument must be a path or file object reading bytes"); +- goto exit; +- } + } + ++ self->stream.base = NULL; ++ self->stream.size = 0x7fffffff; // Unknown size. ++ self->stream.pos = 0; ++ self->stream.descriptor.pointer = self; ++ self->stream.read = &read_from_file_callback; ++ self->stream.close = &close_file_callback; ++ open_args->flags = FT_OPEN_STREAM; ++ open_args->stream = &self->stream; ++ + result = 1; + + exit: + +- Py_XDECREF(py_file); + Py_XDECREF(data); + + return result; +@@ -504,12 +468,8 @@ static PyObject *PyFT2Font_new(PyTypeObject *type, PyObject *args, PyObject *kwd + self->x = NULL; + self->fname = NULL; + self->py_file = NULL; +- self->fp = NULL; + self->close_file = 0; +- self->offset = 0; + memset(&self->stream, 0, sizeof(FT_StreamRec)); +- self->mem = 0; +- self->mem_size = 0; + return (PyObject *)self; + } + +@@ -542,8 +502,6 @@ const char *PyFT2Font_init__doc__ = + + static void PyFT2Font_fail(PyFT2Font *self) + { +- free(self->mem); +- self->mem = NULL; + Py_XDECREF(self->py_file); + self->py_file = NULL; + } +@@ -580,7 +538,6 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + static void PyFT2Font_dealloc(PyFT2Font *self) + { + delete self->x; +- free(self->mem); + Py_XDECREF(self->py_file); + Py_XDECREF(self->fname); + Py_TYPE(self)->tp_free((PyObject *)self); + +From 505cbed6a859a3fdf8455da0a339b0d09f7a6f17 Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Mon, 11 May 2020 22:27:56 +0200 +Subject: [PATCH 2/3] Handle review comments. + +--- + src/ft2font_wrapper.cpp | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index 0f5b1edcbb0..3882e03eae5 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -364,7 +364,6 @@ typedef struct + FT2Font *x; + PyObject *fname; + PyObject *py_file; +- int close_file; + FT_StreamRec stream; + Py_ssize_t shape[2]; + Py_ssize_t strides[2]; +@@ -402,16 +401,16 @@ static unsigned long read_from_file_callback(FT_Stream stream, + + static void close_file_callback(FT_Stream stream) + { +- PyObject *py_file = ((PyFT2Font *)stream->descriptor.pointer)->py_file; ++ PyFT2Font *self = (PyFT2Font *)stream->descriptor.pointer; + PyObject *close_result = NULL; +- if (!(close_result = PyObject_CallMethod(py_file, "close", ""))) { ++ if (!(close_result = PyObject_CallMethod(self->py_file, "close", ""))) { + goto exit; + } + exit: + Py_XDECREF(close_result); +- Py_DECREF(py_file); ++ Py_CLEAR(self->py_file); + if (PyErr_Occurred()) { +- PyErr_WriteUnraisable(py_file); ++ PyErr_WriteUnraisable((PyObject*)self); + } + } + +@@ -421,6 +420,7 @@ static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Arg + PyObject *data = NULL; + + int result = 0; ++ bool close_file = false; + + memset((void *)open_args, 0, sizeof(FT_Open_Args)); + +@@ -429,7 +429,7 @@ static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Arg + || !(self->py_file = PyObject_CallFunction(open, "Os", py_file_arg, "rb"))) { + goto exit; + } +- self->close_file = 1; ++ close_file = true; + } else if (!PyObject_HasAttrString(py_file_arg, "read") + || !(data = PyObject_CallMethod(py_file_arg, "read", "i", 0)) + || !PyBytes_Check(data)) { +@@ -446,7 +446,7 @@ static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Arg + self->stream.pos = 0; + self->stream.descriptor.pointer = self; + self->stream.read = &read_from_file_callback; +- self->stream.close = &close_file_callback; ++ self->stream.close = close_file ? &close_file_callback : NULL; + open_args->flags = FT_OPEN_STREAM; + open_args->stream = &self->stream; + +@@ -468,7 +468,6 @@ static PyObject *PyFT2Font_new(PyTypeObject *type, PyObject *args, PyObject *kwd + self->x = NULL; + self->fname = NULL; + self->py_file = NULL; +- self->close_file = 0; + memset(&self->stream, 0, sizeof(FT_StreamRec)); + return (PyObject *)self; + } +@@ -500,12 +499,6 @@ const char *PyFT2Font_init__doc__ = + " underline_thickness vertical thickness of the underline\n" + " postscript_name PostScript name of the font\n"; + +-static void PyFT2Font_fail(PyFT2Font *self) +-{ +- Py_XDECREF(self->py_file); +- self->py_file = NULL; +-} +- + static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + { + PyObject *fname; +@@ -525,7 +518,8 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + } + + CALL_CPP_FULL( +- "FT2Font", (self->x = new FT2Font(open_args, hinting_factor)), PyFT2Font_fail(self), -1); ++ "FT2Font", (self->x = new FT2Font(open_args, hinting_factor)), ++ Py_CLEAR(self->py_file), -1); + + CALL_CPP_INIT("FT2Font->set_kerning_factor", (self->x->set_kerning_factor(kerning_factor))); + + +From 23d36d9d39a5b41f54346fda66ba0207ffef7c28 Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Mon, 11 May 2020 23:35:53 +0200 +Subject: [PATCH 3/3] Inline convert_open_args. + +--- + src/ft2font_wrapper.cpp | 83 ++++++++++++++++------------------------- + 1 file changed, 32 insertions(+), 51 deletions(-) + +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index 3882e03eae5..c5b4cbb5fdf 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -414,51 +414,6 @@ static void close_file_callback(FT_Stream stream) + } + } + +-static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Args *open_args) +-{ +- PyObject *open = NULL; +- PyObject *data = NULL; +- +- int result = 0; +- bool close_file = false; +- +- memset((void *)open_args, 0, sizeof(FT_Open_Args)); +- +- if (PyBytes_Check(py_file_arg) || PyUnicode_Check(py_file_arg)) { +- if (!(open = PyDict_GetItemString(PyEval_GetBuiltins(), "open")) // Borrowed reference. +- || !(self->py_file = PyObject_CallFunction(open, "Os", py_file_arg, "rb"))) { +- goto exit; +- } +- close_file = true; +- } else if (!PyObject_HasAttrString(py_file_arg, "read") +- || !(data = PyObject_CallMethod(py_file_arg, "read", "i", 0)) +- || !PyBytes_Check(data)) { +- PyErr_SetString(PyExc_TypeError, +- "First argument must be a path or binary-mode file object"); +- goto exit; +- } else { +- self->py_file = py_file_arg; +- Py_INCREF(py_file_arg); +- } +- +- self->stream.base = NULL; +- self->stream.size = 0x7fffffff; // Unknown size. +- self->stream.pos = 0; +- self->stream.descriptor.pointer = self; +- self->stream.read = &read_from_file_callback; +- self->stream.close = close_file ? &close_file_callback : NULL; +- open_args->flags = FT_OPEN_STREAM; +- open_args->stream = &self->stream; +- +- result = 1; +- +-exit: +- +- Py_XDECREF(data); +- +- return result; +-} +- + static PyTypeObject PyFT2FontType; + + static PyObject *PyFT2Font_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +@@ -501,20 +456,43 @@ const char *PyFT2Font_init__doc__ = + + static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + { +- PyObject *fname; ++ PyObject *filename = NULL, *open = NULL, *data = NULL; + FT_Open_Args open_args; + long hinting_factor = 8; + int kerning_factor = 0; + const char *names[] = { "filename", "hinting_factor", "_kerning_factor", NULL }; + + if (!PyArg_ParseTupleAndKeywords( +- args, kwds, "O|l$i:FT2Font", (char **)names, &fname, ++ args, kwds, "O|l$i:FT2Font", (char **)names, &filename, + &hinting_factor, &kerning_factor)) { + return -1; + } + +- if (!convert_open_args(self, fname, &open_args)) { +- return -1; ++ self->stream.base = NULL; ++ self->stream.size = 0x7fffffff; // Unknown size. ++ self->stream.pos = 0; ++ self->stream.descriptor.pointer = self; ++ self->stream.read = &read_from_file_callback; ++ memset((void *)&open_args, 0, sizeof(FT_Open_Args)); ++ open_args.flags = FT_OPEN_STREAM; ++ open_args.stream = &self->stream; ++ ++ if (PyBytes_Check(filename) || PyUnicode_Check(filename)) { ++ if (!(open = PyDict_GetItemString(PyEval_GetBuiltins(), "open")) // Borrowed reference. ++ || !(self->py_file = PyObject_CallFunction(open, "Os", filename, "rb"))) { ++ goto exit; ++ } ++ self->stream.close = &close_file_callback; ++ } else if (!PyObject_HasAttrString(filename, "read") ++ || !(data = PyObject_CallMethod(filename, "read", "i", 0)) ++ || !PyBytes_Check(data)) { ++ PyErr_SetString(PyExc_TypeError, ++ "First argument must be a path or binary-mode file object"); ++ goto exit; ++ } else { ++ self->py_file = filename; ++ self->stream.close = NULL; ++ Py_INCREF(filename); + } + + CALL_CPP_FULL( +@@ -523,8 +501,11 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + + CALL_CPP_INIT("FT2Font->set_kerning_factor", (self->x->set_kerning_factor(kerning_factor))); + +- Py_INCREF(fname); +- self->fname = fname; ++ Py_INCREF(filename); ++ self->fname = filename; ++ ++exit: ++ Py_XDECREF(data); + + return 0; + } diff --git a/build/pkgs/matplotlib/patches/setup.py.patch b/build/pkgs/matplotlib/patches/setup.py.patch deleted file mode 100644 index dc1807551dc..00000000000 --- a/build/pkgs/matplotlib/patches/setup.py.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -85,8 +85,8 @@ mpl_packages = [ - 'Optional subpackages', - setupext.SampleData(), - setupext.Toolkits(), -- setupext.Tests(), -- setupext.Toolkits_Tests(), -+ # setupext.Tests(), -+ # setupext.Toolkits_Tests(), - 'Optional backend extensions', - # These backends are listed in order of preference, the first - # being the most preferred. The first one that looks like it will diff --git a/build/pkgs/matplotlib/spkg-install.in b/build/pkgs/matplotlib/spkg-install.in index 6b68b46ad5c..a427dadccd5 100644 --- a/build/pkgs/matplotlib/spkg-install.in +++ b/build/pkgs/matplotlib/spkg-install.in @@ -1,5 +1,5 @@ # Write a configuration file to src/setup.cfg -sage-system-python make-setup-config.py +sage-python23 make-setup-config.py cd src diff --git a/build/pkgs/maxima/SPKG.rst b/build/pkgs/maxima/SPKG.rst new file mode 100644 index 00000000000..4144178786f --- /dev/null +++ b/build/pkgs/maxima/SPKG.rst @@ -0,0 +1,76 @@ +Maxima +====== + +Description +----------- + +Maxima is a system for the manipulation of symbolic and numerical +expressions, including differentiation, integration, Taylor series, +Laplace transforms, ordinary differential equations, systems of linear +equations, polynomials, and sets, lists, vectors, matrices, and tensors. +Maxima yields high precision numeric results by using exact fractions, +arbitrary precision integers, and variable precision floating point +numbers. Maxima can plot functions and data in two and three dimensions. + +For more information, see the Maxima web site + +http://maxima.sourceforge.net + +License +------- + +Maxima is distributed under the GNU General Public License, with some +export restrictions from the U.S. Department of Energy. See the file +COPYING. + + +Upstream Contact +---------------- + +- The Maxima mailing list - see + http://maxima.sourceforge.net/maximalist.html + +Dependencies +------------ + +- ECL (Embedded Common Lisp) + + +Special Update/Build Instructions +--------------------------------- + +1. Go to http://sourceforge.net/projects/maxima/files/Maxima-source/ + and download the source tarball maxima-x.y.z.tar.gz; place it in + the upstream/ directory. + +2. Update package-version.txt and run 'sage --package fix-checksum'. + +3. Make sure the patches still apply cleanly, and update them if + necessary. + +4. Test the resulting package. + +All patch files in the patches/ directory are applied. Descriptions of +these patches are either in the patch files themselves or below. + +- 0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch: + Fix for Maxima bug #2520 (abs_integrate fails on abs(sin(x)) and + abs(cos(x))). Introduced in Trac #13364 (Upgrade Maxima to + 5.29.1). + +- build-fasl.patch: Build a fasl library for ecl in addition to an + executable program. Introduced in Trac #16178 (Build maxima fasl + without asdf). + +- infodir.patch: Correct the path to the Info directory. Introduced + in Trac #11348 (maxima test fails when install tree is moved). + +- matrixexp.patch: Fix matrixexp(matrix([%i*%pi])), which broke after + Maxima 5.29.1. Introduced in Trac #13973. + +- maxima.system.patch: Set ``c::*compile-in-constants*`` to t. + Introduced in Trac #11966 (OS X 10.7 Lion: Maxima fails to build). + +- undoing_true_false_printing_patch.patch: Revert an upstream change + causing '?' to be printed around some words. Introduced in Trac + #13364 (Upgrade Maxima to 5.29.1). diff --git a/build/pkgs/maxima/SPKG.txt b/build/pkgs/maxima/SPKG.txt deleted file mode 100644 index 9c8827a4dc0..00000000000 --- a/build/pkgs/maxima/SPKG.txt +++ /dev/null @@ -1,68 +0,0 @@ -= Maxima = - -== Description == - -Maxima is a system for the manipulation of symbolic and numerical -expressions, including differentiation, integration, Taylor series, -Laplace transforms, ordinary differential equations, systems of linear -equations, polynomials, and sets, lists, vectors, matrices, and -tensors. Maxima yields high precision numeric results by using exact -fractions, arbitrary precision integers, and variable precision -floating point numbers. Maxima can plot functions and data in two and -three dimensions. - -For more information, see the Maxima web site - -http://maxima.sourceforge.net - -== License == - -Maxima is distributed under the GNU General Public License, with some -export restrictions from the U.S. Department of Energy. See the file -COPYING. - -== Upstream Contact == - - * The Maxima mailing list - see http://maxima.sourceforge.net/maximalist.html - -== Dependencies == - - * ECL (Embedded Common Lisp) - -== Special Update/Build Instructions == - -1. Go to http://sourceforge.net/projects/maxima/files/Maxima-source/ - and download the source tarball maxima-x.y.z.tar.gz; place it in - the upstream/ directory. - -2. Update package-version.txt and run sage-fix-pkg-checksums. - -3. Make sure the patches still apply cleanly, and update them if - necessary. - -4. Test the resulting package. - -All patch files in the patches/ directory are applied. Descriptions -of these patches are either in the patch files themselves or below. - - * 0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch: - Fix for Maxima bug #2520 (abs_integrate fails on abs(sin(x)) and - abs(cos(x))). Introduced in Trac #13364 (Upgrade Maxima to - 5.29.1). - - * build-fasl.patch: Build a fasl library for ecl in addition to an - executable program. Introduced in Trac #16178 (Build maxima fasl - without asdf). - - * infodir.patch: Correct the path to the Info directory. Introduced - in Trac #11348 (maxima test fails when install tree is moved). - - * matrixexp.patch: Fix matrixexp(matrix([%i*%pi])), which broke after - Maxima 5.29.1. Introduced in Trac #13973. - - * maxima.system.patch: Set c::*compile-in-constants* to t. - Introduced in Trac #11966 (OS X 10.7 Lion: Maxima fails to build). - - * undoing_true_false_printing_patch.patch: Revert an upstream change - causing '?' to be printed around some words. Introduced in Trac - #13364 (Upgrade Maxima to 5.29.1). diff --git a/build/pkgs/mcqd/SPKG.txt b/build/pkgs/mcqd/SPKG.rst similarity index 53% rename from build/pkgs/mcqd/SPKG.txt rename to build/pkgs/mcqd/SPKG.rst index 0e973a54623..319dd5c6b23 100644 --- a/build/pkgs/mcqd/SPKG.txt +++ b/build/pkgs/mcqd/SPKG.rst @@ -1,20 +1,26 @@ -= MCQD 1.0 = -== Description == +MCQD 1.0 +======== -MaxCliqueDyn is a fast exact algorithm for finding a maximum clique in an -undirected graph. +Description +----------- -== License == +MaxCliqueDyn is a fast exact algorithm for finding a maximum clique in +an undirected graph. + +License +------- GPL 3 -== Upstream Contact == + +Upstream Contact +---------------- MCQD is currently being maintained by Janez Konc. https://gitlab.com/janezkonc/mcqd -== Dependencies == +Dependencies +------------ None - diff --git a/build/pkgs/meataxe/SPKG.rst b/build/pkgs/meataxe/SPKG.rst new file mode 100644 index 00000000000..cc6c41d1f6d --- /dev/null +++ b/build/pkgs/meataxe/SPKG.rst @@ -0,0 +1,27 @@ +SharedMeatAxe +============= + +Description +----------- + +SharedMeatAxe 1.0 is an autotoolized shared library version of C MeatAxe +2.4.24, a set of programs for computing with modular representations. +The package comprises a shared library "libmtx", as well as several +executables. + +See http://users.minet.uni-jena.de/~king/SharedMeatAxe/ for the package +documentation. + +Licence +------- + +The Shared Meat-Axe 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. See the file COPYING. + + +Upstream contact +---------------- + +- Simon King diff --git a/build/pkgs/meataxe/SPKG.txt b/build/pkgs/meataxe/SPKG.txt deleted file mode 100644 index 0c073a400f7..00000000000 --- a/build/pkgs/meataxe/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= SharedMeatAxe = - -== Description == - -SharedMeatAxe 1.0 is an autotoolized shared library version of C MeatAxe 2.4.24, -a set of programs for computing with modular representations. -The package comprises a shared library "libmtx", as well as several -executables. - -See http://users.minet.uni-jena.de/~king/SharedMeatAxe/ for the package -documentation. - -== Licence == - -The Shared Meat-Axe 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. See the file COPYING. - -== Upstream contact == - - * Simon King diff --git a/build/pkgs/mistune/SPKG.txt b/build/pkgs/mistune/SPKG.rst similarity index 52% rename from build/pkgs/mistune/SPKG.txt rename to build/pkgs/mistune/SPKG.rst index bc0f9192cae..e540bd0915f 100644 --- a/build/pkgs/mistune/SPKG.txt +++ b/build/pkgs/mistune/SPKG.rst @@ -1,19 +1,23 @@ -= mistune = +mistune +======= -== Description == +Description +----------- The fastest markdown parser in pure Python -== License == +License +------- BSD License -== Upstream Contact == + +Upstream Contact +---------------- Home Page: https://github.com/lepture/mistune -== Dependencies == +Dependencies +------------ Python, Cython, Pip - - diff --git a/build/pkgs/modular_decomposition/SPKG.txt b/build/pkgs/modular_decomposition/SPKG.rst similarity index 53% rename from build/pkgs/modular_decomposition/SPKG.txt rename to build/pkgs/modular_decomposition/SPKG.rst index 929836f4336..d61cbdd5b9d 100644 --- a/build/pkgs/modular_decomposition/SPKG.txt +++ b/build/pkgs/modular_decomposition/SPKG.rst @@ -1,25 +1,33 @@ -= modular decomposition = -== Description == +modular decomposition +===================== + +Description +----------- This is an implementation of a modular decomposition algorithm. http://www.liafa.jussieu.fr/~fm/ (in french) -== License == +License +------- GPL -== Upstream Contact == + +Upstream Contact +---------------- Fabien de Montgolfier http://www.liafa.jussieu.fr/~fm/ -== Dependencies == +Dependencies +------------ None -== Patches == +Patches +------- None diff --git a/build/pkgs/mpc/SPKG.rst b/build/pkgs/mpc/SPKG.rst new file mode 100644 index 00000000000..78039c62d3e --- /dev/null +++ b/build/pkgs/mpc/SPKG.rst @@ -0,0 +1,43 @@ +MPC +=== + +Description +----------- + +From http://www.multiprecision.org/mpc: GNU MPC is a C library for the +arithmetic of complex numbers with arbitrarily high precision and +correct rounding of the result. It extends the principles of the +IEEE-754 standard for fixed precision real floating point numbers to +complex numbers, providing well-defined semantics for every operation. +At the same time, speed of operation at high precision is a major design +goal. + +License +------- + +LGPLv3+ for the code and GFDLv1.3+ (with no invariant sections) for the +documentation. + + +Upstream Contact +---------------- + +The MPC website is located at http://www.multiprecision.org/mpc . + +The MPC team can be contacted via the MPC mailing list: + + mpc-discuss@lists.gforge.inria.fr + +Dependencies +------------ + +- MPIR +- MPFR + + +Special Update/Build Instructions +--------------------------------- + +- mpc_mul_faster.patch: Patch from Paul Zimmermann to speed up MPC + multiplication (for small precisions) by reducing overhead in MPFR + operations. diff --git a/build/pkgs/mpc/SPKG.txt b/build/pkgs/mpc/SPKG.txt deleted file mode 100644 index 13dcd59e94c..00000000000 --- a/build/pkgs/mpc/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= MPC = - -== Description == - -From http://www.multiprecision.org/mpc: -GNU MPC is a C library for the arithmetic of complex numbers with -arbitrarily high precision and correct rounding of the result. It -extends the principles of the IEEE-754 standard for fixed precision real -floating point numbers to complex numbers, providing well-defined -semantics for every operation. At the same time, speed of operation at -high precision is a major design goal. - -== License == - -LGPLv3+ for the code and GFDLv1.3+ (with no invariant sections) -for the documentation. - -== Upstream Contact == - -The MPC website is located at http://www.multiprecision.org/mpc . - -The MPC team can be contact via the MPC mailing list: - mpc-discuss@lists.gforge.inria.fr - -== Dependencies == - - * MPIR - * MPFR - -== Special Update/Build Instructions == - -* mpc_mul_faster.patch: Patch from Paul Zimmermann to speed up MPC - multiplication (for small precisions) by reducing overhead in MPFR - operations. diff --git a/build/pkgs/mpfi/SPKG.txt b/build/pkgs/mpfi/SPKG.rst similarity index 69% rename from build/pkgs/mpfi/SPKG.txt rename to build/pkgs/mpfi/SPKG.rst index d51bf510171..4e8897812ff 100644 --- a/build/pkgs/mpfi/SPKG.txt +++ b/build/pkgs/mpfi/SPKG.rst @@ -1,6 +1,8 @@ -= MPFI = +MPFI +==== -== Description == +Description +----------- MPFI is a library for interval arithmetic, which is built upon the MPFR multiple precision floating-point arithmetic. @@ -8,31 +10,34 @@ multiple precision floating-point arithmetic. MPFI is intended to be a portable library written in C for arbitrary precision interval arithmetic with intervals represented using MPFR reliable floating-point numbers. It is based on the GNU MP library and -on the MPFR library. The purpose of an arbitrary precision interval +on the MPFR library. The purpose of an arbitrary precision interval arithmetic is on the one hand to get "guaranteed" results, thanks to interval computation, and on the other hand to obtain accurate results, thanks to multiple precision arithmetic. The MPFI library is built upon MPFR in order to benefit from the correct rounding provided, for each -operation or function, by MPFR. Further advantages of using MPFR are -its portability and compliance with the IEEE 754 standard for -floating-point arithmetic. +operation or function, by MPFR. Further advantages of using MPFR are its +portability and compliance with the IEEE 754 standard for floating-point +arithmetic. -== License == +License +------- This version of MPFI is released under the GNU Lesser General Public -License. It is permitted to link MPFI to non-free programs, as long as +License. It is permitted to link MPFI to non-free programs, as long as when distributing them the MPFI source code and a means to re-link with a modified MPFI is provided. -== Upstream Contact == + +Upstream Contact +---------------- The MPFI website is located at http://mpfi.gforge.inria.fr/ The MPFI team can be contacted via the MPFI mailing list: mpfi-users@lists.gforge.inria.fr -== Dependencies == - - * GMP - * MPFR +Dependencies +------------ +- GMP +- MPFR diff --git a/build/pkgs/mpfr/SPKG.rst b/build/pkgs/mpfr/SPKG.rst new file mode 100644 index 00000000000..c2ce702f222 --- /dev/null +++ b/build/pkgs/mpfr/SPKG.rst @@ -0,0 +1,65 @@ +MPFR +==== + +Description +----------- + +The MPFR library is a C library for multiple-precision floating-point +computations with correct rounding. MPFR has continuously been supported +by the INRIA and the current main authors come from the Caramba and AriC +project-teams at Loria (Nancy, France) and LIP (Lyon, France) +respectively; see more on the credit page. MPFR is based on the GMP +multiple-precision library. + +The main goal of MPFR is to provide a library for multiple-precision +floating-point computation which is both efficient and has a +well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 +standard for double-precision floating-point arithmetic (53-bit +significand). + +License +------- + +MPFR is free. It is distributed under the GNU Lesser General Public +License (GNU Lesser GPL), version 3 or later (2.1 or later for MPFR +versions until 2.4.x). The library has been registered in France by the +Agence de Protection des Programmes under the number IDDN FR 001 120020 +00 R P 2000 000 10800, on 15 March 2000. This license guarantees your +freedom to share and change MPFR, to make sure MPFR is free for all its +users. Unlike the ordinary General Public License, the Lesser GPL +enables developers of non-free programs to use MPFR in their programs. +If you have written a new function for MPFR or improved an existing one, +please share your work! + + +Upstream Contact +---------------- + +The MPFR website is located at http://mpfr.org/ + +The MPFR team can be contacted via the MPFR mailing list: mpfr@loria.fr + +Dependencies +------------ + +- GMP/MPIR +- GNU patch + + +Special Update/Build Instructions +--------------------------------- + +- Make sure MPFR's settings of ``CC`` and ``CFLAGS`` still get properly + extracted, + currently from its ``config.log`` in the ``src/`` directory. + +- We should remove the ``configure`` option ``--disable-thread-safe`` + in case + the issues without that have meanwhile been fixed. (Then we should + actually pass ``--enable-thread-safe``.) + +TODO +---- + +- ``--disable-thread-safe`` should be switched to ``--enable-thread-safe``, + need to check that this works on the buildbot machines diff --git a/build/pkgs/mpfr/SPKG.txt b/build/pkgs/mpfr/SPKG.txt deleted file mode 100644 index c2a1bc11fa6..00000000000 --- a/build/pkgs/mpfr/SPKG.txt +++ /dev/null @@ -1,51 +0,0 @@ -= MPFR = - -== Description == - -The MPFR library is a C library for multiple-precision floating-point -computations with correct rounding. MPFR has continuously been supported by -the INRIA and the current main authors come from the Caramba and AriC -project-teams at Loria (Nancy, France) and LIP (Lyon, France) respectively; -see more on the credit page. MPFR is based on the GMP multiple-precision -library. - -The main goal of MPFR is to provide a library for multiple-precision -floating-point computation which is both efficient and has a well-defined -semantics. It copies the good ideas from the ANSI/IEEE-754 standard for -double-precision floating-point arithmetic (53-bit significand). - -== License == - -MPFR is free. It is distributed under the GNU Lesser General Public License -(GNU Lesser GPL), version 3 or later (2.1 or later for MPFR versions until -2.4.x). The library has been registered in France by the Agence de Protection -des Programmes under the number IDDN FR 001 120020 00 R P 2000 000 10800, on -15 March 2000. This license guarantees your freedom to share and change MPFR, -to make sure MPFR is free for all its users. Unlike the ordinary General -Public License, the Lesser GPL enables developers of non-free programs to use -MPFR in their programs. If you have written a new function for MPFR or -improved an existing one, please share your work! - -== Upstream Contact == - -The MPFR website is located at http://mpfr.org/ - -The MPFR team can be contacted via the MPFR mailing list: mpfr@loria.fr - -== Dependencies == - - * GMP/MPIR - * GNU patch - -== Special Update/Build Instructions == - - * Make sure MPFR's settings of `CC` and `CFLAGS` still get properly extracted, - currently from its `config.log` in the `src/` directory. - * We should remove the `configure` option `--disable-thread-safe` in case - the issues without that have meanwhile been fixed. (Then we should - actually pass `--enable-thread-safe`.) - -== TODO == - -* --disable-thread-safe should be switched to --enable-thread-safe, - need to check that this works on the buildbot machines diff --git a/build/pkgs/mpfrcx/SPKG.rst b/build/pkgs/mpfrcx/SPKG.rst new file mode 100644 index 00000000000..8a2c3e649ce --- /dev/null +++ b/build/pkgs/mpfrcx/SPKG.rst @@ -0,0 +1,26 @@ +MPFRCX +====== + +Description +----------- + +Mpfrcx is a library for the arithmetic of univariate polynomials over +arbitrary precision real (Mpfr) or complex (Mpc) numbers, without +control on the rounding. For the time being, only the few functions +needed to implement the floating point approach to complex +multiplication are implemented. On the other hand, these comprise +asymptotically fast multiplication routines such as Toom–Cook and the +FFT. + +License +------- + +MPFRCX is distributed under the Gnu Lesser General Public License, +either version 2.1 of the licence, or (at your option) any later version +(LGPLv2.1+). + + +Upstream Contact +---------------- + +The MPFRCX website is located at http://www.multiprecision.org/mpfrcx . diff --git a/build/pkgs/mpfrcx/SPKG.txt b/build/pkgs/mpfrcx/SPKG.txt deleted file mode 100644 index 0188cfda2b9..00000000000 --- a/build/pkgs/mpfrcx/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= MPFRCX = - -== Description == - -Mpfrcx is a library for the arithmetic of univariate polynomials over arbitrary -precision real (Mpfr) or complex (Mpc) numbers, without control on the -rounding. For the time being, only the few functions needed to implement the -floating point approach to complex multiplication are implemented. On the other -hand, these comprise asymptotically fast multiplication routines such as -Toom–Cook and the FFT. - -== License == - -MPFRCX is distributed under the Gnu Lesser General Public License, either -version 2.1 of the licence, or (at your option) any later version (LGPLv2.1+). - -== Upstream Contact == - -The MPFRCX website is located at http://www.multiprecision.org/mpfrcx . diff --git a/build/pkgs/mpir/SPKG.rst b/build/pkgs/mpir/SPKG.rst new file mode 100644 index 00000000000..02d897ef779 --- /dev/null +++ b/build/pkgs/mpir/SPKG.rst @@ -0,0 +1,42 @@ +MPIR +==== + +Description +----------- + +MPIR is an open source multiprecision integer library derived from +version 5.0.1 of the GMP (GNU Multi Precision) project (which was +licensed LGPL v2+). + +See http://www.mpir.org + +License +------- + +- LGPL V3+ + + +Upstream Contact +---------------- + +- The Google group mpir-devel +- thempirteam@googlemail.com + +Dependencies +------------ + +- iconv +- GNU patch + + +Special Update/Build Instructions +--------------------------------- + +- TODO: +- Perhaps also modify CXXFLAGS (and/or CPPFLAGS). +- We currently don't use anything of GMP's/MPIR's CC setting, and + matching with the current compiler (``$CC``) is perhaps suboptimal. +- Remove some files / directories not needed for Sage from upstream: +- build.vc\* directories (Microsoft Visual C build files) +- 3.0.0-644faf502c56f97d9accd301965fc57d6ec70868 + was created by running the spkg-src script. diff --git a/build/pkgs/mpir/SPKG.txt b/build/pkgs/mpir/SPKG.txt deleted file mode 100644 index c836e975233..00000000000 --- a/build/pkgs/mpir/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= MPIR = - -== Description == - -MPIR is an open source multiprecision integer library derived from -version 5.0.1 of the GMP (GNU Multi Precision) project (which was -licensed LGPL v2+). - -See http://www.mpir.org - -== License == - * LGPL V3+ - -== Upstream Contact == - * The Google group mpir-devel - * thempirteam@googlemail.com - -== Dependencies == - * iconv - * GNU patch - -== Special Update/Build Instructions == - * TODO: - - Perhaps also modify CXXFLAGS (and/or CPPFLAGS). - - We currently don't use anything of GMP's/MPIR's CC setting, and matching - with the current compiler (`$CC`) is perhaps suboptimal. - * Remove some files / directories not needed for Sage from upstream: - - build.vc* directories (Microsoft Visual C build files) - * 3.0.0-644faf502c56f97d9accd301965fc57d6ec70868 - was created by running the spkg-src script. diff --git a/build/pkgs/mpmath/SPKG.rst b/build/pkgs/mpmath/SPKG.rst new file mode 100644 index 00000000000..a947501e4de --- /dev/null +++ b/build/pkgs/mpmath/SPKG.rst @@ -0,0 +1,28 @@ +mpmath +====== + +Description +----------- + +Mpmath is a pure-Python library for multiprecision floating-point +arithmetic. It provides an extensive set of transcendental functions, +unlimited exponent sizes, complex numbers, interval arithmetic, +numerical integration and differentiation, root-finding, linear algebra, +and much more. Almost any calculation can be performed just as well at +10-digit or 1000-digit precision, and in many cases mpmath implements +asymptotically fast algorithms that scale well for extremely high +precision work. If available, mpmath will (optionally) use gmpy to speed +up high precision operations. + + +Upstream Contact +---------------- + +- Author: Fredrik Johansson +- Email: fredrik.johansson@gmail.com +- Website: https://github.com/fredrik-johansson/mpmath/ + +Dependencies +------------ + +- Python diff --git a/build/pkgs/mpmath/SPKG.txt b/build/pkgs/mpmath/SPKG.txt deleted file mode 100644 index e6d841c6097..00000000000 --- a/build/pkgs/mpmath/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= mpmath = - -== Description == - -Mpmath is a pure-Python library for multiprecision floating-point arithmetic. It provides an extensive set of transcendental functions, unlimited exponent sizes, complex numbers, interval arithmetic, numerical integration and differentiation, root-finding, linear algebra, and much more. Almost any calculation can be performed just as well at 10-digit or 1000-digit precision, and in many cases mpmath implements asymptotically fast algorithms that scale well for extremely high precision work. If available, mpmath will (optionally) use gmpy to speed up high precision operations. - -== Upstream Contact == - - * Author: Fredrik Johansson - * Email: fredrik.johansson@gmail.com - * Website: https://github.com/fredrik-johansson/mpmath/ - -== Dependencies == - - * Python diff --git a/build/pkgs/nauty/SPKG.rst b/build/pkgs/nauty/SPKG.rst new file mode 100644 index 00000000000..76e42233452 --- /dev/null +++ b/build/pkgs/nauty/SPKG.rst @@ -0,0 +1,37 @@ +Nauty +===== + +Description +----------- + +Nauty has various tools for finding the automorphism group of a graph, +generating non-isomorphic graphs with certain properties, etc. + +License +------- + +Since version 2.6, nauty license is GPL-compatible, see + +http://users.cecs.anu.edu.au/~bdm/nauty/COPYRIGHT.txt + +(a copy of this file, called COPYRIGHT, is also present in the tarball) + + +Special Packaging Instruction +----------------------------- + +Upstream distribute tarball named nauty${version}.tar.gz. We cannot deal +with that so rename it nauty-${version}.tar.gz (notice the "-") without +any changes. + + +Upstream Contact +---------------- + +Brendan D. McKay Computer Science Department Australian National +University bdm@cs.anu.edu.au + +Adolfo Piperno Dipartimento di Informatica Sapienza - Università di Roma +piperno@di.uniroma1.it + +See http://cs.anu.edu.au/~bdm/nauty/ Or http://pallini.di.uniroma1.it/ diff --git a/build/pkgs/nauty/SPKG.txt b/build/pkgs/nauty/SPKG.txt deleted file mode 100644 index d471d16a4aa..00000000000 --- a/build/pkgs/nauty/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= Nauty = - -== Description == - -Nauty has various tools for finding the automorphism group of a graph, -generating non-isomorphic graphs with certain properties, etc. - -== License == - -Since version 2.6, nauty license is GPL-compatible, see - -http://users.cecs.anu.edu.au/~bdm/nauty/COPYRIGHT.txt - -(a copy of this file, called COPYRIGHT, is also present in the tarball) - -== Special Packaging Instruction == - -Upstream distribute tarball named nauty${version}.tar.gz. We cannot -deal with that so rename it nauty-${version}.tar.gz (notice the "-") -without any changes. - -== Upstream Contact == - -Brendan D. McKay -Computer Science Department -Australian National University -bdm@cs.anu.edu.au - -Adolfo Piperno -Dipartimento di Informatica -Sapienza - Università di Roma -piperno@di.uniroma1.it - -See http://cs.anu.edu.au/~bdm/nauty/ -Or http://pallini.di.uniroma1.it/ diff --git a/build/pkgs/nbconvert/SPKG.txt b/build/pkgs/nbconvert/SPKG.rst similarity index 72% rename from build/pkgs/nbconvert/SPKG.txt rename to build/pkgs/nbconvert/SPKG.rst index 362c21c9e5f..b3f9dbdb44c 100644 --- a/build/pkgs/nbconvert/SPKG.txt +++ b/build/pkgs/nbconvert/SPKG.rst @@ -1,6 +1,8 @@ -= nbconvert = +nbconvert +========= -== Description == +Description +----------- Converting Jupyter Notebooks diff --git a/build/pkgs/nbformat/SPKG.txt b/build/pkgs/nbformat/SPKG.rst similarity index 78% rename from build/pkgs/nbformat/SPKG.txt rename to build/pkgs/nbformat/SPKG.rst index a6c91aa1966..de42d912de6 100644 --- a/build/pkgs/nbformat/SPKG.txt +++ b/build/pkgs/nbformat/SPKG.rst @@ -1,6 +1,8 @@ -= nbformat = +nbformat +======== -== Description == +Description +----------- The Jupyter Notebook format diff --git a/build/pkgs/ncurses/SPKG.rst b/build/pkgs/ncurses/SPKG.rst new file mode 100644 index 00000000000..be8e3bb5b0b --- /dev/null +++ b/build/pkgs/ncurses/SPKG.rst @@ -0,0 +1,49 @@ +Ncurses +======= + +Description +----------- + +Ncurses (new curses, pronounced "enn-curses") started as a freely +distributable "clone" of System V Release 4.0 (SVr4) curses. It has +outgrown the "clone" description, and now contains many features which +are not in SVr4 curses. Curses is a pun on the term "cursor +optimization". It is a library of functions that manage an application's +display on character-cell terminals (e.g., VT100). + +The name "ncurses" was first used as the name of the curses library in +Pavel Curtis's pcurses, dated 1982. It was apparently developed on a BSD +4.4 system, at Cornell. Parts of pcurses are readily identifiable in +ncurses, including the basics for the terminfo compiler (named compile +in that package): + +- the Caps, used to define the terminfo capabilities +- awk scripts MKcaptab.awk, MKnames.awk +- the library modules used for the terminfo compiler. + +Besides ncurses, parts of pcurses still survive in 2010, in recognizable +form in Solaris. + +Website: http://invisible-island.net/ncurses + +License +------- + +- MIT-style + + +Upstream Contact +---------------- + +- bug-ncurses@gnu.org + +Dependencies +------------ + +None + + +Special Update/Build Instructions +--------------------------------- + +None diff --git a/build/pkgs/ncurses/SPKG.txt b/build/pkgs/ncurses/SPKG.txt deleted file mode 100644 index 9b8f450a1c7..00000000000 --- a/build/pkgs/ncurses/SPKG.txt +++ /dev/null @@ -1,41 +0,0 @@ -= Ncurses = - -== Description == - -Ncurses (new curses, pronounced "enn-curses") started as a freely -distributable "clone" of System V Release 4.0 (SVr4) curses. It has -outgrown the "clone" description, and now contains many features which -are not in SVr4 curses. Curses is a pun on the term "cursor -optimization". It is a library of functions that manage an -application's display on character-cell terminals (e.g., VT100). - -The name "ncurses" was first used as the name of the curses library in -Pavel Curtis's pcurses, dated 1982. It was apparently developed on a -BSD 4.4 system, at Cornell. Parts of pcurses are readily identifiable -in ncurses, including the basics for the terminfo compiler (named -compile in that package): - - * the Caps, used to define the terminfo capabilities - * awk scripts MKcaptab.awk, MKnames.awk - * the library modules used for the terminfo compiler. - -Besides ncurses, parts of pcurses still survive in 2010, in -recognizable form in Solaris. - -Website: http://invisible-island.net/ncurses - -== License == - - * MIT-style - -== Upstream Contact == - - * bug-ncurses@gnu.org - -== Dependencies == - -None - -== Special Update/Build Instructions == - -None diff --git a/build/pkgs/networkx/SPKG.rst b/build/pkgs/networkx/SPKG.rst new file mode 100644 index 00000000000..74bfdfe037d --- /dev/null +++ b/build/pkgs/networkx/SPKG.rst @@ -0,0 +1,19 @@ +NetworkX +======== + +Description +----------- + +NetworkX (NX) is a Python package for the creation, manipulation, and +study of the structure, dynamics, and functions of complex networks. + +License +------- + +BSD + + +Upstream Contact +---------------- + +https://networkx.github.io/ diff --git a/build/pkgs/networkx/SPKG.txt b/build/pkgs/networkx/SPKG.txt deleted file mode 100644 index ca598bbad47..00000000000 --- a/build/pkgs/networkx/SPKG.txt +++ /dev/null @@ -1,13 +0,0 @@ -= NetworkX = - -== Description == - -NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. - -== License == - -BSD - -== Upstream Contact == - -https://networkx.github.io/ diff --git a/build/pkgs/ninja_build/SPKG.rst b/build/pkgs/ninja_build/SPKG.rst new file mode 100644 index 00000000000..a0b88ecf63b --- /dev/null +++ b/build/pkgs/ninja_build/SPKG.rst @@ -0,0 +1,23 @@ +ninja_build +=========== + +Description +----------- + +Ninja is a small build system with a focus on speed. + +License +------- + +Apache License 2.0 + + +Upstream Contact +---------------- + +https://ninja-build.org/ + +Dependencies +------------ + +None diff --git a/build/pkgs/ninja_build/SPKG.txt b/build/pkgs/ninja_build/SPKG.txt deleted file mode 100644 index caa6b5698a9..00000000000 --- a/build/pkgs/ninja_build/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= ninja_build = - -== Description == - -Ninja is a small build system with a focus on speed. - -== License == - -Apache License 2.0 - -== Upstream Contact == - -https://ninja-build.org/ - -== Dependencies == - -None diff --git a/build/pkgs/normaliz/SPKG.rst b/build/pkgs/normaliz/SPKG.rst new file mode 100644 index 00000000000..10d945bf913 --- /dev/null +++ b/build/pkgs/normaliz/SPKG.rst @@ -0,0 +1,39 @@ +normaliz +======== + +Description +----------- + +Normaliz is a tool for computations in affine monoids, vector +configurations, lattice polytopes, and rational cones. + +For more details see http://www.mathematik.uni-osnabrueck.de/normaliz/ + +License +------- + +- GPL v3 + + +Upstream Contact +---------------- + +- normaliz@uos.de +- Winfried Bruns +- Christof Söger +- see also https://www.normaliz.uni-osnabrueck.de/home/contact/ + + and https://github.com/Normaliz + +Dependencies +------------ + +- GMP/MPIR +- boost + + +Special Update/Build Instructions +--------------------------------- + +- The spkg currently disables features that require packages SCIP and + CoCoA, for which we don't have packages (yet). diff --git a/build/pkgs/normaliz/SPKG.txt b/build/pkgs/normaliz/SPKG.txt deleted file mode 100644 index e7fbd64b373..00000000000 --- a/build/pkgs/normaliz/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= normaliz = - -== Description == - -Normaliz is a tool for computations in affine monoids, vector configurations, lattice polytopes, and rational cones. - -For more details see http://www.mathematik.uni-osnabrueck.de/normaliz/ - -== License == - - * GPL v3 - -== Upstream Contact == - - * normaliz@uos.de - * Winfried Bruns - * Christof Söger - * see also https://www.normaliz.uni-osnabrueck.de/home/contact/ - and https://github.com/Normaliz - -== Dependencies == - - * GMP/MPIR - * boost - -== Special Update/Build Instructions == - - * The spkg currently disables features that require packages SCIP and - CoCoA, for which we don't have packages (yet). diff --git a/build/pkgs/nose/SPKG.rst b/build/pkgs/nose/SPKG.rst new file mode 100644 index 00000000000..b66ffd2a980 --- /dev/null +++ b/build/pkgs/nose/SPKG.rst @@ -0,0 +1,34 @@ +nose +==== + +Description +----------- + +nose extends the test loading and running features of unittest, making +it easier to write, find and run tests. + +License +------- + +GNU LGPL + + +Upstream Contact +---------------- + +Author: Jason Pellerin Home Page: http://readthedocs.org/docs/nose/ + + see also https://github.com/nose-devs/nose + +Dependencies +------------ + +- setuptools / distribute +- Python +- GNU patch (shipped with Sage) + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/nose/SPKG.txt b/build/pkgs/nose/SPKG.txt deleted file mode 100644 index e978029b47a..00000000000 --- a/build/pkgs/nose/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= nose = - -== Description == - -nose extends the test loading and running features of unittest, making -it easier to write, find and run tests. - -== License == - -GNU LGPL - -== Upstream Contact == - -Author: Jason Pellerin -Home Page: http://readthedocs.org/docs/nose/ - see also https://github.com/nose-devs/nose - -== Dependencies == - - * setuptools / distribute - * Python - * GNU patch (shipped with Sage) - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/notebook/SPKG.txt b/build/pkgs/notebook/SPKG.rst similarity index 68% rename from build/pkgs/notebook/SPKG.txt rename to build/pkgs/notebook/SPKG.rst index af2253acd9f..92efe65018a 100644 --- a/build/pkgs/notebook/SPKG.txt +++ b/build/pkgs/notebook/SPKG.rst @@ -1,6 +1,8 @@ -= notebook = +notebook +======== -== Description == +Description +----------- The Jupyter HTML notebook is a web-based notebook environment for interactive computing. diff --git a/build/pkgs/notedown/SPKG.rst b/build/pkgs/notedown/SPKG.rst new file mode 100644 index 00000000000..793a1d1ef24 --- /dev/null +++ b/build/pkgs/notedown/SPKG.rst @@ -0,0 +1,28 @@ +notedown +======== + +Description +----------- + +Notedown is a simple tool to create IPython notebooks from markdown. + +License +------- + +BSD 2-Clause License + + +Upstream Contact +---------------- + +Author: Aaron O'Leary Home page: https://github.com/aaren/notedown + +Dependencies +------------ + +- Python +- setuptools +- nbformat +- nbconvert +- six +- pandoc_attributes diff --git a/build/pkgs/notedown/SPKG.txt b/build/pkgs/notedown/SPKG.txt deleted file mode 100644 index f22216f0f51..00000000000 --- a/build/pkgs/notedown/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= notedown = - -== Description == - -Notedown is a simple tool to create IPython notebooks from markdown. - -== License == - -BSD 2-Clause License - -== Upstream Contact == - -Author: Aaron O'Leary -Home page: https://github.com/aaren/notedown - -== Dependencies == - -* Python -* setuptools -* nbformat -* nbconvert -* six -* pandoc_attributes diff --git a/build/pkgs/ntl/SPKG.rst b/build/pkgs/ntl/SPKG.rst new file mode 100644 index 00000000000..cc1ac43b9dd --- /dev/null +++ b/build/pkgs/ntl/SPKG.rst @@ -0,0 +1,35 @@ +NTL +=== + +Description +----------- + +NTL is a high-performance, portable C++ library providing data +structures and algorithms for manipulating signed, arbitrary length +integers, and for vectors, matrices, and polynomials over the integers +and over finite fields. + +Website: http://www.shoup.net/ntl/ + +License +------- + +- GNU LGPLv2.1+ + + +Upstream Contact +---------------- + +- Victor Shoup - for contact info see http://www.shoup.net/ + +Dependencies +------------ + +- gmp +- gf2x + + +Special Update/Build Instructions +--------------------------------- + +- None diff --git a/build/pkgs/ntl/SPKG.txt b/build/pkgs/ntl/SPKG.txt deleted file mode 100644 index 49e02e2a8a1..00000000000 --- a/build/pkgs/ntl/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= NTL = - -== Description == -NTL is a high-performance, portable C++ library providing data structures and -algorithms for manipulating signed, arbitrary length integers, and for vectors, -matrices, and polynomials over the integers and over finite fields. - -Website: http://www.shoup.net/ntl/ - -== License == - * GNU LGPLv2.1+ - -== Upstream Contact == - * Victor Shoup - for contact info see http://www.shoup.net/ - -== Dependencies == - * gmp - * gf2x - -== Special Update/Build Instructions == - * None diff --git a/build/pkgs/numpy/SPKG.rst b/build/pkgs/numpy/SPKG.rst new file mode 100644 index 00000000000..a70606eb027 --- /dev/null +++ b/build/pkgs/numpy/SPKG.rst @@ -0,0 +1,36 @@ +numpy +===== + +Description +----------- + +This package adds numerical linear algebra and other numerical computing +capabilities to python. + + +Upstream Contact +---------------- + +- Travis Oliphant +- Fernando Perez +- Brian Granger + +Dependencies +------------ + +- GNU patch +- Python +- Lapack +- Blas +- Atlas +- Fortran + + +Special Update/Build Instructions +--------------------------------- + +- Scipy uses numpy's distutils to control its compilation of fortran + code. + + Whenever numpy is updated it is necessary to make sure that scipy + still builds ok. diff --git a/build/pkgs/numpy/SPKG.txt b/build/pkgs/numpy/SPKG.txt deleted file mode 100644 index c7da9b2fdce..00000000000 --- a/build/pkgs/numpy/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= numpy = - -== Description == - -This package adds numerical linear algebra and other numerical computing -capabilities to python. - -== Upstream Contact == - * Travis Oliphant - * Fernando Perez - * Brian Granger - -== Dependencies == - * GNU patch - * Python - * Lapack - * Blas - * Atlas - * Fortran - -== Special Update/Build Instructions == - * Scipy uses numpy's distutils to control its compilation of fortran code. - Whenever numpy is updated it is necessary to make sure that scipy still builds ok. - - - - diff --git a/build/pkgs/openblas/SPKG.rst b/build/pkgs/openblas/SPKG.rst new file mode 100644 index 00000000000..d33fde7fb74 --- /dev/null +++ b/build/pkgs/openblas/SPKG.rst @@ -0,0 +1,33 @@ +OpenBLAS +======== + +Description +----------- + +OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD +version. + +License +------- + +3-clause BSD license + + +SPKG Repository +--------------- + +GitHub page: https://github.com/xianyi/OpenBLAS + +Releases: https://github.com/xianyi/OpenBLAS/releases + + +Upstream Contact +---------------- + +- OpenBLAS users mailing list: + + https://groups.google.com/forum/#!forum/openblas-users + +- OpenBLAS developers mailing list: + + https://groups.google.com/forum/#!forum/openblas-dev diff --git a/build/pkgs/openblas/SPKG.txt b/build/pkgs/openblas/SPKG.txt deleted file mode 100644 index b152a3007ec..00000000000 --- a/build/pkgs/openblas/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= OpenBLAS = - -== Description == - -OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. - -== License == - -3-clause BSD license - -== SPKG Repository == - -GitHub page: https://github.com/xianyi/OpenBLAS - -Releases: https://github.com/xianyi/OpenBLAS/releases - -== Upstream Contact == - -* OpenBLAS users mailing list: - https://groups.google.com/forum/#!forum/openblas-users - -* OpenBLAS developers mailing list: - https://groups.google.com/forum/#!forum/openblas-dev diff --git a/build/pkgs/openssl/SPKG.rst b/build/pkgs/openssl/SPKG.rst new file mode 100644 index 00000000000..06dbe35255a --- /dev/null +++ b/build/pkgs/openssl/SPKG.rst @@ -0,0 +1,28 @@ +OpenSSL +======= + +Description +----------- + +From wikipedia: OpenSSL is an open source implementation of the SSL and +TLS protocols. The core library (written in the C programming language) +implements the basic cryptographic functions and provides various +utility functions. Wrappers allowing the use of the OpenSSL library in a +variety of computer languages are available. + +License +------- + +- Custom GPL-incompatible license + + +Upstream Contact +---------------- + +- http://openssl.org/ +- http://openssl.org/support/community.html + +Patches +~~~~~~~ + +- src/config: patched to fix a problem on Solaris. diff --git a/build/pkgs/openssl/SPKG.txt b/build/pkgs/openssl/SPKG.txt deleted file mode 100644 index 0711b536f7b..00000000000 --- a/build/pkgs/openssl/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= OpenSSL = - -== Description == - -From wikipedia: OpenSSL is an open source implementation of the SSL -and TLS protocols. The core library (written in the C programming -language) implements the basic cryptographic functions and provides -various utility functions. Wrappers allowing the use of the OpenSSL -library in a variety of computer languages are available. - -== License == - - * Custom GPL-incompatible license - -== Upstream Contact == - - * http://openssl.org/ - * http://openssl.org/support/community.html - -=== Patches === - - * src/config: patched to fix a problem on Solaris. - diff --git a/build/pkgs/p_group_cohomology/SPKG.rst b/build/pkgs/p_group_cohomology/SPKG.rst new file mode 100644 index 00000000000..0351bbe752b --- /dev/null +++ b/build/pkgs/p_group_cohomology/SPKG.rst @@ -0,0 +1,115 @@ +p_group_cohomology +================== + +Description +----------- + +Modular Cohomology Rings of Finite Groups + +The package is located at http://users.fmi.uni-jena.de/cohomology/, +that's to say the tarball p_group_cohomology-x.y.tar.xz can be found +there and the documentation of the package is provided at +http://users.fmi.uni-jena.de/cohomology/documentation/ + +License +------- + +Copyright (C) 2018 Simon A. King Copyright (C) +2011 Simon A. King Copyright (C) 2009 Simon A. +King and + + David J. Green + +Distributed under the terms of the GNU General Public License (GPL), +version 2 or later (at your choice). + + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +The full text of the GPL is available at: + + http://www.gnu.org/licenses/ + +The package includes a data base of cohomology rings of the groups of +order 64 and provides access to a data base of cohomology rings of the +groups of order 128 and 243, located at + + http://cohomology.uni-jena.de/db/ + +These data bases are distributed under the Creative Commons +Attribution-Share Alike 3.0 License. The full text of this licence is +available at + + http://creativecommons.org/licenses/by-sa/3.0/ + + +SPKG Maintainers +---------------- + +Simon A. King + + +Upstream Contact +---------------- + +Simon A. King David J. Green + + +Acknowledgements +---------------- + +The development of the initial version of this SPKG was funded by the +German Science Foundation, DFG project GR 1585/4.1, and was accomplished +at the Friedrich Schiller University Jena. + +Since version 1.0.1, the further work on this SPKG was funded by Marie +Curie grant MTKD-CT-2006-042685 and was pursued at the National +University of Ireland, Galway. Since Novermber 2010, it is moved back to +Jena. + +We thank William Stein for giving us access to various computers on +which we could build test the SPKG and on which some huge computations +could be completed, and acknowledge the support by National Science +Foundation Grant No. DMS-0821725. + +We thank Mathieu Dutour Sikirić for hints on how to use GAP more +efficiently. + +We owe Peter Symonds the idea of using the Poincaré series in a rather +efficient completeness criterion. + +We are greatful to John Palmieri for his help on making +p_group_cohomology work with python-3. + +Dependencies +------------ + +- The SharedMeatAxe needs to be installed, as a build time dependency. + + This can be met by installing the meataxe spkg + +Testing +------- + +Our package provides a very short test suite for David Green's routines +for the computation of minimal projective resolutions. The majority of +this package's tests is formed by doc tests in the Cython code. In fact, +any class, method and function is covered by tests. + +Note that internet access is required for these tests, as it is +attempted to download cohomology rings from a public data base in the +web. + +The script ``spkg-check`` calls ``sage -t --force_lib`` on the files +in ``pGroupCohomology``. + +Documentation +------------- + +The documentation of this package is automatically built, if the +environment variable SAGE_SPKG_INSTALL_DOCS is yes (do "export +SAGE_SPKG_INSTALL_DOCS=yes" on the command line before installation). +The documents are put into +SAGE_ROOT/local/share/doc/p_group_cohomology/. diff --git a/build/pkgs/p_group_cohomology/SPKG.txt b/build/pkgs/p_group_cohomology/SPKG.txt deleted file mode 100644 index 42bd0ccc36d..00000000000 --- a/build/pkgs/p_group_cohomology/SPKG.txt +++ /dev/null @@ -1,98 +0,0 @@ -= p_group_cohomology = - -== Description == - -Modular Cohomology Rings of Finite Groups - -The package is located at http://users.fmi.uni-jena.de/cohomology/, -that's to say the tarball p_group_cohomology-x.y.tar.xz can be found -there and the documentation of the package is provided at -http://users.fmi.uni-jena.de/cohomology/documentation/ - -== License == - -Copyright (C) 2018 Simon A. King -Copyright (C) 2011 Simon A. King -Copyright (C) 2009 Simon A. King and - David J. Green - -Distributed under the terms of the GNU General Public License (GPL), -version 2 or later (at your choice). - - This code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -The full text of the GPL is available at: - - http://www.gnu.org/licenses/ - -The package includes a data base of cohomology rings of the groups of -order 64 and provides access to a data base of cohomology rings of the -groups of order 128 and 243, located at - http://cohomology.uni-jena.de/db/ -These data bases are distributed under the Creative Commons -Attribution-Share Alike 3.0 License. The full text of this licence is -available at - http://creativecommons.org/licenses/by-sa/3.0/ - -== SPKG Maintainers == - -Simon A. King - -== Upstream Contact == - -Simon A. King -David J. Green - -== Acknowledgements == - -The development of the initial version of this SPKG was funded by -the German Science Foundation, DFG project GR 1585/4.1, and was -accomplished at the Friedrich Schiller University Jena. - -Since version 1.0.1, the further work on this SPKG was funded -by Marie Curie grant MTKD-CT-2006-042685 and was pursued at -the National University of Ireland, Galway. Since Novermber 2010, -it is moved back to Jena. - -We thank William Stein for giving us access to various computers -on which we could build test the SPKG and on which some huge computations -could be completed, and acknowledge the support by National Science -Foundation Grant No. DMS-0821725. - -We thank Mathieu Dutour Sikirić for hints on how to use GAP -more efficiently. - -We owe Peter Symonds the idea of using the Poincaré series in a -rather efficient completeness criterion. - -We are greatful to John Palmieri for his help on making p_group_cohomology -work with python-3. - -== Dependencies == - -- The SharedMeatAxe needs to be installed, as a build time dependency. - This can be met by installing the meataxe spkg - -== Testing == - -Our package provides a very short test suite for David Green's routines -for the computation of minimal projective resolutions. The majority of -this package's tests is formed by doc tests in the Cython code. In -fact, any class, method and function is covered by tests. - -Note that internet access is required for these tests, as it is attempted to -download cohomology rings from a public data base in the web. - -The script ``spkg-check`` calls `sage -t --force_lib` on the files -in `pGroupCohomology`. - -== Documentation == - -The documentation of this package is automatically built, if the environment -variable SAGE_SPKG_INSTALL_DOCS is yes (do "export SAGE_SPKG_INSTALL_DOCS=yes" -on the command line before installation). The documents are put into -SAGE_ROOT/local/share/doc/p_group_cohomology/. - diff --git a/build/pkgs/packaging/SPKG.rst b/build/pkgs/packaging/SPKG.rst new file mode 100644 index 00000000000..ad493c1202e --- /dev/null +++ b/build/pkgs/packaging/SPKG.rst @@ -0,0 +1,7 @@ +packaging +========= + +Description +----------- + +Core utilities for Python packages diff --git a/build/pkgs/packaging/SPKG.txt b/build/pkgs/packaging/SPKG.txt deleted file mode 100644 index 617de3d95a5..00000000000 --- a/build/pkgs/packaging/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= packaging = - -== Description == - -Core utilities for Python packages diff --git a/build/pkgs/palp/SPKG.rst b/build/pkgs/palp/SPKG.rst new file mode 100644 index 00000000000..d9304000e3b --- /dev/null +++ b/build/pkgs/palp/SPKG.rst @@ -0,0 +1,42 @@ +PALP +==== + +Description +----------- + +A Package for Analyzing Lattice Polytopes (PALP) is a set of C programs +for calculations with lattice polytopes and applications to toric +geometry. + +It contains routines for vertex and facet enumeration, computation of +incidences and symmetries, as well as completion of the set of lattice +points in the convex hull of a given set of points. In addition, there +are procedures specialised to reflexive polytopes such as the +enumeration of reflexive subpolytopes, and applications to toric +geometry and string theory, like the computation of Hodge data and +fibration structures for toric Calabi-Yau varieties. The package is well +tested and optimised in speed as it was used for time consuming tasks +such as the classification of reflexive polyhedra in 4 dimensions and +the creation and manipulation of very large lists of 5-dimensional +polyhedra. + +While originally intended for low-dimensional applications, the +algorithms work in any dimension and our key routine for vertex and +facet enumeration compares well with existing packages. + +License +------- + +- When released, GPL 2 was in force. +- There is a link to a web page, which now points to GPL 3, but would + have pointed to GPL 2 at the time the package was released. + +- Therefore one can deduce the authors were happy for this to be + released under GPL 2 or a later version. + + +Upstream Contact +---------------- + +- Author: Harald Skarke (skarke@maths.ox.ac.uk) +- Home page: http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html diff --git a/build/pkgs/palp/SPKG.txt b/build/pkgs/palp/SPKG.txt deleted file mode 100644 index 1add1810ed5..00000000000 --- a/build/pkgs/palp/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= PALP = - -== Description == - -A Package for Analyzing Lattice Polytopes (PALP) is a set of C -programs for calculations with lattice polytopes and applications to -toric geometry. - -It contains routines for vertex and facet enumeration, computation of -incidences and symmetries, as well as completion of the set of lattice -points in the convex hull of a given set of points. In addition, there -are procedures specialised to reflexive polytopes such as the -enumeration of reflexive subpolytopes, and applications to toric -geometry and string theory, like the computation of Hodge data and -fibration structures for toric Calabi-Yau varieties. The package is -well tested and optimised in speed as it was used for time consuming -tasks such as the classification of reflexive polyhedra in 4 -dimensions and the creation and manipulation of very large lists of -5-dimensional polyhedra. - -While originally intended for low-dimensional applications, the -algorithms work in any dimension and our key routine for vertex and -facet enumeration compares well with existing packages. - -== License == - - * When released, GPL 2 was in force. - * There is a link to a web page, which now points to GPL 3, but would - have pointed to GPL 2 at the time the package was released. - * Therefore one can deduce the authors were happy for this to be - released under GPL 2 or a later version. - -== Upstream Contact == - - * Author: Harald Skarke (skarke@maths.ox.ac.uk) - * Home page: http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html diff --git a/build/pkgs/pandoc/SPKG.rst b/build/pkgs/pandoc/SPKG.rst new file mode 100644 index 00000000000..7ef13ccebf2 --- /dev/null +++ b/build/pkgs/pandoc/SPKG.rst @@ -0,0 +1,10 @@ +Pandoc +====== + +Description +----------- + +This script package represents the document converter pandoc. + +We do not have an SPKG for it. The purpose of this script package is to +associate system package lists with it. diff --git a/build/pkgs/pandoc/SPKG.txt b/build/pkgs/pandoc/SPKG.txt deleted file mode 100644 index 72e13739e28..00000000000 --- a/build/pkgs/pandoc/SPKG.txt +++ /dev/null @@ -1,8 +0,0 @@ -= Pandoc = - -== Description == - -This script package represents the document converter pandoc. - -We do not have an SPKG for it. The purpose of this script -package is to associate system package lists with it. diff --git a/build/pkgs/pandoc_attributes/SPKG.rst b/build/pkgs/pandoc_attributes/SPKG.rst new file mode 100644 index 00000000000..a7922004186 --- /dev/null +++ b/build/pkgs/pandoc_attributes/SPKG.rst @@ -0,0 +1,35 @@ +pandoc_attributes +================= + +Description +----------- + +This is a simple parser / emitter for pandoc block attributes, intended +for use with pandocfilters. + +License +------- + +BSD 2-Clause License + + +Upstream Contact +---------------- + +- Author: Aaron O'Leary +- Home page: https://github.com/aaren/pandoc-attributes + +Dependencies +------------ + +- Python +- setuptools +- pandocfilters + + +Special Update/Build Instructions +--------------------------------- + +There are no release numbers, hence find the latest commit, download +https://github.com/aaren/pandoc-attributes/archive/${COMMIT}.zip and +rename it pandoc_attributes-${COMMIT:0:8}.zip diff --git a/build/pkgs/pandoc_attributes/SPKG.txt b/build/pkgs/pandoc_attributes/SPKG.txt deleted file mode 100644 index a06869d52f6..00000000000 --- a/build/pkgs/pandoc_attributes/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= pandoc_attributes = - -== Description == - -This is a simple parser / emitter for pandoc block attributes, intended -for use with pandocfilters. - -== License == - -BSD 2-Clause License - -== Upstream Contact == - -Author: Aaron O'Leary -Home page: https://github.com/aaren/pandoc-attributes - -== Dependencies == - -* Python -* setuptools -* pandocfilters - -== Special Update/Build Instructions == - -There are no release numbers, hence find the latest commit, download -https://github.com/aaren/pandoc-attributes/archive/${COMMIT}.zip and -rename it pandoc_attributes-${COMMIT:0:8}.zip - diff --git a/build/pkgs/pandocfilters/SPKG.rst b/build/pkgs/pandocfilters/SPKG.rst new file mode 100644 index 00000000000..cc87256299d --- /dev/null +++ b/build/pkgs/pandocfilters/SPKG.rst @@ -0,0 +1,30 @@ +pandocfilters +============= + +Description +----------- + +A python module for writing pandoc filters. + +License +------- + +BSD 3-Clause License + + +Upstream Contact +---------------- + +Author: John MacFarlane Home page: https://github.com/jgm/pandocfilters + +Dependencies +------------ + +- Python + + +Special Update/Build Instructions +--------------------------------- + +Download the last release from +https://pypi.python.org/pypi/pandocfilters diff --git a/build/pkgs/pandocfilters/SPKG.txt b/build/pkgs/pandocfilters/SPKG.txt deleted file mode 100644 index d35dfd575e1..00000000000 --- a/build/pkgs/pandocfilters/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= pandocfilters = - -== Description == - -A python module for writing pandoc filters. - -== License == - -BSD 3-Clause License - -== Upstream Contact == - -Author: John MacFarlane -Home page: https://github.com/jgm/pandocfilters - -== Dependencies == - -* Python - -== Special Update/Build Instructions == - -Download the last release from -https://pypi.python.org/pypi/pandocfilters diff --git a/build/pkgs/pari/SPKG.rst b/build/pkgs/pari/SPKG.rst new file mode 100644 index 00000000000..ef8a1549220 --- /dev/null +++ b/build/pkgs/pari/SPKG.rst @@ -0,0 +1,45 @@ +pari +==== + +Description +----------- + +PARI/GP is a widely used computer algebra system designed for fast +computations in number theory (factorizations, algebraic number theory, +elliptic curves...), but also contains a large number of other useful +functions to compute with mathematical entities such as matrices, +polynomials, power series, algebraic numbers etc., and a lot of +transcendental functions. PARI is also available as a C library to allow +for faster computations. + +Originally developed by Henri Cohen and his co-workers (Université +Bordeaux I, France), PARI is now under the GPL and maintained by Karim +Belabas with the help of many volunteer contributors. + +License +------- + +GPL version 2+ + + +Upstream Contact +---------------- + +- http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Perl +- MPIR or GMP +- Readline +- GNU patch (shipped with Sage) + + +Special Update/Build Instructions +--------------------------------- + +See patches/README.txt for a list of patches. + +The current upstream tarball was created from the PARI git repository by +running "make snapshot". diff --git a/build/pkgs/pari/SPKG.txt b/build/pkgs/pari/SPKG.txt deleted file mode 100644 index a83829520db..00000000000 --- a/build/pkgs/pari/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= pari = - -== Description == - -PARI/GP is a widely used computer algebra system designed for fast -computations in number theory (factorizations, algebraic number -theory, elliptic curves...), but also contains a large number of other -useful functions to compute with mathematical entities such as -matrices, polynomials, power series, algebraic numbers etc., and a lot -of transcendental functions. PARI is also available as a C library to -allow for faster computations. - -Originally developed by Henri Cohen and his co-workers (Université -Bordeaux I, France), PARI is now under the GPL and maintained by Karim -Belabas with the help of many volunteer contributors. - -== License == - -GPL version 2+ - -== Upstream Contact == - * http://pari.math.u-bordeaux.fr/ - -== Dependencies == - * Perl - * MPIR or GMP - * Readline - * GNU patch (shipped with Sage) - -== Special Update/Build Instructions == - -See patches/README.txt for a list of patches. - -The current upstream tarball was created from the PARI git repository -by running "make snapshot". diff --git a/build/pkgs/pari_elldata/SPKG.rst b/build/pkgs/pari_elldata/SPKG.rst new file mode 100644 index 00000000000..6d487573f9b --- /dev/null +++ b/build/pkgs/pari_elldata/SPKG.rst @@ -0,0 +1,25 @@ +pari_elldata +============ + +Description +----------- + +PARI/GP version of J. E. Cremona Elliptic Curve Data, needed by +ellsearch and ellidentify. + +License +------- + +GNU General Public License (GPL version 2 or any later version). + + +Upstream Contact +---------------- + +http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_elldata/SPKG.txt b/build/pkgs/pari_elldata/SPKG.txt deleted file mode 100644 index a51f439e39e..00000000000 --- a/build/pkgs/pari_elldata/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= pari_elldata = - -== Description == - -PARI/GP version of J. E. Cremona Elliptic Curve Data, needed by ellsearch and ellidentify. - -== License == - -GNU General Public License (GPL version 2 or any later version). - -== Upstream Contact == - -http://pari.math.u-bordeaux.fr/ - -== Dependencies == - -* Installation: None -* Runtime: PARI/GP diff --git a/build/pkgs/pari_galdata/SPKG.txt b/build/pkgs/pari_galdata/SPKG.rst similarity index 59% rename from build/pkgs/pari_galdata/SPKG.txt rename to build/pkgs/pari_galdata/SPKG.rst index 049f93df73f..00b409f83a8 100644 --- a/build/pkgs/pari_galdata/SPKG.txt +++ b/build/pkgs/pari_galdata/SPKG.rst @@ -1,18 +1,24 @@ -= pari_galdata = +pari_galdata +============ -== Description == +Description +----------- PARI package "galdata": Needed by polgalois to compute Galois group in degrees 8 through 11. -== License == +License +------- GPL version 2+ -== Upstream Contact == + +Upstream Contact +---------------- http://pari.math.u-bordeaux.fr/ -== Dependencies == +Dependencies +------------ None (package contains data files only) diff --git a/build/pkgs/pari_galpol/SPKG.txt b/build/pkgs/pari_galpol/SPKG.rst similarity index 60% rename from build/pkgs/pari_galpol/SPKG.txt rename to build/pkgs/pari_galpol/SPKG.rst index a05341cd1bd..4dff32f9551 100644 --- a/build/pkgs/pari_galpol/SPKG.txt +++ b/build/pkgs/pari_galpol/SPKG.rst @@ -1,20 +1,26 @@ -= pari_galpol = +pari_galpol +=========== -== Description == +Description +----------- PARI package of the GALPOL database of polynomials defining Galois extensions of the rationals, accessed by galoisgetpol, galoisgetgroup, galoisgetname. -== License == +License +------- GNU General Public License (GPL version 2 or any later version). -== Upstream Contact == + +Upstream Contact +---------------- http://pari.math.u-bordeaux.fr/ -== Dependencies == +Dependencies +------------ -* Installation: None -* Runtime: PARI/GP +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_jupyter/SPKG.rst b/build/pkgs/pari_jupyter/SPKG.rst new file mode 100644 index 00000000000..c365806b7c9 --- /dev/null +++ b/build/pkgs/pari_jupyter/SPKG.rst @@ -0,0 +1,28 @@ +pari_jupyter +============ + +Description +----------- + +A Jupyter kernel for PARI/GP + +License +------- + +GPL version 3 or later + + +Upstream Contact +---------------- + +- https://github.com/jdemeyer/pari_jupyter +- Jeroen Demeyer + +Dependencies +------------ + +- Python (tested with version 2.7.14 and 3.6.1) +- Jupyter 4 +- PARI version 2.8.0 or later +- Readline (any version which works with PARI) +- Optional: Cython version 0.25 or later diff --git a/build/pkgs/pari_jupyter/SPKG.txt b/build/pkgs/pari_jupyter/SPKG.txt deleted file mode 100644 index 3a6ad00273c..00000000000 --- a/build/pkgs/pari_jupyter/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= pari_jupyter = - -== Description == - -A Jupyter kernel for PARI/GP - -== License == - -GPL version 3 or later - -== Upstream Contact == - -* https://github.com/jdemeyer/pari_jupyter -* Jeroen Demeyer - -== Dependencies == - -* Python (tested with version 2.7.14 and 3.6.1) -* Jupyter 4 -* PARI version 2.8.0 or later -* Readline (any version which works with PARI) -* Optional: Cython version 0.25 or later diff --git a/build/pkgs/pari_nftables/SPKG.rst b/build/pkgs/pari_nftables/SPKG.rst new file mode 100644 index 00000000000..2f8c273b660 --- /dev/null +++ b/build/pkgs/pari_nftables/SPKG.rst @@ -0,0 +1,25 @@ +pari_elldata +============ + +Description +----------- + +Repackaging of the historical megrez number field tables (errors fixed, +1/10th the size, easier to use). + +License +------- + +GNU General Public License (GPL version 2 or any later version). + + +Upstream Contact +---------------- + +http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_nftables/SPKG.txt b/build/pkgs/pari_nftables/SPKG.txt deleted file mode 100644 index 310faf0a446..00000000000 --- a/build/pkgs/pari_nftables/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= pari_elldata = - -== Description == - -Repackaging of the historical megrez number field tables -(errors fixed, 1/10th the size, easier to use). - -== License == - -GNU General Public License (GPL version 2 or any later version). - -== Upstream Contact == - -http://pari.math.u-bordeaux.fr/ - -== Dependencies == - -* Installation: None -* Runtime: PARI/GP diff --git a/build/pkgs/pari_seadata/SPKG.rst b/build/pkgs/pari_seadata/SPKG.rst new file mode 100644 index 00000000000..83561bd4e91 --- /dev/null +++ b/build/pkgs/pari_seadata/SPKG.rst @@ -0,0 +1,28 @@ +pari_seadata +============ + +Description +----------- + +Needed by ellap for large primes. These polynomials were extracted from +the ECHIDNA databases and computed by David R. Kohel. This covers finite +fields of cardinality q up to 750 bits. PARI/GP 2.9 contains fallback +code to go on when all modular polynomials in the database have been +exhausted and can handle larger fields (with an important slowdown). + +License +------- + +GNU General Public License (GPL version 2 or any later version). + + +Upstream Contact +---------------- + +http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_seadata/SPKG.txt b/build/pkgs/pari_seadata/SPKG.txt deleted file mode 100644 index ececd8350a0..00000000000 --- a/build/pkgs/pari_seadata/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= pari_seadata = - -== Description == - -Needed by ellap for large primes. -These polynomials were extracted from the ECHIDNA databases and computed -by David R. Kohel. This covers finite fields of cardinality q up to 750 -bits. PARI/GP 2.9 contains fallback code to go on when all modular -polynomials in the database have been exhausted and can handle larger -fields (with an important slowdown). - -== License == - -GNU General Public License (GPL version 2 or any later version). - -== Upstream Contact == - -http://pari.math.u-bordeaux.fr/ - -== Dependencies == - -* Installation: None -* Runtime: PARI/GP diff --git a/build/pkgs/pari_seadata_small/SPKG.txt b/build/pkgs/pari_seadata_small/SPKG.rst similarity index 55% rename from build/pkgs/pari_seadata_small/SPKG.txt rename to build/pkgs/pari_seadata_small/SPKG.rst index 081dd5738b5..149c0c5c416 100644 --- a/build/pkgs/pari_seadata_small/SPKG.txt +++ b/build/pkgs/pari_seadata_small/SPKG.rst @@ -1,20 +1,26 @@ -= pari_seadata_small = +pari_seadata_small +================== -== Description == +Description +----------- PARI package "seadata_small": Needed by ellap for large primes. This -"small" one is a much smaller version that should be suitable for -primes up to 350 bits. These polynomials were extracted from the ECHIDNA +"small" one is a much smaller version that should be suitable for primes +up to 350 bits. These polynomials were extracted from the ECHIDNA databases and computed by David R. Kohel. -== License == +License +------- GPL version 2+ -== Upstream Contact == + +Upstream Contact +---------------- http://pari.math.u-bordeaux.fr/ -== Dependencies == +Dependencies +------------ None (package contains data files only) diff --git a/build/pkgs/patch/SPKG.rst b/build/pkgs/patch/SPKG.rst new file mode 100644 index 00000000000..283448e24bf --- /dev/null +++ b/build/pkgs/patch/SPKG.rst @@ -0,0 +1,43 @@ +patch +===== + +Description +----------- + +'patch' takes a patch file containing a difference listing produced by +the 'diff' program and applies those differences to one or more original +files, producing patched versions. + +The version of 'patch' included is the GNU one. Some of the 'diff' files +produced by GNU 'diff' are not acceptble to some versions of the 'patch' +command, such as the 'patch' command that comes with Solaris. + +License +------- + +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, or (at your option) any +later version. + + +Upstream Contact +---------------- + +Main web site: http://savannah.gnu.org/projects/patch/ Bug database at +http://savannah.gnu.org/bugs/?group=patch Submit bugs at +http://savannah.gnu.org/bugs/?func=additem&group=patch Mailing lists +bug-patch@gnu.org + +Dependencies +------------ + +None + + +Special Update/Build Instructions +--------------------------------- + +In the event patches ever need to be made to this package, the method of +applying the patches should not rely on the 'patch' existing on the +system. diff --git a/build/pkgs/patch/SPKG.txt b/build/pkgs/patch/SPKG.txt deleted file mode 100644 index 1d20977f4ee..00000000000 --- a/build/pkgs/patch/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= patch = - -== Description == - -'patch' takes a patch file containing a difference listing produced -by the 'diff' program and applies those differences to one -or more original files, producing patched versions. - -The version of 'patch' included is the GNU one. Some of the 'diff' files -produced by GNU 'diff' are not acceptble to some versions of the 'patch' -command, such as the 'patch' command that comes with Solaris. - -== License == - -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, or (at your option) -any later version. - -== Upstream Contact == - -Main web site: http://savannah.gnu.org/projects/patch/ -Bug database at http://savannah.gnu.org/bugs/?group=patch -Submit bugs at http://savannah.gnu.org/bugs/?func=additem&group=patch -Mailing lists bug-patch@gnu.org - -== Dependencies == - -None - -== Special Update/Build Instructions == - -In the event patches ever need to be made to this package, the method of -applying the patches should not rely on the 'patch' existing on the system. diff --git a/build/pkgs/pathlib2/SPKG.txt b/build/pkgs/pathlib2/SPKG.rst similarity index 66% rename from build/pkgs/pathlib2/SPKG.txt rename to build/pkgs/pathlib2/SPKG.rst index 3330269b541..6936a68aee3 100644 --- a/build/pkgs/pathlib2/SPKG.txt +++ b/build/pkgs/pathlib2/SPKG.rst @@ -1,11 +1,12 @@ -= pathlib = +pathlib +======= -== Description == +Description +----------- Object-oriented filesystem paths -The old pathlib module on bitbucket is in bugfix-only mode. The goal -of pathlib2 is to provide a backport of standard pathlib module which +The old pathlib module on bitbucket is in bugfix-only mode. The goal of +pathlib2 is to provide a backport of standard pathlib module which tracks the standard library module, so all the newest features of the standard pathlib can be used also on older Python versions. - diff --git a/build/pkgs/pathpy/SPKG.rst b/build/pkgs/pathpy/SPKG.rst new file mode 100644 index 00000000000..95dda5598b0 --- /dev/null +++ b/build/pkgs/pathpy/SPKG.rst @@ -0,0 +1,7 @@ +path.py +======= + +Description +----------- + +A module wrapper for os.path diff --git a/build/pkgs/pathpy/SPKG.txt b/build/pkgs/pathpy/SPKG.txt deleted file mode 100644 index 1aec14146ab..00000000000 --- a/build/pkgs/pathpy/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= path.py = - -== Description == - -A module wrapper for os.path diff --git a/build/pkgs/pcre/SPKG.txt b/build/pkgs/pcre/SPKG.rst similarity index 58% rename from build/pkgs/pcre/SPKG.txt rename to build/pkgs/pcre/SPKG.rst index db08f9fa9c5..0f2b50045b5 100644 --- a/build/pkgs/pcre/SPKG.txt +++ b/build/pkgs/pcre/SPKG.rst @@ -1,21 +1,29 @@ -= pcre = +pcre +==== -== Description == +Description +----------- Perl-compatible regular expressions library. -== License == +License +------- BSD License ; see LICENCE (sic) at the root of the original tarball. -== Upstream Contact == + +Upstream Contact +---------------- Mailing list at https://lists.exim.org/mailman/listinfo/pcre-dev -== Dependencies == +Dependencies +------------ None listed. -== Special Update/Build Instructions == + +Special Update/Build Instructions +--------------------------------- None applicable (see README at tarball's root). diff --git a/build/pkgs/perl_cpan_polymake_prereq/SPKG.rst b/build/pkgs/perl_cpan_polymake_prereq/SPKG.rst new file mode 100644 index 00000000000..31cc724b335 --- /dev/null +++ b/build/pkgs/perl_cpan_polymake_prereq/SPKG.rst @@ -0,0 +1,13 @@ +perl_cpan_polymake_prereq +========================= + +Description +----------- + +This script package represents all Perl packages that are prerequisites +for polymake. + +License +------- + +Various free software licenses diff --git a/build/pkgs/perl_cpan_polymake_prereq/SPKG.txt b/build/pkgs/perl_cpan_polymake_prereq/SPKG.txt deleted file mode 100644 index 52d456d9c03..00000000000 --- a/build/pkgs/perl_cpan_polymake_prereq/SPKG.txt +++ /dev/null @@ -1,10 +0,0 @@ -= perl_cpan_polymake_prereq = - -== Description == - -This script package represents all Perl packages -that are prerequisites for polymake. - -== License == - -Various free software licenses diff --git a/build/pkgs/perl_term_readline_gnu/SPKG.rst b/build/pkgs/perl_term_readline_gnu/SPKG.rst new file mode 100644 index 00000000000..d9e8a1cf06c --- /dev/null +++ b/build/pkgs/perl_term_readline_gnu/SPKG.rst @@ -0,0 +1,25 @@ +perl_term_readline_gnu +====================== + +Description +----------- + +Perl extension for the GNU Readline/History Library + +Available on CPAN + +License +------- + +The Perl 5 License (Artistic 1 & GPL 1) + + +Upstream Contact +---------------- + +Hiroo HAYASHI + +Dependencies +------------ + +readline diff --git a/build/pkgs/perl_term_readline_gnu/SPKG.txt b/build/pkgs/perl_term_readline_gnu/SPKG.txt deleted file mode 100644 index 02fd66662ef..00000000000 --- a/build/pkgs/perl_term_readline_gnu/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= perl_term_readline_gnu = - -== Description == - -Perl extension for the GNU Readline/History Library - -Available on CPAN - -== License == - -The Perl 5 License (Artistic 1 & GPL 1) - -== Upstream Contact == - -Hiroo HAYASHI - -== Dependencies == - -readline diff --git a/build/pkgs/pexpect/SPKG.rst b/build/pkgs/pexpect/SPKG.rst new file mode 100644 index 00000000000..85be49569b1 --- /dev/null +++ b/build/pkgs/pexpect/SPKG.rst @@ -0,0 +1,27 @@ +pexpect +======= + +Description +----------- + +Pexpect is a pure Python module for spawning child applications; +controlling them; and responding to expected patterns in their output. + +License +------- + +ISC license: http://opensource.org/licenses/isc-license.txt This license +is approved by the OSI and FSF as GPL-compatible. + + +Upstream Contact +---------------- + +- http://pexpect.readthedocs.org/en/stable/ +- https://github.com/pexpect/pexpect + +Dependencies +------------ + +- GNU patch +- Python diff --git a/build/pkgs/pexpect/SPKG.txt b/build/pkgs/pexpect/SPKG.txt deleted file mode 100644 index b2485eccedf..00000000000 --- a/build/pkgs/pexpect/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= pexpect = - -== Description == - -Pexpect is a pure Python module for spawning child applications; -controlling them; and responding to expected patterns in their output. - -== License == - -ISC license: http://opensource.org/licenses/isc-license.txt -This license is approved by the OSI and FSF as GPL-compatible. - -== Upstream Contact == - -http://pexpect.readthedocs.org/en/stable/ -https://github.com/pexpect/pexpect - -== Dependencies == - - * GNU patch - * Python diff --git a/build/pkgs/pickleshare/SPKG.txt b/build/pkgs/pickleshare/SPKG.rst similarity index 57% rename from build/pkgs/pickleshare/SPKG.txt rename to build/pkgs/pickleshare/SPKG.rst index 3e67a43c105..812cf0b930f 100644 --- a/build/pkgs/pickleshare/SPKG.txt +++ b/build/pkgs/pickleshare/SPKG.rst @@ -1,13 +1,15 @@ -= pickleshare = +pickleshare +=========== -== Description == +Description +----------- PickleShare - a small 'shelve' like datastore with concurrency support -Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike -shelve, many processes can access the database simultaneously. Changing a -value in database is immediately visible to other processes accessing the -same database. +Like shelve, a PickleShareDB object acts like a normal dictionary. +Unlike shelve, many processes can access the database simultaneously. +Changing a value in database is immediately visible to other processes +accessing the same database. Concurrency is possible because the values are stored in separate files. Hence the "database" is a directory where all files are governed by diff --git a/build/pkgs/pillow/SPKG.rst b/build/pkgs/pillow/SPKG.rst new file mode 100644 index 00000000000..a3c2fbac3ca --- /dev/null +++ b/build/pkgs/pillow/SPKG.rst @@ -0,0 +1,27 @@ +Pillow +====== + +Description +----------- + +Pillow is the "friendly" PIL fork by Alex Clark and Contributors. + +The Python Imaging Library (PIL) adds powerful image processing and +graphics capabilities to Python. The library supports many file formats. + +License +------- + +Standard PIL License + + +Upstream Contact +---------------- + +- Author: Alex Clark +- Homepage: http://python-imaging.github.io/ + +Dependencies +------------ + +- Python diff --git a/build/pkgs/pillow/SPKG.txt b/build/pkgs/pillow/SPKG.txt deleted file mode 100644 index 340b0cbc351..00000000000 --- a/build/pkgs/pillow/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= Pillow = - -== Description == - -Pillow is the "friendly" PIL fork by Alex Clark and Contributors. - -The Python Imaging Library (PIL) adds powerful image processing and -graphics capabilities to Python. The library supports many file -formats. - -== License == - -Standard PIL License - -== Upstream Contact == - -Author: Alex Clark -Homepage: http://python-imaging.github.io/ - -== Dependencies == - - * Python diff --git a/build/pkgs/pip/SPKG.rst b/build/pkgs/pip/SPKG.rst new file mode 100644 index 00000000000..92ded395cc5 --- /dev/null +++ b/build/pkgs/pip/SPKG.rst @@ -0,0 +1,31 @@ +pip +=== + +Description +----------- + +This package installs pip, the tool for installing and managing Python +packages, such as those found in the Python Package Index. It’s a +replacement for easy_install. + +License +------- + +MIT + + +Upstream Contact +---------------- + +- Project Page: https://github.com/pypa/pip +- Install howto: https://pip.pypa.io/en/latest/installing.html +- Changelog: https://pip.pypa.io/en/latest/news.html +- Bug Tracking: https://github.com/pypa/pip/issues +- Mailing list: http://groups.google.com/group/python-virtualenv +- Docs: https://pip.pypa.io/ + +Dependencies +------------ + +- python +- setuptools diff --git a/build/pkgs/pip/SPKG.txt b/build/pkgs/pip/SPKG.txt deleted file mode 100644 index ebdd18450ed..00000000000 --- a/build/pkgs/pip/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= pip = - -== Description == - -This package installs pip, the tool for installing and managing Python packages, -such as those found in the Python Package Index. It’s a replacement for -easy_install. - -== License == - -MIT - -== Upstream Contact == - -Project Page: https://github.com/pypa/pip -Install howto: https://pip.pypa.io/en/latest/installing.html -Changelog: https://pip.pypa.io/en/latest/news.html -Bug Tracking: https://github.com/pypa/pip/issues -Mailing list: http://groups.google.com/group/python-virtualenv -Docs: https://pip.pypa.io/ - -== Dependencies == - -* python -* setuptools - diff --git a/build/pkgs/pkgconf/SPKG.rst b/build/pkgs/pkgconf/SPKG.rst new file mode 100644 index 00000000000..3916889b08a --- /dev/null +++ b/build/pkgs/pkgconf/SPKG.rst @@ -0,0 +1,33 @@ +pkgconf +======= + +Description +----------- + +Pkgconf is an implementation of the pkg-config spec with minimal +dependencies. + +License +------- + +ISC License (equivalent to Simplified BSD) + + +Upstream Contact +---------------- + +https://github.com/pkgconf/pkgconf + +Dependencies +------------ + +- C compiler + toolchain + + +Special Update/Build Instructions +--------------------------------- + +- install.patch: Use install script from AC_PROG_INSTALL + +Pkgconf is used in bzip2, so we must not use the bzip2-compressed +tarball. diff --git a/build/pkgs/pkgconf/SPKG.txt b/build/pkgs/pkgconf/SPKG.txt deleted file mode 100644 index 1ba83f5b08a..00000000000 --- a/build/pkgs/pkgconf/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= pkgconf = - -== Description == - -Pkgconf is an implementation of the pkg-config spec with minimal -dependencies. - -== License == - -ISC License (equivalent to Simplified BSD) - -== Upstream Contact == - -https://github.com/pkgconf/pkgconf - -== Dependencies == - -* C compiler + toolchain - -== Special Update/Build Instructions == - -* install.patch: Use install script from AC_PROG_INSTALL - -Pkgconf is used in bzip2, so we must not use the bzip2-compressed -tarball. diff --git a/build/pkgs/pkgconfig/SPKG.rst b/build/pkgs/pkgconfig/SPKG.rst new file mode 100644 index 00000000000..f027440c23d --- /dev/null +++ b/build/pkgs/pkgconfig/SPKG.rst @@ -0,0 +1,32 @@ +pkgconfig +========= + +Description +----------- + +Pkgconfig is a Python module to interface with the pkg-config command +line tool. + +License +------- + +MIT License + + +Upstream Contact +---------------- + +https://github.com/matze/pkgconfig + +Dependencies +------------ + +- Python 2.6+ + + +Special Update/Build Instructions +--------------------------------- + +Standard setup.py + +- remove_nose.patch: Remove the nose dependency (not actually used) diff --git a/build/pkgs/pkgconfig/SPKG.txt b/build/pkgs/pkgconfig/SPKG.txt deleted file mode 100644 index 13b53ecbb6e..00000000000 --- a/build/pkgs/pkgconfig/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= pkgconfig = - -== Description == - -Pkgconfig is a Python module to interface with the pkg-config command -line tool. - -== License == - -MIT License - -== Upstream Contact == - -https://github.com/matze/pkgconfig - -== Dependencies == - -* Python 2.6+ - -== Special Update/Build Instructions == - -Standard setup.py - -* remove_nose.patch: Remove the nose dependency (not actually used) diff --git a/build/pkgs/planarity/SPKG.rst b/build/pkgs/planarity/SPKG.rst new file mode 100644 index 00000000000..be0b86d7f96 --- /dev/null +++ b/build/pkgs/planarity/SPKG.rst @@ -0,0 +1,46 @@ +planarity +========= + +Description +----------- + +This code project provides a library for implementing graph algorithms +as well as implementations of several planarity-related graph +algorithms. The origin of this project is the reference implementation +for the Edge Addition Planarity Algorithm [1], which is now the fastest +and simplest linear-time method for planar graph embedding and planarity +obstruction isolation (i.e. Kuratowski subgraph isolation). + +[1] http://dx.doi.org/10.7155/jgaa.00091 + +License +------- + +New BSD License + + +Upstream Contact +---------------- + +- https://github.com/graph-algorithms/edge-addition-planarity-suite/ + +- John Boyer + +Dependencies +------------ + +None + + +Special Update/Build Instructions +--------------------------------- + +The tarballs can be found at, +https://github.com/graph-algorithms/edge-addition-planarity-suite/releases +sage tarball is repackaged after running autogen.sh + +One change was made to the upstream code: + +- extern.patch - declare variables declared in headers as extern. + + https://github.com/graph-algorithms/edge-addition-planarity-suite/pull/3 diff --git a/build/pkgs/planarity/SPKG.txt b/build/pkgs/planarity/SPKG.txt deleted file mode 100644 index 6f5a75eafd5..00000000000 --- a/build/pkgs/planarity/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= planarity = - -== Description == - -This code project provides a library for implementing graph algorithms as well -as implementations of several planarity-related graph algorithms. The origin of -this project is the reference implementation for the Edge Addition Planarity -Algorithm [1], which is now the fastest and simplest linear-time method for -planar graph embedding and planarity obstruction isolation (i.e. Kuratowski -subgraph isolation). - -[1] http://dx.doi.org/10.7155/jgaa.00091 - -== License == - -New BSD License - -== Upstream Contact == - -* https://github.com/graph-algorithms/edge-addition-planarity-suite/ - -* John Boyer - -== Dependencies == - -None - -== Special Update/Build Instructions == - -The tarballs can be found at, -https://github.com/graph-algorithms/edge-addition-planarity-suite/releases -sage tarball is repackaged after running autogen.sh - -One change was made to the upstream code: -- extern.patch - declare variables declared in headers as extern. - https://github.com/graph-algorithms/edge-addition-planarity-suite/pull/3 diff --git a/build/pkgs/plantri/SPKG.rst b/build/pkgs/plantri/SPKG.rst new file mode 100644 index 00000000000..3ae1cc2e1e0 --- /dev/null +++ b/build/pkgs/plantri/SPKG.rst @@ -0,0 +1,42 @@ +Plantri +======= + +Description +----------- + +Plantri is a program that generates certain types of graphs that are +imbedded on the sphere. + +Exactly one member of each isomorphism class is output, using an amount +of memory almost independent of the number of graphs produced. This, +together with the exceptionally fast operation and careful validation, +makes the program suitable for processing very large numbers of graphs. + +Isomorphisms are defined with respect to the embeddings, so in some +cases outputs may be isomorphic as abstract graphs. + +License +------- + +Plantri is distributed without a license. + + +Upstream Contact +---------------- + +Gunnar Brinkmann + +- University of Ghent +- Gunnar.Brinkmann@ugent.be + +Brendan McKay + +- Australian National University +- bdm@cs.anu.edu.au + +See http://cs.anu.edu.au/~bdm/plantri + +Dependencies +------------ + +- None diff --git a/build/pkgs/plantri/SPKG.txt b/build/pkgs/plantri/SPKG.txt deleted file mode 100644 index 5c4fe542614..00000000000 --- a/build/pkgs/plantri/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= Plantri = - -== Description == - -Plantri is a program that generates certain types of graphs that are -imbedded on the sphere. - -Exactly one member of each isomorphism class is output, using an -amount of memory almost independent of the number of graphs produced. -This, together with the exceptionally fast operation and careful -validation, makes the program suitable for processing very large -numbers of graphs. - -Isomorphisms are defined with respect to the embeddings, so in some -cases outputs may be isomorphic as abstract graphs. - -== License == -Plantri is distributed without a license. - -== Upstream Contact == -Gunnar Brinkmann - University of Ghent - Gunnar.Brinkmann@ugent.be - -Brendan McKay - Australian National University - bdm@cs.anu.edu.au - -See http://cs.anu.edu.au/~bdm/plantri - -== Dependencies == - * None - diff --git a/build/pkgs/polylib/SPKG.rst b/build/pkgs/polylib/SPKG.rst new file mode 100644 index 00000000000..54f0c438d6a --- /dev/null +++ b/build/pkgs/polylib/SPKG.rst @@ -0,0 +1,24 @@ +polylib +======= + +Description +----------- + +The Polyhedral Library (PolyLib for short) operates on objects made up +of unions of polyhedra of any dimension. polylib is a C library. + +License +------- + +GPL v3 + + +Upstream Contact +---------------- + +- https://groups.google.com/forum/#!forum/isl-development + +Dependencies +------------ + +- GMP diff --git a/build/pkgs/polylib/SPKG.txt b/build/pkgs/polylib/SPKG.txt deleted file mode 100644 index 5e31ce96964..00000000000 --- a/build/pkgs/polylib/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= polylib = - -== Description == - -The Polyhedral Library (PolyLib for short) operates on objects made up of unions of polyhedra of any dimension. -polylib is a C library. - - -== License == - -GPL v3 - -== Upstream Contact == - -* https://groups.google.com/forum/#!forum/isl-development - -== Dependencies == - - * GMP diff --git a/build/pkgs/polymake/SPKG.rst b/build/pkgs/polymake/SPKG.rst new file mode 100644 index 00000000000..8bb67899526 --- /dev/null +++ b/build/pkgs/polymake/SPKG.rst @@ -0,0 +1,76 @@ +Polymake +======== + +Description +----------- + +polymake is open source software for research in polyhedral geometry. It +deals with polytopes, polyhedra and fans as well as simplicial +complexes, matroids, graphs, tropical hypersurfaces, and other objects. +Supported platforms include various flavors of Linux, Free BSD and Mac +OS. + +License +------- + +- GPL v3 + + +Upstream Contact +---------------- + +- https://polymake.org/ + +Dependencies +------------ + +Polymake needs a working installation of Perl, including its shared +library and some modules (XML::Writer XML::LibXML XML::LibXSLT +Term::ReadLine::Gnu JSON SVG). The Polymake interface in Sage +additionally needs File::Slurp. For full functionality including +polymake's polyDB, also the Perl module MongoDB is required. + +These are not provided by a Sage package. The script package +perl_cpan_polymake_prereq will signal an error at build time if these +prerequisites are not met. + +The configure script will inform you about the equivalent system +packages that you should install. Otherwise, you can use CPAN (see +below). + +Sage might install the Term::ReadLine::Gnu module, however, when you +install polymake, if it is not provided by the system, or if Sage +installs its own readline library. + + +A distribution-independent way to install Perl modules (into a user's +home directory or /usr/local) is using CPAN. This is also the way to +install the modules on macOS. For this, if you don't have root access, +you will need the local::lib Perl module installed:: + + cpan -i XML::Writer XML::LibXML XML::LibXSLT File::Slurp Term::ReadLine::Gnu JSON SVG MongoDB + +Several Sage packages should be installed before installing the polymake +package to give a more featureful Polymake installation: + + sage -i 4ti2 latte_int topcom qhull + +Software that would need to be installed manually (no Sage package +available) for a more featureful Polymake installation: azove, porta, +vinci, SplitsTree4. + +Information on missing Polymake prerequisites after installing polymake:: + + $ sage -sh + (sage-sh) $ polymake + polytope> show_unconfigured; + + +Debugging polymake install problems +----------------------------------- + +:: + + # apt-get install libdevel-trace-perl + $ cd src + $ perl -d:Trace support/configure.pl diff --git a/build/pkgs/polymake/SPKG.txt b/build/pkgs/polymake/SPKG.txt deleted file mode 100644 index a2254ed0212..00000000000 --- a/build/pkgs/polymake/SPKG.txt +++ /dev/null @@ -1,69 +0,0 @@ -= Polymake = - -== Description == - -polymake is open source software for research in polyhedral -geometry. It deals with polytopes, polyhedra and fans as -well as simplicial complexes, matroids, graphs, tropical -hypersurfaces, and other objects. Supported platforms -include various flavors of Linux, Free BSD and Mac OS. - -== License == - - * GPL v3 - -== Upstream Contact == - - * https://polymake.org/ - -== Dependencies == - -Polymake needs a working installation of Perl, including its shared -library and some modules (XML::Writer XML::LibXML XML::LibXSLT -Term::ReadLine::Gnu JSON SVG). The Polymake interface in Sage -additionally needs File::Slurp. For full functionality including -polymake's polyDB, also the Perl module MongoDB is required. - -These are not provided by a Sage package. The script package -perl_cpan_polymake_prereq will signal an error at build time if these -prerequisites are not met. - -The configure script will inform you about the equivalent system -packages that you should install. Otherwise, you can use CPAN -(see below). - -Sage might install the Term::ReadLine::Gnu module, however, when you -install polymake, if it is not provided by the system, or if Sage -installs its own readline library. - - -A distribution-independent way to install Perl modules (into a user's -home directory or /usr/local) is using CPAN. This is also the way to -install the modules on macOS. For this, if you don't have root -access, you will need the local::lib Perl module installed. - - cpan -i XML::Writer XML::LibXML XML::LibXSLT File::Slurp Term::ReadLine::Gnu JSON SVG MongoDB - - -Several Sage packages should be installed before installing the -polymake package to give a more featureful Polymake installation: - sage -i 4ti2 latte_int topcom qhull - -Software that would need to be installed manually (no Sage package - available) for a more featureful Polymake installation: - azove, - porta, - vinci, - SplitsTree4 - -Information on missing Polymake prerequisites after installing -polymake: - $ sage -sh - (sage-sh) $ polymake - polytope> show_unconfigured; - -== Debugging polymake install problems == - -# apt-get install libdevel-trace-perl -$ cd src -$ perl -d:Trace support/configure.pl diff --git a/build/pkgs/polytopes_db/SPKG.rst b/build/pkgs/polytopes_db/SPKG.rst new file mode 100644 index 00000000000..a46d4d2fe18 --- /dev/null +++ b/build/pkgs/polytopes_db/SPKG.rst @@ -0,0 +1,27 @@ + +Reflexive Polytopes Databases +============================= + +Description +----------- + +This package includes lists of 2- and 3-dimensional reflexive polytopes. + +The list of polygons is quite easy to get and it has been known for a +while. The list of 3-polytopes was originally obtained by Maximilian +Kreuzer and Harald Skarke using their software PALP, which is included +into the standard distribution of Sage. To work with lattice and +reflexive polytopes from Sage you can use sage.geometry.lattice_polytope +module, which relies on PALP for some of its functionality. To get +access to the databases of this package, use ReflexivePolytope and +ReflexivePolytopes commands. + +License +------- + +GPL + +Dependencies +------------ + +None diff --git a/build/pkgs/polytopes_db/SPKG.txt b/build/pkgs/polytopes_db/SPKG.txt deleted file mode 100644 index 3f2aae989ff..00000000000 --- a/build/pkgs/polytopes_db/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= Reflexive Polytopes Databases = - -== Description == - -This package includes lists of 2- and 3-dimensional reflexive polytopes. - -The list of polygons is quite easy to get and it has been known for a while. -The list of 3-polytopes was originally obtained by Maximilian Kreuzer and -Harald Skarke using their software PALP, which is included into the standard -distribution of Sage. To work with lattice and reflexive polytopes from Sage -you can use sage.geometry.lattice_polytope module, which relies on PALP for -some of its functionality. To get access to the databases of this package, use -ReflexivePolytope and ReflexivePolytopes commands. - -== License == - -GPL - -== Dependencies == - -None diff --git a/build/pkgs/ppl/SPKG.rst b/build/pkgs/ppl/SPKG.rst new file mode 100644 index 00000000000..e62faa3b989 --- /dev/null +++ b/build/pkgs/ppl/SPKG.rst @@ -0,0 +1,62 @@ + +Parma Polyhedra Library +======================= + +Description +----------- + +The Parma Polyhedra Library (PPL) provides numerical abstractions +especially targeted at applications in the field of analysis and +verification of complex systems. These abstractions include convex +polyhedra, defined as the intersection of a finite number of (open or +closed) halfspaces, each described by a linear inequality (strict or +non-strict) with rational coefficients; some special classes of +polyhedra shapes that offer interesting complexity/precision tradeoffs; +and grids which represent regularly spaced points that satisfy a set of +linear congruence relations. The library also supports finite powersets +and products of (any kind of) polyhedra and grids, a mixed integer +linear programming problem solver using an exact-arithmetic version of +the simplex algorithm, a parametric integer programming solver, and +primitives for the termination analysis via the automatic synthesis of +linear ranking functions. + +It is written in C++, but comes with interfaces to C, Java, OCaml, and +Prolog. PPL is one of the fastest implementations of polyhedral +computations. + +Benchmarks are included in this paper: https://arxiv.org/abs/cs/0612085 + +License +------- + +GPL v3+ + + +Upstream Contact +---------------- + +- http://www.cs.unipr.it/ppl/ +- BUGSENG srl (http://bugseng.com) + +Core Development Team + +- Roberto Bagnara (University of Parma) +- Patricia M. Hill (University of Parma) +- Enea Zaffanella (University of Parma) + +Dependencies +------------ + +- gmp (or mpir) + + +Special Update/Build Instructions +--------------------------------- + +Patches +~~~~~~~ + +- ptrdiff_t-ppl-1.1.patch: Fixes to compile with gcc 4.9; C++ name + lookup issue. + +- weak.patch: disable use of weak symbols on Cygwin64. diff --git a/build/pkgs/ppl/SPKG.txt b/build/pkgs/ppl/SPKG.txt deleted file mode 100644 index cc857a87158..00000000000 --- a/build/pkgs/ppl/SPKG.txt +++ /dev/null @@ -1,45 +0,0 @@ -= Parma Polyhedra Library = - -== Description == -The Parma Polyhedra Library (PPL) provides numerical abstractions -especially targeted at applications in the field of analysis and -verification of complex systems. These abstractions include convex -polyhedra, defined as the intersection of a finite number of (open or -closed) halfspaces, each described by a linear inequality (strict or -non-strict) with rational coefficients; some special classes of -polyhedra shapes that offer interesting complexity/precision -tradeoffs; and grids which represent regularly spaced points that -satisfy a set of linear congruence relations. The library also -supports finite powersets and products of (any kind of) polyhedra and -grids, a mixed integer linear programming problem solver using an -exact-arithmetic version of the simplex algorithm, a parametric -integer programming solver, and primitives for the termination -analysis via the automatic synthesis of linear ranking functions. - -It is written in C++, but comes with interfaces to C, Java, OCaml, and -Prolog. PPL is one of the fastest implementations of polyhedral -computations. - -Benchmarks are included in this paper: https://arxiv.org/abs/cs/0612085 - -== License == -GPL v3+ - -== Upstream Contact == -http://www.cs.unipr.it/ppl/ -BUGSENG srl (http://bugseng.com) - -Core Development Team -Roberto Bagnara (University of Parma) -Patricia M. Hill (University of Parma) -Enea Zaffanella (University of Parma) - -== Dependencies == -* gmp (or mpir) - -== Special Update/Build Instructions == - -=== Patches === -* ptrdiff_t-ppl-1.1.patch: Fixes to compile with gcc 4.9; C++ name - lookup issue. -* weak.patch: disable use of weak symbols on Cygwin64. diff --git a/build/pkgs/pplpy/SPKG.txt b/build/pkgs/pplpy/SPKG.rst similarity index 55% rename from build/pkgs/pplpy/SPKG.txt rename to build/pkgs/pplpy/SPKG.rst index 2e486a634fe..2a7c7e5618e 100644 --- a/build/pkgs/pplpy/SPKG.txt +++ b/build/pkgs/pplpy/SPKG.rst @@ -1,17 +1,23 @@ -= pplpy = +pplpy +===== -== Description == +Description +----------- PPL Python wrapper -This Python package provides a wrapper to the C++ Parma Polyhedra Library (PPL). +This Python package provides a wrapper to the C++ Parma Polyhedra +Library (PPL). The whole package started as a fork of a tiny part of the Sage software. -== License == +License +------- GPL version 3 -== Upstream Contact == -* https://github.com/videlec/pplpy +Upstream Contact +---------------- + +- https://github.com/videlec/pplpy diff --git a/build/pkgs/primecount/SPKG.rst b/build/pkgs/primecount/SPKG.rst new file mode 100644 index 00000000000..f01e3971e3c --- /dev/null +++ b/build/pkgs/primecount/SPKG.rst @@ -0,0 +1,21 @@ +primecount +========== + +Description +----------- + +primecount is a C++ implementation of several algorithms for counting +primes maintained by Kim Walisch. + +Website: https://github.com/kimwalisch/primecount/ + +License +------- + +primecount is licensed BSD 2 + + +Upstream Contact +---------------- + +- https://github.com/kimwalisch/primecount/ diff --git a/build/pkgs/primecount/SPKG.txt b/build/pkgs/primecount/SPKG.txt deleted file mode 100644 index 4f2011fc8a6..00000000000 --- a/build/pkgs/primecount/SPKG.txt +++ /dev/null @@ -1,16 +0,0 @@ -= primecount = - -== Description == - -primecount is a C++ implementation of several algorithms for -counting primes maintained by Kim Walisch. - -Website: https://github.com/kimwalisch/primecount/ - -== License == - -primecount is licensed BSD 2 - -== Upstream Contact == - - * https://github.com/kimwalisch/primecount/ diff --git a/build/pkgs/prometheus_client/SPKG.rst b/build/pkgs/prometheus_client/SPKG.rst new file mode 100644 index 00000000000..802395ae58b --- /dev/null +++ b/build/pkgs/prometheus_client/SPKG.rst @@ -0,0 +1,9 @@ +prometheus_client +================= + +Description +----------- + +The official Python 2 and 3 client for Prometheus (see +https://prometheus.io), an open-source systems monitoring and alerting +toolkit. diff --git a/build/pkgs/prometheus_client/SPKG.txt b/build/pkgs/prometheus_client/SPKG.txt deleted file mode 100644 index 607e4e290cf..00000000000 --- a/build/pkgs/prometheus_client/SPKG.txt +++ /dev/null @@ -1,6 +0,0 @@ -= prometheus_client = - -== Description == - -The official Python 2 and 3 client for Prometheus (see https://prometheus.io), -an open-source systems monitoring and alerting toolkit. diff --git a/build/pkgs/prompt_toolkit/SPKG.txt b/build/pkgs/prompt_toolkit/SPKG.rst similarity index 67% rename from build/pkgs/prompt_toolkit/SPKG.txt rename to build/pkgs/prompt_toolkit/SPKG.rst index 3e530f4952a..38e45cd036f 100644 --- a/build/pkgs/prompt_toolkit/SPKG.txt +++ b/build/pkgs/prompt_toolkit/SPKG.rst @@ -1,6 +1,8 @@ -= prompt_toolkit = +prompt_toolkit +============== -== Description == +Description +----------- Library for building powerful interactive command lines in Python diff --git a/build/pkgs/psutil/SPKG.txt b/build/pkgs/psutil/SPKG.rst similarity index 66% rename from build/pkgs/psutil/SPKG.txt rename to build/pkgs/psutil/SPKG.rst index 7bcad7020b6..5895ee2cdf7 100644 --- a/build/pkgs/psutil/SPKG.txt +++ b/build/pkgs/psutil/SPKG.rst @@ -1,14 +1,20 @@ -= psutil = +psutil +====== -== Description == +Description +----------- psutil is a cross-platform library for retrieving information onrunning -processes and system utilization (CPU, memory, disks, network) in Python. +processes and system utilization (CPU, memory, disks, network) in +Python. -== License == +License +------- 3-clause BSD license -== Upstream Contact == + +Upstream Contact +---------------- https://github.com/giampaolo/psutil/ diff --git a/build/pkgs/ptyprocess/SPKG.rst b/build/pkgs/ptyprocess/SPKG.rst new file mode 100644 index 00000000000..260a913cd76 --- /dev/null +++ b/build/pkgs/ptyprocess/SPKG.rst @@ -0,0 +1,32 @@ +ptyprocess +========== + +Description +----------- + +Launch a subprocess in a pseudo terminal (pty), and interact with both +the process and its pty. + +Sometimes, piping stdin and stdout is not enough. There might be a +password prompt that doesn't read from stdin, output that changes when +it's going to a pipe rather than a terminal, or curses-style interfaces +that rely on a terminal. If you need to automate these things, running +the process in a pseudo terminal (pty) is the answer. + +License +------- + +Ptyprocess is under the ISC license, as code derived from Pexpect. + + http://opensource.org/licenses/ISC + + +Upstream Contact +---------------- + +https://github.com/pexpect/ptyprocess + +Dependencies +------------ + +- Python diff --git a/build/pkgs/ptyprocess/SPKG.txt b/build/pkgs/ptyprocess/SPKG.txt deleted file mode 100644 index 173ccb9dee5..00000000000 --- a/build/pkgs/ptyprocess/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= ptyprocess = - -== Description == - -Launch a subprocess in a pseudo terminal (pty), and interact with both the -process and its pty. - -Sometimes, piping stdin and stdout is not enough. There might be a password -prompt that doesn't read from stdin, output that changes when it's going to a -pipe rather than a terminal, or curses-style interfaces that rely on a terminal. -If you need to automate these things, running the process in a pseudo terminal -(pty) is the answer. - -== License == - -Ptyprocess is under the ISC license, as code derived from Pexpect. - http://opensource.org/licenses/ISC - -== Upstream Contact == - -https://github.com/pexpect/ptyprocess - -== Dependencies == - - * Python diff --git a/build/pkgs/pycosat/SPKG.rst b/build/pkgs/pycosat/SPKG.rst new file mode 100644 index 00000000000..d88c7a52998 --- /dev/null +++ b/build/pkgs/pycosat/SPKG.rst @@ -0,0 +1,35 @@ +pycosat +======= + +Description +----------- + +PicoSAT is a popular SAT solver written by Armin Biere in pure C. This +package provides efficient Python bindings to picosat on the C level, +i.e. when importing pycosat, the picosat solver becomes part of the +Python process itself. For ease of deployment, the picosat source +(namely picosat.c and picosat.h) is included in this project. These +files have been extracted from the picosat source. + +License +------- + +MIT + + +Upstream Contact +---------------- + +- PicoSAT: http://fmv.jku.at/picosat/ +- pycosat: https://github.com/ContinuumIO/pycosat + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/pycosat/SPKG.txt b/build/pkgs/pycosat/SPKG.txt deleted file mode 100644 index 0d99e44ba15..00000000000 --- a/build/pkgs/pycosat/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= pycosat = - -== Description == - -PicoSAT is a popular SAT solver written by Armin Biere in pure C. This package -provides efficient Python bindings to picosat on the C level, i.e. when -importing pycosat, the picosat solver becomes part of the Python process itself. -For ease of deployment, the picosat source (namely picosat.c and picosat.h) is -included in this project. These files have been extracted from the picosat -source. - -== License == - -MIT - -== Upstream Contact == - -PicoSAT: http://fmv.jku.at/picosat/ -pycosat: https://github.com/ContinuumIO/pycosat - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/pycygwin/SPKG.rst b/build/pkgs/pycygwin/SPKG.rst new file mode 100644 index 00000000000..2fa961c54ed --- /dev/null +++ b/build/pkgs/pycygwin/SPKG.rst @@ -0,0 +1,14 @@ +pycygwin +======== + +Description +----------- + +Python bindings for Cygwin's C API. Provides some utilities to help with +the Cygwin port. Naturally, this package should only be installed on +Cygwin--for other platforms its installation is a no-op. + +Website +------- + +https://github.com/embray/PyCygwin diff --git a/build/pkgs/pycygwin/SPKG.txt b/build/pkgs/pycygwin/SPKG.txt deleted file mode 100644 index 7f918edfd29..00000000000 --- a/build/pkgs/pycygwin/SPKG.txt +++ /dev/null @@ -1,11 +0,0 @@ -= pycygwin = - -== Description == - -Python bindings for Cygwin's C API. Provides some utilities to help with -the Cygwin port. Naturally, this package should only be installed on -Cygwin--for other platforms its installation is a no-op. - -== Website == - -https://github.com/embray/PyCygwin diff --git a/build/pkgs/pygments/SPKG.rst b/build/pkgs/pygments/SPKG.rst new file mode 100644 index 00000000000..9bf68e5326a --- /dev/null +++ b/build/pkgs/pygments/SPKG.rst @@ -0,0 +1,51 @@ +Pygments +======== + +Description +----------- + +Pygments is a syntax highlighting package written in Python. + +It is a generic syntax highlighter suitable for use in code hosting, +forums, wikis or other applications that need to prettify source code. +Highlights are: + +- a wide range of over 300 languages and other text formats is + supported + +- special attention is paid to details, increasing quality by a fair + amount + +- support for new languages and formats are added easily +- a number of output formats, presently HTML, LaTeX, RTF, SVG, all + image + formats that PIL supports and ANSI sequences + +- it is usable as a command-line tool and as a library + +License +------- + +Modified BSD + + +Upstream Contact +---------------- + +- Author: Georg Brandl +- Home Page: http://pygments.org + +Dependencies +------------ + +Python + + +Special Update/Build Instructions +--------------------------------- + +Patches included: + +- sage_prompt.patch: patch pygments/lexers/agile.py to treat the + "sage:" prompt like Python's ">>>" prompt. This allows a very + kludgy patch to be removed from the Sphinx package (see #10118). diff --git a/build/pkgs/pygments/SPKG.txt b/build/pkgs/pygments/SPKG.txt deleted file mode 100644 index ae7f23d4cb9..00000000000 --- a/build/pkgs/pygments/SPKG.txt +++ /dev/null @@ -1,39 +0,0 @@ -= Pygments = - -== Description == - -Pygments is a syntax highlighting package written in Python. - -It is a generic syntax highlighter suitable for use in code hosting, -forums, wikis or other applications that need to prettify source code. -Highlights are: - -* a wide range of over 300 languages and other text formats is - supported -* special attention is paid to details, increasing quality by a fair - amount -* support for new languages and formats are added easily -* a number of output formats, presently HTML, LaTeX, RTF, SVG, all image - formats that PIL supports and ANSI sequences -* it is usable as a command-line tool and as a library - -== License == - -Modified BSD - -== Upstream Contact == - -Author: Georg Brandl -Home Page: http://pygments.org - -== Dependencies == - -Python - -== Special Update/Build Instructions == - -Patches included: - - * sage_prompt.patch: patch pygments/lexers/agile.py to treat the - "sage:" prompt like Python's ">>>" prompt. This allows a very - kludgy patch to be removed from the Sphinx package (see #10118). diff --git a/build/pkgs/pynac/SPKG.rst b/build/pkgs/pynac/SPKG.rst new file mode 100644 index 00000000000..27c3f062c84 --- /dev/null +++ b/build/pkgs/pynac/SPKG.rst @@ -0,0 +1,36 @@ +pynac +===== + +Description +----------- + +A modified version of GiNaC that replaces the dependency on CLN by +Python. + +License +------- + +GPL V2+ + + +Upstream Contact +---------------- + +- Burcin Erocal - burcin spam.erocal.org +- William Stein - wstein spam.gmail.com +- Mike Hansen - mhansen spam.gmail.com + +Dependencies +------------ + +Python + + +Special Update/Build Instructions +--------------------------------- + +If build fails trying to run autoheader, run + + autoreconf -i --force + +in the src directory. diff --git a/build/pkgs/pynac/SPKG.txt b/build/pkgs/pynac/SPKG.txt deleted file mode 100644 index fe87c09f20c..00000000000 --- a/build/pkgs/pynac/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= pynac = - -== Description == - -A modified version of GiNaC that replaces the dependency on CLN by Python. - -== License == - -GPL V2+ - -== Upstream Contact == - - * Burcin Erocal - burcin spam.erocal.org - * William Stein - wstein spam.gmail.com - * Mike Hansen - mhansen spam.gmail.com - -== Dependencies == - -Python - -== Special Update/Build Instructions == - -If build fails trying to run autoheader, run - - autoreconf -i --force - -in the src directory. - diff --git a/build/pkgs/pynormaliz/SPKG.rst b/build/pkgs/pynormaliz/SPKG.rst new file mode 100644 index 00000000000..da072c3f873 --- /dev/null +++ b/build/pkgs/pynormaliz/SPKG.rst @@ -0,0 +1,28 @@ +pynormaliz +========== + +Description +----------- + +The Python module PyNormaliz provides wrappers for normaliz. + +License +------- + +- GPL v2 or later + + +Upstream Contact +---------------- + + https://github.com/sebasguts/PyNormaliz + +Dependencies +------------ + +- pip +- normaliz + + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/pynormaliz/SPKG.txt b/build/pkgs/pynormaliz/SPKG.txt deleted file mode 100644 index 3de174ff111..00000000000 --- a/build/pkgs/pynormaliz/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= pynormaliz = - -== Description == - -The Python module PyNormaliz provides wrappers for normaliz. - -== License == - - * GPL v2 or later - -== Upstream Contact == - - https://github.com/sebasguts/PyNormaliz - -== Dependencies == - - * pip - * normaliz - -== Special Update/Build Instructions == - diff --git a/build/pkgs/pyparsing/SPKG.rst b/build/pkgs/pyparsing/SPKG.rst new file mode 100644 index 00000000000..dcdcae68b90 --- /dev/null +++ b/build/pkgs/pyparsing/SPKG.rst @@ -0,0 +1,24 @@ +pyparsing +========= + +Description +----------- + +A Python Parsing Module + +License +------- + +MIT License + + +Upstream Contact +---------------- + +- Author: Paul McGuire +- Home page: http://pyparsing.wikispaces.com + +Dependencies +------------ + +Python diff --git a/build/pkgs/pyparsing/SPKG.txt b/build/pkgs/pyparsing/SPKG.txt deleted file mode 100644 index 6fb6d64513e..00000000000 --- a/build/pkgs/pyparsing/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= pyparsing = - -== Description == - -A Python Parsing Module - -== License == - -MIT License - -== Upstream Contact == - -Author: Paul McGuire -Home page: http://pyparsing.wikispaces.com - -== Dependencies == - -Python - diff --git a/build/pkgs/pysingular/SPKG.txt b/build/pkgs/pysingular/SPKG.rst similarity index 50% rename from build/pkgs/pysingular/SPKG.txt rename to build/pkgs/pysingular/SPKG.rst index 1517ebb2677..7dba8c07cdd 100644 --- a/build/pkgs/pysingular/SPKG.txt +++ b/build/pkgs/pysingular/SPKG.rst @@ -1,15 +1,20 @@ -= PySingular = +PySingular +========== -== Description == +Description +----------- A basic interface to call Singular from python This python module is meant to be used in Singulars Jupyter interface. -== License == +License +------- GPL version 2 or later -== Upstream Contact == -* https://github.com/sebasguts/SingularPython +Upstream Contact +---------------- + +- https://github.com/sebasguts/SingularPython diff --git a/build/pkgs/python2/SPKG.txt b/build/pkgs/python2/SPKG.txt deleted file mode 100644 index b0a72bfa09c..00000000000 --- a/build/pkgs/python2/SPKG.txt +++ /dev/null @@ -1,71 +0,0 @@ -= python = - -== Description == - -Python is a dynamic object-oriented programming language that can be -used for many kinds of software development. It offers strong support -for integration with other languages and tools, comes with extensive -standard libraries, and can be learned in a few days. Many Python -programmers report substantial productivity gains and feel the -language encourages the development of higher quality, more -maintainable code. - -For more details see http://www.python.org - -== License == - -Python is licensed under the PSF LICENSE. The Python license imposes -very few restrictions on what you can do with Python. Most of the -source code is copyrighted by the Python Software Foundation (PSF). A -few files have a different copyright owner, but the same license -applies to all of them. Python's licensing is GPL compatible. - -For more details see http://www.python.org/psf/license/ - -== Upstream Contact == - -There are a large number of community resources. For more details see -http://www.python.org/community/ - -== Dependencies == - - * GNU patch - * readline - * libpng - * SQLite - -== Special Update/Build Instructions == - - * We keep a copy of the stdlib 'random' module in - src/sage/cpython/_py2_random.py. Normally it shouldn't be necessary - to update this, but when upgrading Python make sure to bring over - any security updates from the upstream 'random' module in the unlikely - chance there are any. This might mean updating any "random" test results - that depend on the implementation details of the random module. - * Spaces in SAGE_ROOT aren't yet fully supported by this package, - since we put $SAGE_LOCAL/... into CPPFLAGS and LDFLAGS, which - wouldn't work then. - -=== Patches === - - * socket.patch: Work around an SSL issue. - * permissions.patch: Changes the permission of installed libraries - to 0755 (like any other library) instead of 0555. - * sys_path_security-issue_16202.patch: ensure that the current working - directory or the script directory is prepended to sys.path only if - there is no security risk in doing so. - * ncurses-issue_9665.patch: Fixes Python issue #9665 (by patching configure - and configure.in after running autotools). - * ncurses-issue_14438.patch: Fixes Python issue #14438 (ncurses) - * disable_print_refs_debug.patch: Remove some unused debug output - that breaks doctests. - * no_strict_proto-issue_5755.patch: don't add -Wstrict-prototypes compiler - flag, which isn't valid for C++ (but Python uses the same compiler flags - for C and C++). See http://bugs.python.org/issue5755. - * hashlibfallbacks-issue_18000.patch: Fixed Python issue #18000. - * tinfo.patch: make sure tinfo is correctly linked in when needed on Cygwin. - * uuid-issue_11063.patch: patch from Python issue 11063; reduce uuid - module import side effects and fix thread related issues. - * getcallargs-issue_20108.patch: fix inspect.getcallargs() when the - function has a "func" keyword argument. Needed for @interact from - ipywidgets. diff --git a/build/pkgs/python2/checksums.ini b/build/pkgs/python2/checksums.ini deleted file mode 100644 index 186826b266a..00000000000 --- a/build/pkgs/python2/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=Python-VERSION.tar.xz -sha1=f99348a095ec4a6411c84c0d15343d11920c9724 -md5=a80ae3cc478460b922242f43a1b4094d -cksum=3147661506 diff --git a/build/pkgs/python2/dependencies b/build/pkgs/python2/dependencies deleted file mode 100644 index f6d4a1622ab..00000000000 --- a/build/pkgs/python2/dependencies +++ /dev/null @@ -1,5 +0,0 @@ -zlib readline sqlite libpng bzip2 | xz - ----------- -All lines of this file are ignored except the first. -It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. diff --git a/build/pkgs/python2/package-version.txt b/build/pkgs/python2/package-version.txt deleted file mode 100644 index cf7deab283c..00000000000 --- a/build/pkgs/python2/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -2.7.15.p1 diff --git a/build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch b/build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch deleted file mode 100644 index 1059ca4ad45..00000000000 --- a/build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch +++ /dev/null @@ -1,45 +0,0 @@ -This patch has never been submitted upstream for some reason, but it simply -increases the default number of file descriptors the Python process can have on -Cygwin, which mitigates some issues; see -https://cygwin.com/ml/cygwin/2011-03/msg00651.html ---- a/Modules/selectmodule.c 2012-02-02 22:35:21.835125000 -0500 -+++ b/Modules/selectmodule.c 2012-02-02 22:41:41.210125000 -0500 -@@ -6,6 +6,21 @@ - >= 0. - */ - -+/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined. -+ 64 is too small (too many people have bumped into that limit). -+ Here we boost it. -+ -+ Cygwin also defines FD_SETSIZE to 64, so also increase the limit on -+ Cygwin. We must do this before sys/types.h is included, which otherwise -+ sets FD_SETSIZE to the default. -+ -+ Users who want even more than the boosted limit should #define -+ FD_SETSIZE higher before this; e.g., via compiler /D switch. -+*/ -+#if (defined(MS_WINDOWS) || defined(__CYGWIN__)) && !defined(FD_SETSIZE) -+#define FD_SETSIZE 512 -+#endif -+ - #include "Python.h" - #include - -@@ -16,16 +31,6 @@ - #undef HAVE_BROKEN_POLL - #endif - --/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined. -- 64 is too small (too many people have bumped into that limit). -- Here we boost it. -- Users who want even more than the boosted limit should #define -- FD_SETSIZE higher before this; e.g., via compiler /D switch. --*/ --#if defined(MS_WINDOWS) && !defined(FD_SETSIZE) --#define FD_SETSIZE 512 --#endif -- - #if defined(HAVE_POLL_H) - #include - #elif defined(HAVE_SYS_POLL_H) diff --git a/build/pkgs/python2/patches/cygwin64.patch b/build/pkgs/python2/patches/cygwin64.patch deleted file mode 100644 index 345eeb17322..00000000000 --- a/build/pkgs/python2/patches/cygwin64.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/Modules/_ctypes/libffi/src/x86/ffi.c 2013-02-11 13:24:18.000000000 -0600 -+++ b/Modules/_ctypes/libffi/src/x86/ffi.c 2013-03-12 23:22:18.267762700 -0500 -@@ -28,7 +28,7 @@ - DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - --#if !defined(__x86_64__) || defined(_WIN64) -+#if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__) - - #ifdef _WIN64 - #include ---- a/Modules/_ctypes/libffi/src/x86/win64.S 2013-02-11 13:24:18.000000000 -0600 -+++ b/Modules/_ctypes/libffi/src/x86/win64.S 2013-03-13 04:50:09.526614600 -0500 -@@ -295,7 +295,7 @@ SYMBOL_NAME(ffi_closure_win64): - mov %rax, %rcx # context is first parameter - mov %rsp, %rdx # stack is second parameter - add $48, %rdx # point to start of arguments -- mov $SYMBOL_NAME(ffi_closure_win64_inner), %rax -+ lea SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax - callq *%rax # call the real closure function - add $40, %rsp - movq %rax, %xmm0 # If the closure returned a float, ---- a/Modules/_ctypes/libffi/fficonfig.py.in 2013-05-12 05:32:49.000000000 +0200 -+++ b/Modules/_ctypes/libffi/fficonfig.py.in 2013-06-03 22:28:06.617994762 +0200 -@@ -23,6 +23,7 @@ - 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], - 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'], - 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'], -+ 'X86_WIN64': ['src/x86/ffi.c', 'src/x86/win64.S'], - 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'], - 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'], - 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], diff --git a/build/pkgs/python2/patches/descr_ref-issue_25750.patch b/build/pkgs/python2/patches/descr_ref-issue_25750.patch deleted file mode 100644 index b55cf58a2d2..00000000000 --- a/build/pkgs/python2/patches/descr_ref-issue_25750.patch +++ /dev/null @@ -1,58 +0,0 @@ -When calling tp_descr_get(self, obj, type), make sure that we own a reference to "self" - -diff -ru Python-2.7.9/Objects/typeobject.c Python-2.7.9-fixed//Objects/typeobject.c ---- Python-2.7.9/Objects/typeobject.c 2014-12-10 16:59:57.000000000 +0100 -+++ Python-2.7.9-fixed//Objects/typeobject.c 2015-11-27 20:39:58.276156800 +0100 -@@ -2542,6 +2542,7 @@ - PyTypeObject *metatype = Py_TYPE(type); - PyObject *meta_attribute, *attribute; - descrgetfunc meta_get; -+ PyObject* res; - - if (!PyString_Check(name)) { - PyErr_Format(PyExc_TypeError, -@@ -2563,6 +2564,7 @@ - meta_attribute = _PyType_Lookup(metatype, name); - - if (meta_attribute != NULL) { -+ Py_INCREF(meta_attribute); - meta_get = Py_TYPE(meta_attribute)->tp_descr_get; - - if (meta_get != NULL && PyDescr_IsData(meta_attribute)) { -@@ -2570,10 +2572,11 @@ - * writes. Assume the attribute is not overridden in - * type's tp_dict (and bases): call the descriptor now. - */ -- return meta_get(meta_attribute, (PyObject *)type, -+ res = meta_get(meta_attribute, (PyObject *)type, - (PyObject *)metatype); -+ Py_DECREF(meta_attribute); -+ return res; - } -- Py_INCREF(meta_attribute); - } - - /* No data descriptor found on metatype. Look in tp_dict of this -@@ -2581,6 +2584,7 @@ - attribute = _PyType_Lookup(type, name); - if (attribute != NULL) { - /* Implement descriptor functionality, if any */ -+ Py_INCREF(attribute); - descrgetfunc local_get = Py_TYPE(attribute)->tp_descr_get; - - Py_XDECREF(meta_attribute); -@@ -2588,11 +2592,12 @@ - if (local_get != NULL) { - /* NULL 2nd argument indicates the descriptor was - * found on the target object itself (or a base) */ -- return local_get(attribute, (PyObject *)NULL, -+ res = local_get(attribute, (PyObject *)NULL, - (PyObject *)type); -+ Py_DECREF(attribute); -+ return res; - } - -- Py_INCREF(attribute); - return attribute; - } - diff --git a/build/pkgs/python2/patches/getcallargs-issue_20108.patch b/build/pkgs/python2/patches/getcallargs-issue_20108.patch deleted file mode 100644 index 5756041c93f..00000000000 --- a/build/pkgs/python2/patches/getcallargs-issue_20108.patch +++ /dev/null @@ -1,26 +0,0 @@ -# HG changeset patch -# User Benjamin Peterson -# Date 1388687048 21600 -# Node ID b0d472e3ff42de9fd2b1a702f5874202c2d2b27f -# Parent 8083b887068667a7b62443d56de310e7fe10d3df -avoid parameter name clash (closes #20108) - -diff -ru a/Lib/inspect.py b/Lib/inspect.py ---- a/Lib/inspect.py 2015-05-23 18:09:04.000000000 +0200 -+++ b/Lib/inspect.py 2016-09-21 11:34:16.491938401 +0200 -@@ -892,12 +892,14 @@ - specs.append(formatvarkw(varkw) + formatvalue(locals[varkw])) - return '(' + string.join(specs, ', ') + ')' - --def getcallargs(func, *positional, **named): -+def getcallargs(*func_and_positional, **named): - """Get the mapping of arguments to values. - - A dict is returned, with keys the function argument names (including the - names of the * and ** arguments, if any), and values the respective bound - values from 'positional' and 'named'.""" -+ func = func_and_positional[0] -+ positional = func_and_positional[1:] - args, varargs, varkw, defaults = getargspec(func) - f_name = func.__name__ - arg2value = {} diff --git a/build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch b/build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch deleted file mode 100644 index f9a2de2fdc1..00000000000 --- a/build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -ur src/Lib/test/test_hashlib.py new/Lib/test/test_hashlib.py ---- a/Lib/test/test_hashlib.py 2013-05-12 04:32:46.000000000 +0100 -+++ b/Lib/test/test_hashlib.py 2013-05-18 12:24:04.055336404 +0100 -@@ -21,9 +21,6 @@ - from test import test_support - from test.test_support import _4G, precisionbigmemtest - --# Were we compiled --with-pydebug or with #define Py_DEBUG? --COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') -- - - def hexstr(s): - import string -@@ -40,7 +37,7 @@ - 'sha224', 'SHA224', 'sha256', 'SHA256', - 'sha384', 'SHA384', 'sha512', 'SHA512' ) - -- _warn_on_extension_import = COMPILED_WITH_PYDEBUG -+ _warn_on_extension_import = True - - def _conditional_import_module(self, module_name): - """Import a module and return a reference to it or None on failure.""" -diff -ur src/setup.py new/setup.py ---- a/setup.py 2013-05-12 04:32:54.000000000 +0100 -+++ b/setup.py 2013-05-18 12:22:04.417057535 +0100 -@@ -29,9 +29,6 @@ - return sys.platform - host_platform = get_platform() - --# Were we compiled --with-pydebug or with #define Py_DEBUG? --COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) -- - # This global variable is used to hold the list of modules to be disabled. - disabled_module_list = [] - -@@ -854,21 +851,18 @@ - print ("warning: openssl 0x%08x is too old for _hashlib" % - openssl_ver) - missing.append('_hashlib') -- if COMPILED_WITH_PYDEBUG or not have_usable_openssl: -- # The _sha module implements the SHA1 hash algorithm. -- exts.append( Extension('_sha', ['shamodule.c']) ) -- # The _md5 module implements the RSA Data Security, Inc. MD5 -- # Message-Digest Algorithm, described in RFC 1321. The -- # necessary files md5.c and md5.h are included here. -- exts.append( Extension('_md5', -- sources = ['md5module.c', 'md5.c'], -- depends = ['md5.h']) ) -- -- min_sha2_openssl_ver = 0x00908000 -- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver: -- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash -- exts.append( Extension('_sha256', ['sha256module.c']) ) -- exts.append( Extension('_sha512', ['sha512module.c']) ) -+ -+ # We always compile these even when OpenSSL is available (issue #14693). -+ # It's harmless and the object code is tiny (40-50 KB per module, -+ # only loaded when actually used). -+ exts.append( Extension('_sha256', ['sha256module.c'], -+ depends=['hashlib.h']) ) -+ exts.append( Extension('_sha512', ['sha512module.c'], -+ depends=['hashlib.h']) ) -+ exts.append( Extension('_md5', ['md5module.c', 'md5.c'], -+ depends=['hashlib.h']) ) -+ exts.append( Extension('_sha', ['shamodule.c'], -+ depends=['hashlib.h']) ) - - # Modules that provide persistent dictionary-like semantics. You will - # probably want to arrange for at least one of them to be available on diff --git a/build/pkgs/python2/patches/linux_linking_issue_25229.patch b/build/pkgs/python2/patches/linux_linking_issue_25229.patch deleted file mode 100644 index 4d9fb35cc03..00000000000 --- a/build/pkgs/python2/patches/linux_linking_issue_25229.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py -index 3af540e..625f155 100644 ---- a/Lib/distutils/unixccompiler.py -+++ b/Lib/distutils/unixccompiler.py -@@ -238,7 +238,7 @@ class UnixCCompiler(CCompiler): - return ["+s", "-L" + dir] - elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5": - return ["-rpath", dir] -- elif self._is_gcc(compiler): -+ elif sys.platform[:5] == "linux" or self._is_gcc(compiler): - return "-Wl,-R" + dir - else: - return "-R" + dir diff --git a/build/pkgs/python2/patches/macos_no_include.patch b/build/pkgs/python2/patches/macos_no_include.patch deleted file mode 100644 index 0003924e13c..00000000000 --- a/build/pkgs/python2/patches/macos_no_include.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/configure b/configure -index 4a047e6..e3c8bdf 100755 ---- a/configure -+++ b/configure -@@ -6102,6 +6102,12 @@ $as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } - Darwin*) - # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd - # used to be here, but non-Apple gcc doesn't accept them. -+ -+cat >>confdefs.h <<_ACEOF -+#define Py_MACOS_SYSROOT `xcrun --show-sdk-path` -+_ACEOF -+ -+ - if test "${CC}" = gcc - then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 -diff --git a/configure.ac b/configure.ac -index 913d546..6cb1f28 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1155,6 +1155,7 @@ yes) - Darwin*) - # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd - # used to be here, but non-Apple gcc doesn't accept them. -+ AC_DEFINE_UNQUOTED([Py_MACOS_SYSROOT], [`xcrun --show-sdk-path`], [Get the root dir of XCode]) - if test "${CC}" = gcc - then - AC_MSG_CHECKING(which compiler should be used) -diff --git a/pyconfig.h.in b/pyconfig.h.in -index 11c4a66..a4e12a2 100644 ---- a/pyconfig.h.in -+++ b/pyconfig.h.in -@@ -1016,6 +1016,9 @@ - /* Defined if Python is built as a shared library. */ - #undef Py_ENABLE_SHARED - -+/* Get the root dir of XCode */ -+#undef Py_MACOS_SYSROOT -+ - /* Define as the size of the unicode type. */ - #undef Py_UNICODE_SIZE - -diff --git a/setup.py b/setup.py -index 33cecc6..5d6a411 100644 ---- a/setup.py -+++ b/setup.py -@@ -50,7 +50,7 @@ def macosx_sdk_root(): - cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) - if m is None: -- sysroot = '/' -+ sysroot = sysconfig.get_config_var('Py_MACOS_SYSROOT') - else: - sysroot = m.group(1) - return sysroot -@@ -92,7 +92,6 @@ def find_file(filename, std_dirs, paths): - # Check the additional directories - for dir in paths: - f = os.path.join(dir, filename) -- - if host_platform == 'darwin' and is_macosx_sdk_path(dir): - f = os.path.join(sysroot, dir[1:], filename) - -@@ -557,6 +556,7 @@ class PyBuildExt(build_ext): - # NOTE: using shlex.split would technically be more correct, but - # also gives a bootstrap problem. Let's hope nobody uses directories - # with whitespace in the name to store libraries. -+ inc_dirs += ['/usr/include'] - cflags, ldflags = sysconfig.get_config_vars( - 'CFLAGS', 'LDFLAGS') - for item in cflags.split(): diff --git a/build/pkgs/python2/patches/ncurses-issue_14438.patch b/build/pkgs/python2/patches/ncurses-issue_14438.patch deleted file mode 100644 index e2500d93401..00000000000 --- a/build/pkgs/python2/patches/ncurses-issue_14438.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ru a/Include/py_curses.h b/Include/py_curses.h ---- a/Include/py_curses.h 2018-04-15 00:06:30.000000000 +0200 -+++ b/Include/py_curses.h 2018-04-19 14:50:07.967630196 +0200 -@@ -12,6 +12,13 @@ - #endif - #endif /* __APPLE__ */ - -+#ifdef __CYGWIN__ -+/* the following define is necessary for Cygwin; without it, the -+ Cygwin-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python -+ can't get at the WINDOW flags field. */ -+#define NCURSES_INTERNALS -+#endif /* __CYGWIN__ */ -+ - #ifdef __FreeBSD__ - /* - ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards diff --git a/build/pkgs/python2/patches/ncurses-issue_9665.patch b/build/pkgs/python2/patches/ncurses-issue_9665.patch deleted file mode 100644 index e0d22792a3a..00000000000 --- a/build/pkgs/python2/patches/ncurses-issue_9665.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ur src.orig/configure.ac src/configure.ac ---- src.orig/configure.ac 2012-09-30 19:16:16.208133911 +0200 -+++ src/configure.ac 2012-09-30 19:15:12.800599068 +0200 -@@ -1245,6 +1245,9 @@ - OSF*) - BASECFLAGS="$BASECFLAGS -mieee" - ;; -+ CYGWIN*) -+ BASECFLAGS="-I/usr/include/ncurses $BASECFLAGS" -+ ;; - esac - ;; - -diff -ur src.orig/configure src/configure ---- src.orig/configure 2012-09-30 19:16:16.216133852 +0200 -+++ src/configure 2012-09-30 19:15:44.876363826 +0200 -@@ -6146,6 +6146,9 @@ - OSF*) - BASECFLAGS="$BASECFLAGS -mieee" - ;; -+ CYGWIN*) -+ BASECFLAGS="-I/usr/include/ncurses $BASECFLAGS" -+ ;; - esac - ;; - diff --git a/build/pkgs/python2/patches/no_strict_proto-issue_5755.patch b/build/pkgs/python2/patches/no_strict_proto-issue_5755.patch deleted file mode 100644 index 2f83403b36a..00000000000 --- a/build/pkgs/python2/patches/no_strict_proto-issue_5755.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ru src/configure.ac b/configure.ac ---- src/configure.ac 2013-04-06 16:02:41.000000000 +0200 -+++ b/configure.ac 2013-04-11 18:11:17.947929754 +0200 -@@ -1051,9 +1051,6 @@ - then - case $GCC in - yes) -- if test "$CC" != 'g++' ; then -- STRICT_PROTO="-Wstrict-prototypes" -- fi - # For gcc 4.x we need to use -fwrapv so lets check if its supported - if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then - WRAP="-fwrapv" -diff -ru src/configure b/configure ---- src/configure 2013-04-06 16:02:41.000000000 +0200 -+++ b/configure 2013-04-11 18:11:25.737930322 +0200 -@@ -5931,9 +5931,6 @@ - then - case $GCC in - yes) -- if test "$CC" != 'g++' ; then -- STRICT_PROTO="-Wstrict-prototypes" -- fi - # For gcc 4.x we need to use -fwrapv so lets check if its supported - if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then - WRAP="-fwrapv" diff --git a/build/pkgs/python2/patches/permissions.patch b/build/pkgs/python2/patches/permissions.patch deleted file mode 100644 index d982758d9e1..00000000000 --- a/build/pkgs/python2/patches/permissions.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src.orig/Makefile.pre.in 2013-04-06 15:02:34.000000000 +0100 -+++ src/Makefile.pre.in 2013-04-07 12:59:46.675111329 +0100 -@@ -59,7 +59,7 @@ - # Shared libraries must be installed with executable mode on some systems; - # rather than figuring out exactly which, we always give them executable mode. - # Also, making them read-only seems to be a good idea... --INSTALL_SHARED= ${INSTALL} -m 555 -+INSTALL_SHARED= ${INSTALL} -m 755 - - MKDIR_P= @MKDIR_P@ - diff --git a/build/pkgs/python2/patches/re_match_index-issue_27177.patch b/build/pkgs/python2/patches/re_match_index-issue_27177.patch deleted file mode 100644 index 0a6997642c7..00000000000 --- a/build/pkgs/python2/patches/re_match_index-issue_27177.patch +++ /dev/null @@ -1,37 +0,0 @@ -Fix http://bugs.python.org/issue27177 -diff -ru Python-2.7.10/Lib/test/test_index.py Python-2.7.10-fix-re//Lib/test/test_index.py ---- Python-2.7.10/Lib/test/test_index.py 2015-05-23 18:09:11.000000000 +0200 -+++ Python-2.7.10-fix-re//Lib/test/test_index.py 2016-06-01 15:50:07.274162354 +0200 -@@ -246,6 +246,20 @@ - self.assertEqual(xrange(1, 20)[n], 6) - self.assertEqual(xrange(1, 20).__getitem__(n), 6) - -+class MatchGroupTestCase(unittest.TestCase): -+ -+ def test_re_group(self): -+ n = newstyle() -+ n.ind = 0 -+ o = oldstyle() -+ o.ind = 1 -+ -+ import re -+ p = re.compile('(a)(b)') -+ m = p.match('ab') -+ self.assertEqual(m.group(0), m.group(n)) -+ self.assertEqual(m.group(1), m.group(o)) -+ - class OverflowTestCase(unittest.TestCase): - - def setUp(self): -diff -ru Python-2.7.10/Modules/_sre.c Python-2.7.10-fix-re//Modules/_sre.c ---- Python-2.7.10/Modules/_sre.c 2015-05-23 18:09:19.000000000 +0200 -+++ Python-2.7.10-fix-re//Modules/_sre.c 2016-06-01 15:50:58.614165047 +0200 -@@ -3303,6 +3303,8 @@ - - if (PyInt_Check(index) || PyLong_Check(index)) - return PyInt_AsSsize_t(index); -+ if (PyIndex_Check(index)) -+ return PyNumber_AsSsize_t(index, PyExc_IndexError); - - i = -1; - diff --git a/build/pkgs/python2/patches/socket.patch b/build/pkgs/python2/patches/socket.patch deleted file mode 100644 index 27e4dcb5c33..00000000000 --- a/build/pkgs/python2/patches/socket.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ru a/Lib/socket.py b/Lib/socket.py ---- a/Lib/socket.py 2018-04-15 00:06:30.000000000 +0200 -+++ b/Lib/socket.py 2018-04-19 14:49:27.227076923 +0200 -@@ -51,6 +51,9 @@ - - try: - import _ssl -+ from _ssl import SSLError as sslerror -+ # we try this second line since sometimes the first -+ # passes even though the module isn't there - except ImportError: - # no SSL support - pass -@@ -64,7 +67,6 @@ - return _realssl.sslwrap_simple(sock, keyfile, certfile) - - # we need to import the same constants we used to... -- from _ssl import SSLError as sslerror - from _ssl import \ - RAND_add, \ - RAND_status, \ diff --git a/build/pkgs/python2/patches/tinfo.patch b/build/pkgs/python2/patches/tinfo.patch deleted file mode 100644 index bc152f51622..00000000000 --- a/build/pkgs/python2/patches/tinfo.patch +++ /dev/null @@ -1,123 +0,0 @@ -diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py -index 62506a6..f80230c 100644 ---- a/Lib/distutils/ccompiler.py -+++ b/Lib/distutils/ccompiler.py -@@ -842,9 +842,9 @@ main (int argc, char **argv) { - def library_filename(self, libname, lib_type='static', # or 'shared' - strip_dir=0, output_dir=''): - assert output_dir is not None -- if lib_type not in ("static", "shared", "dylib", "xcode_stub"): -+ if lib_type not in ("static", "shared", "dylib", "xcode_stub", "import"): - raise ValueError, ("""'lib_type' must be "static", "shared", """ -- """"dylib", or "xcode_stub".""") -+ """"dylib", "xcode_stub" or "import".""") - fmt = getattr(self, lib_type + "_lib_format") - ext = getattr(self, lib_type + "_lib_extension") - -diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py -index 4c35676..54f8356 100644 ---- a/Lib/distutils/unixccompiler.py -+++ b/Lib/distutils/unixccompiler.py -@@ -80,10 +80,12 @@ class UnixCCompiler(CCompiler): - shared_lib_extension = ".so" - dylib_lib_extension = ".dylib" - xcode_stub_lib_extension = ".tbd" -- static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" -+ import_lib_extension = ".dll.a" -+ import_lib_format = static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" - xcode_stub_lib_format = dylib_lib_format - if sys.platform == "cygwin": - exe_extension = ".exe" -+ shared_lib_extension = ".dll" - - def preprocess(self, source, - output_file=None, macros=None, include_dirs=None, -@@ -249,6 +251,7 @@ class UnixCCompiler(CCompiler): - dylib_f = self.library_filename(lib, lib_type='dylib') - xcode_stub_f = self.library_filename(lib, lib_type='xcode_stub') - static_f = self.library_filename(lib, lib_type='static') -+ import_f = self.library_filename(lib, lib_type='import') - - if sys.platform == 'darwin': - # On OSX users can specify an alternate SDK using -@@ -279,6 +282,7 @@ class UnixCCompiler(CCompiler): - - - for dir in dirs: -+ implib = os.path.join(dir, import_f) - shared = os.path.join(dir, shared_f) - dylib = os.path.join(dir, dylib_f) - static = os.path.join(dir, static_f) -@@ -297,7 +301,9 @@ class UnixCCompiler(CCompiler): - # data to go on: GCC seems to prefer the shared library, so I'm - # assuming that *all* Unix C compilers do. And of course I'm - # ignoring even GCC's "-static" option. So sue me. -- if os.path.exists(dylib): -+ if os.path.exists(implib): -+ return implib -+ elif os.path.exists(dylib): - return dylib - elif os.path.exists(xcode_stub): - return xcode_stub -@@ -308,3 +314,22 @@ class UnixCCompiler(CCompiler): - - # Oops, didn't find it in *any* of 'dirs' - return None -+ -+ def implib_to_dll(self, dirs, implib, debug=0): -+ fp = os.popen("dlltool -I %s" % implib) -+ dlltool_output = fp.readlines() -+ ret = fp.close() -+ -+ if ret is None or ret >> 8 == 0: -+ for ln in dlltool_output: -+ for dir in dirs: -+ dll = os.path.join(dir, ln.rstrip('\n')) -+ # We're second-guessing the linker here, with not much hard -+ # data to go on: GCC seems to prefer the shared library, so I'm -+ # assuming that *all* Unix C compilers do. And of course I'm -+ # ignoring even GCC's "-static" option. So sue me. -+ if os.path.exists(dll): -+ return dll -+ -+ # Oops, didn't find it in *any* of 'dirs' -+ return None -diff --git a/setup.py b/setup.py -index aa08ada..f41d200 100644 ---- a/setup.py -+++ b/setup.py -@@ -726,8 +726,12 @@ class PyBuildExt(build_ext): - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') - readline_termcap_library = "" - curses_library = "" -- # Determine if readline is already linked against curses or tinfo. -+ # Determine if readline is linked against curses or tinfo. - if do_readline and find_executable('ldd'): -+ # On Cygwin we have to find out which dll the implib point to -+ if host_platform == "cygwin" and find_executable('dlltool'): -+ do_readline = self.compiler.implib_to_dll(os.getenv('PATH').split(os.pathsep) + lib_dirs, do_readline) -+ - fp = os.popen("ldd %s" % do_readline) - ldd_output = fp.readlines() - ret = fp.close() -@@ -778,7 +782,10 @@ class PyBuildExt(build_ext): - - readline_libs = ['readline'] - if readline_termcap_library: -- pass # Issue 7384: Already linked against curses or tinfo. -+ if host_platform != "cygwin": -+ pass # Issue 7384: Already linked against curses or tinfo. -+ else: -+ readline_libs.append(readline_termcap_library) - elif curses_library: - readline_libs.append(curses_library) - elif self.compiler.find_library_file(lib_dirs + -@@ -1370,6 +1377,8 @@ class PyBuildExt(build_ext): - # _curses_panel.so must link with panelw. - panel_library = 'panelw' - curses_libs = [curses_library] -+ if readline_termcap_library == 'tinfo' and host_platform == "cygwin": -+ curses_libs.append(readline_termcap_library) - curses_incs = find_file('curses.h', inc_dirs, - [os.path.join(d, 'ncursesw') for d in inc_dirs]) - exts.append( Extension('_curses', ['_cursesmodule.c'], diff --git a/build/pkgs/python2/patches/trashcan_heap_type.patch b/build/pkgs/python2/patches/trashcan_heap_type.patch deleted file mode 100644 index b8f3ead3968..00000000000 --- a/build/pkgs/python2/patches/trashcan_heap_type.patch +++ /dev/null @@ -1,64 +0,0 @@ -https://github.com/python/cpython/pull/12725 - -commit 6f8de0b75e0ca987cf5e734cf9c4bb91762efcf3 -Author: Jeroen Demeyer -Date: Mon Apr 8 14:08:37 2019 +0200 - - bpo-36556: trashcan should not cause duplicated __del__ - -diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py -index 7e47b2d..3e4d0f9 100644 ---- a/Lib/test/test_gc.py -+++ b/Lib/test/test_gc.py -@@ -307,6 +307,24 @@ class GCTests(unittest.TestCase): - v = {1: v, 2: Ouch()} - gc.disable() - -+ def test_no_double_del(self): -+ # bpo-36556: instances of heap types should be deallocated once, -+ # even if the trashcan and __del__ are involved -+ class ObjectCounter(object): -+ count = 0 -+ def __init__(self): -+ type(self).count += 1 -+ def __del__(self): -+ # create temporary involving self, whose deallocation -+ # uses the trashcan -+ L = [self] -+ type(self).count -= 1 -+ L = None -+ for i in range(10000): -+ L = (L, ObjectCounter()) -+ del L -+ self.assertEqual(ObjectCounter.count, 0) -+ - @unittest.skipUnless(threading, "test meaningless on builds without threads") - def test_trashcan_threads(self): - # Issue #13992: trashcan mechanism should be thread-safe -diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-04-08-14-32-28.bpo-36556.lp-8oV.rst b/Misc/NEWS.d/next/Core and Builtins/2019-04-08-14-32-28.bpo-36556.lp-8oV.rst -new file mode 100644 -index 0000000..496bdc5 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core and Builtins/2019-04-08-14-32-28.bpo-36556.lp-8oV.rst -@@ -0,0 +1,2 @@ -+When deleting highly nested objects (where the trashcan mechanism is -+involved), it is less likely that ``__del__`` is called multiple times. -diff --git a/Objects/typeobject.c b/Objects/typeobject.c -index 844fb00..43b35b1 100644 ---- a/Objects/typeobject.c -+++ b/Objects/typeobject.c -@@ -917,6 +917,14 @@ subtype_clear(PyObject *self) - return 0; - } - -+/* bpo-36556: lower the trashcan recursion limit for heap types: this gives -+ * __del__ 10 additional stack frames to work with. This makes it less likely -+ * that the trashcan is used in __del__. Otherwise, an object might seemingly -+ * be resurrected by __del__ when it's still referenced by an object in the -+ * trashcan. */ -+#undef PyTrash_UNWIND_LEVEL -+#define PyTrash_UNWIND_LEVEL 40 -+ - static void - subtype_dealloc(PyObject *self) - { diff --git a/build/pkgs/python2/patches/trashcan_subclass.patch b/build/pkgs/python2/patches/trashcan_subclass.patch deleted file mode 100644 index 401bdb5b865..00000000000 --- a/build/pkgs/python2/patches/trashcan_subclass.patch +++ /dev/null @@ -1,496 +0,0 @@ -See https://github.com/python/cpython/pull/12699 - -commit 324fc4bd0b1fa9cb9e60ab58f8852e8b7fdd8689 -Author: Jeroen Demeyer -Date: Wed Feb 13 15:12:48 2019 +0100 - - [2.7] bpo-35983: skip trashcan for subclasses (GH-11841) - -diff --git a/Include/object.h b/Include/object.h -index 807b241..cc2f3c5 100644 ---- a/Include/object.h -+++ b/Include/object.h -@@ -969,11 +969,11 @@ times. - - When deallocating a container object, it's possible to trigger an unbounded - chain of deallocations, as each Py_DECREF in turn drops the refcount on "the --next" object in the chain to 0. This can easily lead to stack faults, and -+next" object in the chain to 0. This can easily lead to stack overflows, - especially in threads (which typically have less stack space to work with). - --A container object that participates in cyclic gc can avoid this by --bracketing the body of its tp_dealloc function with a pair of macros: -+A container object can avoid this by bracketing the body of its tp_dealloc -+function with a pair of macros: - - static void - mytype_dealloc(mytype *p) -@@ -981,14 +981,14 @@ mytype_dealloc(mytype *p) - ... declarations go here ... - - PyObject_GC_UnTrack(p); // must untrack first -- Py_TRASHCAN_SAFE_BEGIN(p) -+ Py_TRASHCAN_BEGIN(p, mytype_dealloc) - ... The body of the deallocator goes here, including all calls ... - ... to Py_DECREF on contained objects. ... -- Py_TRASHCAN_SAFE_END(p) -+ Py_TRASHCAN_END // there should be no code after this - } - - CAUTION: Never return from the middle of the body! If the body needs to --"get out early", put a label immediately before the Py_TRASHCAN_SAFE_END -+"get out early", put a label immediately before the Py_TRASHCAN_END - call, and goto it. Else the call-depth counter (see below) will stay - above 0 forever, and the trashcan will never get emptied. - -@@ -1004,6 +1004,12 @@ notices this, and calls another routine to deallocate all the objects that - may have been added to the list of deferred deallocations. In effect, a - chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces, - with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL. -+ -+Since the tp_dealloc of a subclass typically calls the tp_dealloc of the base -+class, we need to ensure that the trashcan is only triggered on the tp_dealloc -+of the actual class being deallocated. Otherwise we might end up with a -+partially-deallocated object. To check this, the tp_dealloc function must be -+passed as second argument to Py_TRASHCAN_BEGIN(). - */ - - /* This is the old private API, invoked by the macros before 2.7.4. -@@ -1020,26 +1026,38 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); - #define PyTrash_UNWIND_LEVEL 50 - - /* Note the workaround for when the thread state is NULL (issue #17703) */ --#define Py_TRASHCAN_SAFE_BEGIN(op) \ -+#define Py_TRASHCAN_BEGIN_CONDITION(op, cond) \ - do { \ -- PyThreadState *_tstate = PyThreadState_GET(); \ -- if (!_tstate || \ -- _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ -- if (_tstate) \ -- ++_tstate->trash_delete_nesting; -- /* The body of the deallocator is here. */ --#define Py_TRASHCAN_SAFE_END(op) \ -- if (_tstate) { \ -- --_tstate->trash_delete_nesting; \ -- if (_tstate->trash_delete_later \ -- && _tstate->trash_delete_nesting <= 0) \ -- _PyTrash_thread_destroy_chain(); \ -+ PyThreadState *_tstate = NULL; \ -+ /* If "cond" is false, then _tstate remains NULL and the deallocator \ -+ * is run normally without involving the trashcan */ \ -+ if (cond && (_tstate = PyThreadState_GET()) != NULL) { \ -+ if (_tstate->trash_delete_nesting >= PyTrash_UNWIND_LEVEL) { \ -+ /* Store the object (to be deallocated later) and jump past \ -+ * Py_TRASHCAN_END, skipping the body of the deallocator */ \ -+ _PyTrash_thread_deposit_object((PyObject*)op); \ -+ break; \ - } \ -+ ++_tstate->trash_delete_nesting; \ -+ } -+ /* The body of the deallocator is here. */ -+#define Py_TRASHCAN_END \ -+ if (_tstate) { \ -+ --_tstate->trash_delete_nesting; \ -+ if (_tstate->trash_delete_later && _tstate->trash_delete_nesting <= 0) \ -+ _PyTrash_thread_destroy_chain(); \ - } \ -- else \ -- _PyTrash_thread_deposit_object((PyObject*)op); \ - } while (0); - -+#define Py_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_BEGIN_CONDITION(op, \ -+ Py_TYPE(op)->tp_dealloc == (destructor)(dealloc)) -+ -+/* For backwards compatibility, these macros enable the trashcan -+ * unconditionally */ -+#define Py_TRASHCAN_SAFE_BEGIN(op) Py_TRASHCAN_BEGIN_CONDITION(op, 1) -+#define Py_TRASHCAN_SAFE_END(op) Py_TRASHCAN_END -+ -+ - #ifdef __cplusplus - } - #endif -diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 5eb3f7d..7c63c55 100644 ---- a/Lib/test/test_capi.py -+++ b/Lib/test/test_capi.py -@@ -22,6 +22,41 @@ class CAPITest(unittest.TestCase): - def test_buildvalue_N(self): - _testcapi.test_buildvalue_N() - -+ def test_trashcan_subclass(self): -+ # bpo-35983: Check that the trashcan mechanism for "list" is NOT -+ # activated when its tp_dealloc is being called by a subclass -+ from _testcapi import MyList -+ L = None -+ for i in range(1000): -+ L = MyList((L,)) -+ -+ def test_trashcan_python_class(self): -+ # Check that the trashcan mechanism works properly for a Python -+ # subclass of a class using the trashcan (list in this test) -+ class PyList(list): -+ # Count the number of PyList instances to verify that there is -+ # no memory leak -+ num = 0 -+ def __init__(self, *args): -+ __class__.num += 1 -+ super().__init__(*args) -+ def __del__(self): -+ __class__.num -= 1 -+ -+ for parity in (0, 1): -+ L = None -+ # We need in the order of 2**20 iterations here such that a -+ # typical 8MB stack would overflow without the trashcan. -+ for i in range(2**20): -+ L = PyList((L,)) -+ L.attr = i -+ if parity: -+ # Add one additional nesting layer -+ L = (L,) -+ self.assertGreater(PyList.num, 0) -+ del L -+ self.assertEqual(PyList.num, 0) -+ - - @unittest.skipUnless(threading, 'Threading required for this test.') - class TestPendingCalls(unittest.TestCase): -diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-02-13-16-47-19.bpo-35983.bNxsXv.rst b/Misc/NEWS.d/next/Core and Builtins/2019-02-13-16-47-19.bpo-35983.bNxsXv.rst -new file mode 100644 -index 0000000..1138df6 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core and Builtins/2019-02-13-16-47-19.bpo-35983.bNxsXv.rst -@@ -0,0 +1,3 @@ -+Added new trashcan macros to deal with a double deallocation that could occur -+when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class -+and that base class uses the trashcan mechanism. Patch by Jeroen Demeyer. -diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c -index 67488e7..fb866fa 100644 ---- a/Modules/_testcapimodule.c -+++ b/Modules/_testcapimodule.c -@@ -2944,6 +2944,76 @@ static PyTypeObject test_structmembersType = { - }; - - -+/* Test bpo-35983: create a subclass of "list" which checks that instances -+ * are not deallocated twice */ -+ -+typedef struct { -+ PyListObject list; -+ int deallocated; -+} MyListObject; -+ -+static PyObject * -+MyList_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -+{ -+ PyObject* op = PyList_Type.tp_new(type, args, kwds); -+ ((MyListObject*)op)->deallocated = 0; -+ return op; -+} -+ -+void -+MyList_dealloc(MyListObject* op) -+{ -+ if (op->deallocated) { -+ /* We cannot raise exceptions here but we still want the testsuite -+ * to fail when we hit this */ -+ Py_FatalError("MyList instance deallocated twice"); -+ } -+ op->deallocated = 1; -+ PyList_Type.tp_dealloc((PyObject *)op); -+} -+ -+static PyTypeObject MyList_Type = { -+ PyVarObject_HEAD_INIT(NULL, 0) -+ "MyList", -+ sizeof(MyListObject), -+ 0, -+ (destructor)MyList_dealloc, /* tp_dealloc */ -+ 0, /* tp_print */ -+ 0, /* tp_getattr */ -+ 0, /* tp_setattr */ -+ 0, /* tp_reserved */ -+ 0, /* tp_repr */ -+ 0, /* tp_as_number */ -+ 0, /* tp_as_sequence */ -+ 0, /* tp_as_mapping */ -+ 0, /* tp_hash */ -+ 0, /* tp_call */ -+ 0, /* tp_str */ -+ 0, /* tp_getattro */ -+ 0, /* tp_setattro */ -+ 0, /* tp_as_buffer */ -+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ -+ 0, /* tp_doc */ -+ 0, /* tp_traverse */ -+ 0, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ 0, /* tp_iter */ -+ 0, /* tp_iternext */ -+ 0, /* tp_methods */ -+ 0, /* tp_members */ -+ 0, /* tp_getset */ -+ 0, /* &PyList_Type */ /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ 0, /* tp_init */ -+ 0, /* tp_alloc */ -+ MyList_new, /* tp_new */ -+}; -+ -+ - PyMODINIT_FUNC - init_testcapi(void) - { -@@ -2961,6 +3031,12 @@ init_testcapi(void) - test_capi to automatically call this */ - PyModule_AddObject(m, "_test_structmembersType", (PyObject *)&test_structmembersType); - -+ MyList_Type.tp_base = &PyList_Type; -+ if (PyType_Ready(&MyList_Type) < 0) -+ return NULL; -+ Py_INCREF(&MyList_Type); -+ PyModule_AddObject(m, "MyList", (PyObject *)&MyList_Type); -+ - PyModule_AddObject(m, "CHAR_MAX", PyInt_FromLong(CHAR_MAX)); - PyModule_AddObject(m, "CHAR_MIN", PyInt_FromLong(CHAR_MIN)); - PyModule_AddObject(m, "UCHAR_MAX", PyInt_FromLong(UCHAR_MAX)); -diff --git a/Objects/descrobject.c b/Objects/descrobject.c -index 8d6e6e3..38f11e9 100644 ---- a/Objects/descrobject.c -+++ b/Objects/descrobject.c -@@ -940,11 +940,11 @@ static void - wrapper_dealloc(wrapperobject *wp) - { - PyObject_GC_UnTrack(wp); -- Py_TRASHCAN_SAFE_BEGIN(wp) -+ Py_TRASHCAN_BEGIN(wp, wrapper_dealloc) - Py_XDECREF(wp->descr); - Py_XDECREF(wp->self); - PyObject_GC_Del(wp); -- Py_TRASHCAN_SAFE_END(wp) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/dictobject.c b/Objects/dictobject.c -index c544ecd..fa2b4b7 100644 ---- a/Objects/dictobject.c -+++ b/Objects/dictobject.c -@@ -1078,7 +1078,7 @@ dict_dealloc(register PyDictObject *mp) - Py_ssize_t fill = mp->ma_fill; - /* bpo-31095: UnTrack is needed before calling any callbacks */ - PyObject_GC_UnTrack(mp); -- Py_TRASHCAN_SAFE_BEGIN(mp) -+ Py_TRASHCAN_BEGIN(mp, dict_dealloc) - for (ep = mp->ma_table; fill > 0; ep++) { - if (ep->me_key) { - --fill; -@@ -1092,7 +1092,7 @@ dict_dealloc(register PyDictObject *mp) - free_list[numfree++] = mp; - else - Py_TYPE(mp)->tp_free((PyObject *)mp); -- Py_TRASHCAN_SAFE_END(mp) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/listobject.c b/Objects/listobject.c -index 24eff76..dc57270 100644 ---- a/Objects/listobject.c -+++ b/Objects/listobject.c -@@ -298,7 +298,7 @@ list_dealloc(PyListObject *op) - { - Py_ssize_t i; - PyObject_GC_UnTrack(op); -- Py_TRASHCAN_SAFE_BEGIN(op) -+ Py_TRASHCAN_BEGIN(op, list_dealloc) - if (op->ob_item != NULL) { - /* Do it backwards, for Christian Tismer. - There's a simple test case where somehow this reduces -@@ -314,7 +314,7 @@ list_dealloc(PyListObject *op) - free_list[numfree++] = op; - else - Py_TYPE(op)->tp_free((PyObject *)op); -- Py_TRASHCAN_SAFE_END(op) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/setobject.c b/Objects/setobject.c -index 31da3db..3dbbcf3 100644 ---- a/Objects/setobject.c -+++ b/Objects/setobject.c -@@ -551,7 +551,7 @@ set_dealloc(PySetObject *so) - Py_ssize_t fill = so->fill; - /* bpo-31095: UnTrack is needed before calling any callbacks */ - PyObject_GC_UnTrack(so); -- Py_TRASHCAN_SAFE_BEGIN(so) -+ Py_TRASHCAN_BEGIN(so, set_dealloc) - if (so->weakreflist != NULL) - PyObject_ClearWeakRefs((PyObject *) so); - -@@ -567,7 +567,7 @@ set_dealloc(PySetObject *so) - free_list[numfree++] = so; - else - Py_TYPE(so)->tp_free(so); -- Py_TRASHCAN_SAFE_END(so) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c -index 6f4b18c..ae82163 100644 ---- a/Objects/tupleobject.c -+++ b/Objects/tupleobject.c -@@ -215,7 +215,7 @@ tupledealloc(register PyTupleObject *op) - register Py_ssize_t i; - register Py_ssize_t len = Py_SIZE(op); - PyObject_GC_UnTrack(op); -- Py_TRASHCAN_SAFE_BEGIN(op) -+ Py_TRASHCAN_BEGIN(op, tupledealloc) - if (len > 0) { - i = len; - while (--i >= 0) -@@ -234,7 +234,7 @@ tupledealloc(register PyTupleObject *op) - } - Py_TYPE(op)->tp_free((PyObject *)op); - done: -- Py_TRASHCAN_SAFE_END(op) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/typeobject.c b/Objects/typeobject.c -index 844fb00..c8335ba 100644 ---- a/Objects/typeobject.c -+++ b/Objects/typeobject.c -@@ -922,7 +922,6 @@ subtype_dealloc(PyObject *self) - { - PyTypeObject *type, *base; - destructor basedealloc; -- PyThreadState *tstate = PyThreadState_GET(); - - /* Extract the type; we expect it to be a heap type */ - type = Py_TYPE(self); -@@ -971,16 +970,7 @@ subtype_dealloc(PyObject *self) - /* UnTrack and re-Track around the trashcan macro, alas */ - /* See explanation at end of function for full disclosure */ - PyObject_GC_UnTrack(self); -- ++_PyTrash_delete_nesting; -- ++ tstate->trash_delete_nesting; -- Py_TRASHCAN_SAFE_BEGIN(self); -- --_PyTrash_delete_nesting; -- -- tstate->trash_delete_nesting; -- /* DO NOT restore GC tracking at this point. weakref callbacks -- * (if any, and whether directly here or indirectly in something we -- * call) may trigger GC, and if self is tracked at that point, it -- * will look like trash to GC and GC will try to delete self again. -- */ -+ Py_TRASHCAN_BEGIN(self, subtype_dealloc); - - /* Find the nearest base with a different tp_dealloc */ - base = type; -@@ -1053,11 +1043,7 @@ subtype_dealloc(PyObject *self) - Py_DECREF(type); - - endlabel: -- ++_PyTrash_delete_nesting; -- ++ tstate->trash_delete_nesting; -- Py_TRASHCAN_SAFE_END(self); -- --_PyTrash_delete_nesting; -- -- tstate->trash_delete_nesting; -+ Py_TRASHCAN_END - - /* Explanation of the weirdness around the trashcan macros: - -@@ -1094,67 +1080,6 @@ subtype_dealloc(PyObject *self) - looks like trash to gc too, and gc also tries to delete self - then. But we're already deleting self. Double deallocation is - a subtle disaster. -- -- Q. Why the bizarre (net-zero) manipulation of -- _PyTrash_delete_nesting around the trashcan macros? -- -- A. Some base classes (e.g. list) also use the trashcan mechanism. -- The following scenario used to be possible: -- -- - suppose the trashcan level is one below the trashcan limit -- -- - subtype_dealloc() is called -- -- - the trashcan limit is not yet reached, so the trashcan level -- is incremented and the code between trashcan begin and end is -- executed -- -- - this destroys much of the object's contents, including its -- slots and __dict__ -- -- - basedealloc() is called; this is really list_dealloc(), or -- some other type which also uses the trashcan macros -- -- - the trashcan limit is now reached, so the object is put on the -- trashcan's to-be-deleted-later list -- -- - basedealloc() returns -- -- - subtype_dealloc() decrefs the object's type -- -- - subtype_dealloc() returns -- -- - later, the trashcan code starts deleting the objects from its -- to-be-deleted-later list -- -- - subtype_dealloc() is called *AGAIN* for the same object -- -- - at the very least (if the destroyed slots and __dict__ don't -- cause problems) the object's type gets decref'ed a second -- time, which is *BAD*!!! -- -- The remedy is to make sure that if the code between trashcan -- begin and end in subtype_dealloc() is called, the code between -- trashcan begin and end in basedealloc() will also be called. -- This is done by decrementing the level after passing into the -- trashcan block, and incrementing it just before leaving the -- block. -- -- But now it's possible that a chain of objects consisting solely -- of objects whose deallocator is subtype_dealloc() will defeat -- the trashcan mechanism completely: the decremented level means -- that the effective level never reaches the limit. Therefore, we -- *increment* the level *before* entering the trashcan block, and -- matchingly decrement it after leaving. This means the trashcan -- code will trigger a little early, but that's no big deal. -- -- Q. Are there any live examples of code in need of all this -- complexity? -- -- A. Yes. See SF bug 668433 for code that crashed (when Python was -- compiled in debug mode) before the trashcan level manipulations -- were added. For more discussion, see SF patches 581742, 575073 -- and bug 574207. - */ - } - -diff --git a/Python/traceback.c b/Python/traceback.c -index fd5309a..38327b6 100644 ---- a/Python/traceback.c -+++ b/Python/traceback.c -@@ -23,11 +23,11 @@ static void - tb_dealloc(PyTracebackObject *tb) - { - PyObject_GC_UnTrack(tb); -- Py_TRASHCAN_SAFE_BEGIN(tb) -+ Py_TRASHCAN_BEGIN(tb, tb_dealloc) - Py_XDECREF(tb->tb_next); - Py_XDECREF(tb->tb_frame); - PyObject_GC_Del(tb); -- Py_TRASHCAN_SAFE_END(tb) -+ Py_TRASHCAN_END - } - - static int diff --git a/build/pkgs/python2/patches/uuid-issue_11063.patch b/build/pkgs/python2/patches/uuid-issue_11063.patch deleted file mode 100644 index 731c4325cb8..00000000000 --- a/build/pkgs/python2/patches/uuid-issue_11063.patch +++ /dev/null @@ -1,154 +0,0 @@ -diff --git a/Lib/uuid.py b/Lib/uuid.py -index 7432032..0cbf9f1 100644 ---- a/Lib/uuid.py -+++ b/Lib/uuid.py -@@ -437,68 +437,86 @@ def _netbios_getnode(): - return ((bytes[0]<<40L) + (bytes[1]<<32L) + (bytes[2]<<24L) + - (bytes[3]<<16L) + (bytes[4]<<8L) + bytes[5]) - --# Thanks to Thomas Heller for ctypes and for his help with its use here. -+_ctypes_lib = None - --# If ctypes is available, use it to find system routines for UUID generation. --_uuid_generate_time = _UuidCreate = None --try: -- import ctypes, ctypes.util -- import sys -+def _uuid_generate(attr): -+ """Find system routines for UUID generation""" -+ -+ # Thanks to Thomas Heller for ctypes and for his help with its use here. -+ try: -+ import ctypes -+ import ctypes.util -+ -+ global _ctypes_lib -+ -+ uuid = None -+ # The uuid_generate_* routines are provided by libuuid on at least -+ # Linux and FreeBSD, and provided by libc on Mac OS X. -+ for libname in ['uuid', 'c']: -+ try: -+ if _ctypes_lib is None: -+ _ctypes_lib = ctypes.CDLL(ctypes.util.find_library(libname)) -+ lib = _ctypes_lib -+ except: -+ continue -+ if hasattr(lib, attr): -+ uuid = getattr(lib, attr) -+ break # found what we were looking for -+ -+ # The uuid_generate_* functions are broken on MacOS X 10.5, as noted -+ # in issue #8621 the function generates the same sequence of values -+ # in the parent process and all children created using fork (unless -+ # those children use exec as well). -+ # -+ # Assume that the uuid_generate functions are broken from 10.5 onward, -+ # the test can be adjusted when a later version is fixed. -+ import sys -+ if sys.platform == 'darwin': -+ import os -+ if int(os.uname()[2].split('.')[0]) >= 9: -+ uuid = None -+ return uuid -+ except: -+ pass - -- # The uuid_generate_* routines are provided by libuuid on at least -- # Linux and FreeBSD, and provided by libc on Mac OS X. -- _libnames = ['uuid'] -- if not sys.platform.startswith('win'): -- _libnames.append('c') -- for libname in _libnames: -+ -+def _uuid_create(): -+ """Get random UUID on Windows platform.""" -+ -+ try: -+ # On Windows prior to 2000, UuidCreate gives a UUID containing the -+ # hardware address. On Windows 2000 and later, UuidCreate makes a -+ # random UUID and UuidCreateSequential gives a UUID containing the -+ # hardware address. These routines are provided by the RPC runtime. -+ # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last -+ # 6 bytes returned by UuidCreateSequential are fixed, they don't appear -+ # to bear any relationship to the MAC address of any network device -+ # on the box. - try: -- lib = ctypes.CDLL(ctypes.util.find_library(libname)) -+ import ctypes -+ lib = ctypes.windll.rpcrt4 - except: -- continue -- if hasattr(lib, 'uuid_generate_time'): -- _uuid_generate_time = lib.uuid_generate_time -- break -- del _libnames -- -- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted -- # in issue #8621 the function generates the same sequence of values -- # in the parent process and all children created using fork (unless -- # those children use exec as well). -- # -- # Assume that the uuid_generate functions are broken from 10.5 onward, -- # the test can be adjusted when a later version is fixed. -- if sys.platform == 'darwin': -- import os -- if int(os.uname()[2].split('.')[0]) >= 9: -- _uuid_generate_time = None -- -- # On Windows prior to 2000, UuidCreate gives a UUID containing the -- # hardware address. On Windows 2000 and later, UuidCreate makes a -- # random UUID and UuidCreateSequential gives a UUID containing the -- # hardware address. These routines are provided by the RPC runtime. -- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last -- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear -- # to bear any relationship to the MAC address of any network device -- # on the box. -- try: -- lib = ctypes.windll.rpcrt4 -+ lib = None -+ uuid = getattr(lib, 'UuidCreateSequential', -+ getattr(lib, 'UuidCreate', None)) -+ return uuid - except: -- lib = None -- _UuidCreate = getattr(lib, 'UuidCreateSequential', -- getattr(lib, 'UuidCreate', None)) --except: -- pass -+ pass - - def _unixdll_getnode(): - """Get the hardware address on Unix using ctypes.""" -+ import ctypes - _buffer = ctypes.create_string_buffer(16) -- _uuid_generate_time(_buffer) -+ uuid_generate_time = _uuid_generate("uuid_generate_time") -+ uuid_generate_time(_buffer) - return UUID(bytes=_buffer.raw).node - - def _windll_getnode(): - """Get the hardware address on Windows using ctypes.""" -+ import ctypes - _buffer = ctypes.create_string_buffer(16) -- if _UuidCreate(_buffer) == 0: -+ UuidCreate = _uuid_create() -+ if UuidCreate(_buffer) == 0: - return UUID(bytes=_buffer.raw).node - - def _random_getnode(): -@@ -546,9 +564,12 @@ def uuid1(node=None, clock_seq=None): - - # When the system provides a version-1 UUID generator, use it (but don't - # use UuidCreate here because its UUIDs don't conform to RFC 4122). -- if _uuid_generate_time and node is clock_seq is None: -+ uuid_generate_time = _uuid_generate("uuid_generate_time") -+ -+ if uuid_generate_time and node is clock_seq is None: -+ import ctypes - _buffer = ctypes.create_string_buffer(16) -- _uuid_generate_time(_buffer) -+ uuid_generate_time(_buffer) - return UUID(bytes=_buffer.raw) - - global _last_timestamp diff --git a/build/pkgs/python2/spkg-build.in b/build/pkgs/python2/spkg-build.in deleted file mode 120000 index ab563dea917..00000000000 --- a/build/pkgs/python2/spkg-build.in +++ /dev/null @@ -1 +0,0 @@ -../python3/spkg-build.in \ No newline at end of file diff --git a/build/pkgs/python2/spkg-check.in b/build/pkgs/python2/spkg-check.in deleted file mode 120000 index 68c37d2fdc8..00000000000 --- a/build/pkgs/python2/spkg-check.in +++ /dev/null @@ -1 +0,0 @@ -../python3/spkg-check.in \ No newline at end of file diff --git a/build/pkgs/python2/spkg-install.in b/build/pkgs/python2/spkg-install.in deleted file mode 120000 index 98b9bc31360..00000000000 --- a/build/pkgs/python2/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../python3/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/python2/type b/build/pkgs/python2/type deleted file mode 100644 index 134d9bc32d5..00000000000 --- a/build/pkgs/python2/type +++ /dev/null @@ -1 +0,0 @@ -optional diff --git a/build/pkgs/python_igraph/SPKG.rst b/build/pkgs/python_igraph/SPKG.rst new file mode 100644 index 00000000000..04887d77367 --- /dev/null +++ b/build/pkgs/python_igraph/SPKG.rst @@ -0,0 +1,31 @@ + +python-igraph +============= + +Description +----------- + +igraph is a library for creating and manipulating graphs. It is intended +to be as powerful (ie. fast) as possible to enable the analysis of large +graphs. + +License +------- + +GPL version 2 + + +Upstream Contact +---------------- + +http://igraph.org/python/ + +Dependencies +------------ + +- python +- igraph + + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/python_igraph/SPKG.txt b/build/pkgs/python_igraph/SPKG.txt deleted file mode 100644 index 8a6721bb25d..00000000000 --- a/build/pkgs/python_igraph/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= python-igraph = - -== Description == - -igraph is a library for creating and manipulating graphs. -It is intended to be as powerful (ie. fast) as possible to enable the -analysis of large graphs. - -== License == - -GPL version 2 - -== Upstream Contact == - -http://igraph.org/python/ - -== Dependencies == - -* python -* igraph - -== Special Update/Build Instructions == diff --git a/build/pkgs/python_openid/SPKG.rst b/build/pkgs/python_openid/SPKG.rst new file mode 100644 index 00000000000..5219fa1e117 --- /dev/null +++ b/build/pkgs/python_openid/SPKG.rst @@ -0,0 +1,14 @@ + +python-openid +============= + +Description +----------- + +OpenID support for servers and consumers. + +This is a set of Python packages to support use of the OpenID +decentralized identity system in your application. Want to enable single +sign-on for your web site? Use the openid.consumer package. Want to run +your own OpenID server? Check out openid.server. Includes example code +and support for a variety of storage back-ends. diff --git a/build/pkgs/python_openid/SPKG.txt b/build/pkgs/python_openid/SPKG.txt deleted file mode 100644 index 390a18695b1..00000000000 --- a/build/pkgs/python_openid/SPKG.txt +++ /dev/null @@ -1,11 +0,0 @@ -= python-openid = - -== Description == - -OpenID support for servers and consumers. - -This is a set of Python packages to support use of the OpenID decentralized -identity system in your application. Want to enable single sign-on for your -web site? Use the openid.consumer package. Want to run your own OpenID server? -Check out openid.server. Includes example code and support for a variety of -storage back-ends. diff --git a/build/pkgs/pytz/SPKG.txt b/build/pkgs/pytz/SPKG.rst similarity index 56% rename from build/pkgs/pytz/SPKG.txt rename to build/pkgs/pytz/SPKG.rst index 94190513f91..ebeba1ad914 100644 --- a/build/pkgs/pytz/SPKG.txt +++ b/build/pkgs/pytz/SPKG.rst @@ -1,10 +1,14 @@ -= pytz = +pytz +==== -== Description == +Description +----------- World Timezone Definitions for Python -== Special Update/Build Instructions == + +Special Update/Build Instructions +--------------------------------- The upstream tarball was repackaged after sanitizing the file permissions with diff --git a/build/pkgs/pyx/SPKG.txt b/build/pkgs/pyx/SPKG.rst similarity index 76% rename from build/pkgs/pyx/SPKG.txt rename to build/pkgs/pyx/SPKG.rst index 6f3e0998d88..f9a4a5b88d5 100644 --- a/build/pkgs/pyx/SPKG.txt +++ b/build/pkgs/pyx/SPKG.rst @@ -1,8 +1,9 @@ -= pyx = +pyx +=== -== Description == +Description +----------- Python package for the generation of PostScript, PDF, and SVG files https://pypi.python.org/pypi/PyX - diff --git a/build/pkgs/pyzmq/SPKG.rst b/build/pkgs/pyzmq/SPKG.rst new file mode 100644 index 00000000000..86594e23d02 --- /dev/null +++ b/build/pkgs/pyzmq/SPKG.rst @@ -0,0 +1,31 @@ +pyzmq +===== + +Description +----------- + +Python bindings for the zeromq networking library. + +License +------- + +LGPLv3+ + + +Upstream Contact +---------------- + +http://www.zeromq.org + +Dependencies +------------ + +- Python +- Cython +- zeromq + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/pyzmq/SPKG.txt b/build/pkgs/pyzmq/SPKG.txt deleted file mode 100644 index 86903427d03..00000000000 --- a/build/pkgs/pyzmq/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= pyzmq = - -== Description == - -Python bindings for the zeromq networking library. - -== License == - -LGPLv3+ - -== Upstream Contact == - -http://www.zeromq.org - -== Dependencies == - -* Python -* Cython -* zeromq - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/qepcad/SPKG.rst b/build/pkgs/qepcad/SPKG.rst new file mode 100644 index 00000000000..be23ccc167c --- /dev/null +++ b/build/pkgs/qepcad/SPKG.rst @@ -0,0 +1,49 @@ +qepcad +====== + +Description +----------- + +Qepcad is an implementation of quantifier elimination by partial +cylindrical algebraic decomposition + +License +------- + +QEPCAD B Copyright (c) 1990, 2008, Hoon Hong & Chris Brown (contact +wcbrown@usna.edu) + +Permission to use, copy, modify, and/or distribute this software, +including source files, README files, etc., for any purpose with or +without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +Upstream Contact +---------------- + +- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html +- Alternative location (sometimes more up-to-date): + + https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html + +Dependencies +------------ + +- readline +- saclib + + +Special Update/Build Instructions +--------------------------------- + +One might need to set MAKE to "make -j1" fo this to be built +successfully. diff --git a/build/pkgs/qepcad/SPKG.txt b/build/pkgs/qepcad/SPKG.txt deleted file mode 100644 index 33bf57d8d30..00000000000 --- a/build/pkgs/qepcad/SPKG.txt +++ /dev/null @@ -1,39 +0,0 @@ -= qepcad = - -== Description == - -Qepcad is an implementation of quantifier elimination by partial cylindrical -algebraic decomposition - -== License == - -QEPCAD B -Copyright (c) 1990, 2008, Hoon Hong & Chris Brown (contact wcbrown@usna.edu) - -Permission to use, copy, modify, and/or distribute this software, including -source files, README files, etc., for any purpose with or without fee is -hereby granted, provided that the above copyright notice and this permission -notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -== Upstream Contact == - -- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html -- Alternative location (sometimes more up-to-date): - https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html - -== Dependencies == - -* readline -* saclib - -== Special Update/Build Instructions == - -One might need to set MAKE to "make -j1" fo this to be built successfully. diff --git a/build/pkgs/qhull/SPKG.rst b/build/pkgs/qhull/SPKG.rst new file mode 100644 index 00000000000..03c42327734 --- /dev/null +++ b/build/pkgs/qhull/SPKG.rst @@ -0,0 +1,48 @@ +Qhull +===== + +Description +----------- + +From the README.txt of Qhull: + +Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, +furthest-site Voronoi diagrams, and halfspace intersections about a +point. It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull +algorithm for computing convex hulls. Qhull handles round-off errors +from floating point arithmetic. It can approximate a convex hull. + +The program includes options for hull volume, facet area, partial hulls, +input transformations, randomization, tracing, multiple output formats, +and execution statistics. + +Further notes: + +The qhull library is already shipped with the Python library scipy (from +version 1.4), see + +- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html +- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Delaunay.html +- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Voronoi.html + +There is also the Python interface Pyhull available on PyPI +https://pypi.python.org/pypi/pyhull (see also documentation at +http://pythonhosted.org/pyhull/). + + +Upstream Contact +---------------- + +C. Bradford Barber bradb@shore.net or qhull@qhull.org + +Dependencies +------------ + +Can be compiled with Qt support, but the Sage version currently doesn't +try to do this. + +License +------- + +Not a standard license, but Sage compatible. See the COPYING.txt file in +the source directory for details. diff --git a/build/pkgs/qhull/SPKG.txt b/build/pkgs/qhull/SPKG.txt deleted file mode 100644 index ab514bc1f69..00000000000 --- a/build/pkgs/qhull/SPKG.txt +++ /dev/null @@ -1,43 +0,0 @@ -= Qhull = - -== Description == - -From the README.txt of Qhull: - -Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, -furthest-site Voronoi diagrams, and halfspace intersections about a point. -It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull algorithm -for computing convex hulls. Qhull handles round-off errors from floating -point arithmetic. It can approximate a convex hull. - -The program includes options for hull volume, facet area, partial hulls, -input transformations, randomization, tracing, multiple output formats, and -execution statistics. - - -Further notes: - -The qhull library is already shipped with the Python library scipy (from -version 1.4), see - -- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html -- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Delaunay.html -- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Voronoi.html - -There is also the Python interface Pyhull available on PyPI -https://pypi.python.org/pypi/pyhull (see also documentation at http://pythonhosted.org/pyhull/). - -== Upstream Contact == - -C. Bradford Barber -bradb@shore.net -or qhull@qhull.org - -== Dependencies == - -Can be compiled with Qt support, but the Sage version currently doesn't try to do this. - -== License == - -Not a standard license, but Sage compatible. See the COPYING.txt file in the -source directory for details. diff --git a/build/pkgs/r/SPKG.txt b/build/pkgs/r/SPKG.rst similarity index 64% rename from build/pkgs/r/SPKG.txt rename to build/pkgs/r/SPKG.rst index a6b1e72ab2c..2b498e85e0f 100644 --- a/build/pkgs/r/SPKG.txt +++ b/build/pkgs/r/SPKG.rst @@ -1,6 +1,9 @@ -= R = +R += + +Description +----------- -== Description == R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent @@ -10,20 +13,25 @@ much code written for S runs unaltered under R. (taken from http://www.r-project.org/) -== License == - * GPL v2 or GPL v3 +License +------- + +- GPL v2 or GPL v3 + + +Upstream Contact +---------------- -== Upstream Contact == - * R mailing list, #R in IRC +- R mailing list, #R in IRC -== Dependencies == +Dependencies +------------ - * GNU patch - * iconv - * Readline - * BLAS/LAPACK - * xz - * pcre - * curl - * https-capable SSL - +- GNU patch +- iconv +- Readline +- BLAS/LAPACK +- xz +- pcre +- curl +- https-capable SSL diff --git a/build/pkgs/r/spkg-src b/build/pkgs/r/spkg-src index 349ec3e5846..23ce98c4702 100755 --- a/build/pkgs/r/spkg-src +++ b/build/pkgs/r/spkg-src @@ -10,4 +10,4 @@ set -e wget http://cran.r-project.org/src/base/R-3/$SOURCE_TARBALL mv $SOURCE_TARBALL $SAGE_ROOT/upstream/$TARGET_TARBALL -sage -sh 'sage-fix-pkg-checksums' +sage --package fix-checksum diff --git a/build/pkgs/ratpoints/SPKG.rst b/build/pkgs/ratpoints/SPKG.rst new file mode 100644 index 00000000000..20ff846959f --- /dev/null +++ b/build/pkgs/ratpoints/SPKG.rst @@ -0,0 +1,39 @@ +ratpoints +========= + +Description +----------- + +Michael Stoll's program which searches for rational points on +hyperelliptic curves. + +NOTE: the ratpoints package has been assimilated by PARI/GP. Therefore, +this package (as Sage package) is deprecated. In the future, it will be +removed from Sage. + + +Upstream Contact +---------------- + +- Author: Michael Stoll +- Email: Michael.Stoll@uni-bayreuth.de +- Website: http://www.mathe2.uni-bayreuth.de/stoll/ + +Dependencies +------------ + +- GMP/MPIR +- (GNU) patch + + +Special Update/Build Instructions +--------------------------------- + + +Note on SSE2 instructions +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- On several architectures, the SSE2 instructions used by ratpoints + cause + compiler errors. In the case that ratpoints fails to build with SSE2 + instructions enabled, the build is repeated with SSE2 disabled. diff --git a/build/pkgs/ratpoints/SPKG.txt b/build/pkgs/ratpoints/SPKG.txt deleted file mode 100644 index c183090831a..00000000000 --- a/build/pkgs/ratpoints/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= ratpoints = - -== Description == - -Michael Stoll's program which searches for rational points on hyperelliptic -curves. - -NOTE: the ratpoints package has been assimilated by PARI/GP. Therefore, -this package (as Sage package) is deprecated. In the future, it will be -removed from Sage. - -== Upstream Contact == - - * Author: Michael Stoll - * Email: Michael.Stoll@uni-bayreuth.de - * Website: http://www.mathe2.uni-bayreuth.de/stoll/ - -== Dependencies == - - * GMP/MPIR - * (GNU) patch - -== Special Update/Build Instructions == - -=== Note on SSE2 instructions === - - * On several architectures, the SSE2 instructions used by ratpoints cause - compiler errors. In the case that ratpoints fails to build with SSE2 - instructions enabled, the build is repeated with SSE2 disabled. - diff --git a/build/pkgs/readline/SPKG.rst b/build/pkgs/readline/SPKG.rst new file mode 100644 index 00000000000..8553446ae64 --- /dev/null +++ b/build/pkgs/readline/SPKG.rst @@ -0,0 +1,50 @@ +readline +======== + +Description +----------- + +The GNU Readline library provides a set of functions for use by +applications that allow users to edit command lines as they are typed +in. Both Emacs and vi editing modes are available. The Readline library +includes additional functions to maintain a list of previously-entered +command lines, to recall and perhaps reedit those lines, and perform +csh-like history expansion on previous commands. + +Website: http://tiswww.case.edu/php/chet/readline/rltop.html + +License +------- + +- GPL V3+ + + +Upstream Contact +---------------- + +- Chet Ramey at http://cnswww.cns.cwru.edu/~chet + +Dependencies +------------ + +- ncurses + + +Special Update/Build Instructions +--------------------------------- + +We build readline using ncurses. Readline needs to be told to link with +libtinfo (part of ncurses), this is what the patch 0002-ltinfo.patch +does. + +Patches +------- + +- 0001-macports.patch: Changes to shobj.conf for OS/X, from macports: + + https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff + +- 0002-ltinfo.patch: We build readline using ncurses, and for that it + needs to be told to link with libtinfo (part of ncurses). + +- sigsetjmp.patch: Correctly define sigsetjmp and friends on Cygwin. diff --git a/build/pkgs/readline/SPKG.txt b/build/pkgs/readline/SPKG.txt deleted file mode 100644 index 800f7767002..00000000000 --- a/build/pkgs/readline/SPKG.txt +++ /dev/null @@ -1,39 +0,0 @@ -= readline = - -== Description == - -The GNU Readline library provides a set of functions for use by -applications that allow users to edit command lines as they are typed -in. Both Emacs and vi editing modes are available. The Readline -library includes additional functions to maintain a list of -previously-entered command lines, to recall and perhaps reedit those -lines, and perform csh-like history expansion on previous commands. - -Website: http://tiswww.case.edu/php/chet/readline/rltop.html - -== License == - - * GPL V3+ - -== Upstream Contact == - - * Chet Ramey at http://cnswww.cns.cwru.edu/~chet - -== Dependencies == - - * ncurses - -== Special Update/Build Instructions == - -We build readline using ncurses. Readline needs to be told to link -with libtinfo (part of ncurses), this is what the patch -0002-ltinfo.patch does. - - -== Patches == - - * 0001-macports.patch: Changes to shobj.conf for OS/X, from macports: - https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff - * 0002-ltinfo.patch: We build readline using ncurses, and for that it - needs to be told to link with libtinfo (part of ncurses). - * sigsetjmp.patch: Correctly define sigsetjmp and friends on Cygwin. diff --git a/build/pkgs/requests/SPKG.txt b/build/pkgs/requests/SPKG.rst similarity index 66% rename from build/pkgs/requests/SPKG.txt rename to build/pkgs/requests/SPKG.rst index 5f5a73a5fc2..f06fc13952f 100644 --- a/build/pkgs/requests/SPKG.txt +++ b/build/pkgs/requests/SPKG.rst @@ -1,6 +1,8 @@ -= requests = +requests +======== -== Description == +Description +----------- Requests is the only Non-GMO HTTP library for Python, safe for human consumption. diff --git a/build/pkgs/rpy2/SPKG.rst b/build/pkgs/rpy2/SPKG.rst new file mode 100644 index 00000000000..b3391ea8de7 --- /dev/null +++ b/build/pkgs/rpy2/SPKG.rst @@ -0,0 +1,38 @@ +rpy2 +==== + +Description +----------- + +rpy2 is a redesign and rewrite of rpy. It is providing a low-level +interface to R, a proposed high-level interface, including wrappers to +graphical libraries, as well as R-like structures and functions. + +Website: http://rpy.sourceforge.net/rpy2.html + +License +------- + +- GPL 2+ +- Note that we have deleted references to Mozilla PL as an option, + which we are allowed to do by the full rpy2 license in order to + remain GPL-compatible + + +Upstream Contact +---------------- + +- http://rpy.sourceforge.net/maillist.html + +Dependencies +------------ + + +Special Update/Build Instructions +--------------------------------- + +Patches +~~~~~~~ + +- setup.patch: takes care of a few parsing issues. +- cygwin.patch: let rpy2 build on Cygwin. diff --git a/build/pkgs/rpy2/SPKG.txt b/build/pkgs/rpy2/SPKG.txt deleted file mode 100644 index 806f1c946cf..00000000000 --- a/build/pkgs/rpy2/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= rpy2 = - -== Description == -rpy2 is a redesign and rewrite of rpy. It is providing a low-level -interface to R, a proposed high-level interface, including wrappers to -graphical libraries, as well as R-like structures and functions. - -Website: http://rpy.sourceforge.net/rpy2.html - -== License == - * GPL 2+ - * Note that we have deleted references to Mozilla PL as an option, which we are allowed to do by the full rpy2 license in order to remain GPL-compatible - -== Upstream Contact == - * http://rpy.sourceforge.net/maillist.html - -== Dependencies == - -== Special Update/Build Instructions == - -=== Patches === - * setup.patch: takes care of a few parsing issues. - * cygwin.patch: let rpy2 build on Cygwin. - diff --git a/build/pkgs/rst2ipynb/SPKG.txt b/build/pkgs/rst2ipynb/SPKG.rst similarity index 66% rename from build/pkgs/rst2ipynb/SPKG.txt rename to build/pkgs/rst2ipynb/SPKG.rst index b10dc5acacb..12dbaa5ee87 100644 --- a/build/pkgs/rst2ipynb/SPKG.txt +++ b/build/pkgs/rst2ipynb/SPKG.rst @@ -1,6 +1,8 @@ -= rst2ipynb = +rst2ipynb +========= -== Description == +Description +----------- The rst2pynb program converts a standalone reStructuredText file to a Jupyter notebook file. @@ -9,21 +11,27 @@ This is currently achieved by converting to markdown with pandoc and then to Jupyter notebook using notedown, plus some configuration and tweaks. -== License == +License +------- BSD 3-Clause License -== Upstream Contact == -Authors: Scott Sievert and Nicolas M. Thiéry -Home page: https://github.com/nthiery/rst-to-ipynb +Upstream Contact +---------------- -== Dependencies == +Authors: Scott Sievert and Nicolas M. Thiéry Home page: +https://github.com/nthiery/rst-to-ipynb - * notedown - * pandoc +Dependencies +------------ -== Special Update/Build Instructions == +- notedown +- pandoc + + +Special Update/Build Instructions +--------------------------------- Fetch tarball from https://pypi.python.org/pypi/rst2ipynb/ diff --git a/build/pkgs/rubiks/SPKG.rst b/build/pkgs/rubiks/SPKG.rst new file mode 100644 index 00000000000..b73e508cdb2 --- /dev/null +++ b/build/pkgs/rubiks/SPKG.rst @@ -0,0 +1,27 @@ +rubiks.spkg +=========== + +Description +----------- + +There are several programs for working with Rubik's cubes, by three +different people. Look inside the directories under /src to see specific +info and licensing. In summary the three contributers are: + +Michael Reid (GPL) +http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html + +- optimal - uses many pre-computed tables to find an optimal + solution to the 3x3x3 Rubik's cube + +Dik T. Winter (MIT License) + +- cube - uses Kociemba's algorithm to iteratively find a short + solution to the 3x3x3 Rubik's cube +- size222 - solves a 2x2x2 Rubik's cube + +Eric Dietz (GPL) http://www.wrongway.org/?rubiksource + +- cu2 - A fast, non-optimal 2x2x2 solver +- cubex - A fast, non-optimal 3x3x3 solver +- mcube - A fast, non-optimal 4x4x4 solver diff --git a/build/pkgs/rubiks/SPKG.txt b/build/pkgs/rubiks/SPKG.txt deleted file mode 100644 index af4e9a21bb9..00000000000 --- a/build/pkgs/rubiks/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= rubiks.spkg = - -== Description == - -There are several programs for working with Rubik's cubes, by three -different people. Look inside the directories under /src to see -specific info and licensing. In summary the three contributers are: - - -Michael Reid (GPL) http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html - optimal - uses many pre-computed tables to find an optimal - solution to the 3x3x3 Rubik's cube - - -Dik T. Winter (MIT License) - cube - uses Kociemba's algorithm to iteratively find a short - solution to the 3x3x3 Rubik's cube - size222 - solves a 2x2x2 Rubik's cube - - -Eric Dietz (GPL) http://www.wrongway.org/?rubiksource - cu2 - A fast, non-optimal 2x2x2 solver - cubex - A fast, non-optimal 3x3x3 solver - mcube - A fast, non-optimal 4x4x4 solver - diff --git a/build/pkgs/rw/SPKG.txt b/build/pkgs/rw/SPKG.rst similarity index 73% rename from build/pkgs/rw/SPKG.txt rename to build/pkgs/rw/SPKG.rst index 7ab5243f2d4..03ca7382412 100644 --- a/build/pkgs/rw/SPKG.txt +++ b/build/pkgs/rw/SPKG.rst @@ -1,15 +1,20 @@ -= rw = +rw +== -== Description == +Description +----------- rw is a program that calculates rank-width and rank-decompositions. http://pholia.tdi.informatik.uni-frankfurt.de/~philipp/software/rw.shtml -== License == +License +------- GPL version 2 or later -== Upstream Contact == + +Upstream Contact +---------------- Philipp Klaus Krause (philipp@informatik.uni-frankfurt.de) diff --git a/build/pkgs/saclib/SPKG.txt b/build/pkgs/saclib/SPKG.rst similarity index 50% rename from build/pkgs/saclib/SPKG.txt rename to build/pkgs/saclib/SPKG.rst index d8f6c7baf44..5301ddd82b3 100644 --- a/build/pkgs/saclib/SPKG.txt +++ b/build/pkgs/saclib/SPKG.rst @@ -1,19 +1,22 @@ -= saclib = +saclib +====== -== Description == +Description +----------- -Saclib is a library of C programs for computer algebra derived from the SAC2 -system. It is mainly used as a dependency of qepcad. +Saclib is a library of C programs for computer algebra derived from the +SAC2 system. It is mainly used as a dependency of qepcad. -== License == +License +------- -Saclib 2.2 -Copyright (c) 1993, 2008, RISC-Linz (contact wcbrown@usna.edu) +Saclib 2.2 Copyright (c) 1993, 2008, RISC-Linz (contact +wcbrown@usna.edu) -Permission to use, copy, modify, and/or distribute this software, including -source files, README files, etc., for any purpose with or without fee is -hereby granted, provided that the above copyright notice and this permission -notice appear in all copies. +Permission to use, copy, modify, and/or distribute this software, +including source files, README files, etc., for any purpose with or +without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF @@ -23,13 +26,16 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -== Upstream Contact == -- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html -- Alternative location (sometimes more up-to-date): - https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html +Upstream Contact +---------------- -== Dependencies == +- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html +- Alternative location (sometimes more up-to-date): -None. + https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html + +Dependencies +------------ +None. diff --git a/build/pkgs/sage_brial/SPKG.txt b/build/pkgs/sage_brial/SPKG.rst similarity index 82% rename from build/pkgs/sage_brial/SPKG.txt rename to build/pkgs/sage_brial/SPKG.rst index 2a84cad9c4f..3cc3c9181e9 100644 --- a/build/pkgs/sage_brial/SPKG.txt +++ b/build/pkgs/sage_brial/SPKG.rst @@ -1,6 +1,8 @@ -= BRiAl = +BRiAl +===== -== Description == +Description +----------- BRiAl is the successor to PolyBoRi. @@ -10,10 +12,13 @@ as for the underlying polynomial rings and subsets of the powerset of the Boolean variables. This SPKG is a (sage) python wrapper around the functionality of the C++ library. -== License == +License +------- GPL version 2 or later -== Upstream Contact == + +Upstream Contact +---------------- https://github.com/BRiAl/BRiAl diff --git a/build/pkgs/sagenb/SPKG.rst b/build/pkgs/sagenb/SPKG.rst new file mode 100644 index 00000000000..7d031d20a9d --- /dev/null +++ b/build/pkgs/sagenb/SPKG.rst @@ -0,0 +1,47 @@ + +Sage Notebook +============= + +Description +----------- + +The Sage Notebook is a web-based graphical user interface for +mathematical software. + +License +------- + +GPLv3+ + + +Upstream Contact +---------------- + +- Keshav Kini +- Homepage: https://github.com/sagemath/sagenb + +Dependencies +------------ + +Build-time dependencies: + +- Python +- setuptools +- twisted +- flask +- flask-autoindex +- flask-babel +- flask-openid +- flask-oldsessions + +Run-time dependencies: + +- Sage +- jinja2 +- pexpect +- docutils +- sphinx + +Optional dependency: + +- OpenSSL (including headers) diff --git a/build/pkgs/sagenb/SPKG.txt b/build/pkgs/sagenb/SPKG.txt deleted file mode 100644 index 92ab236a0e8..00000000000 --- a/build/pkgs/sagenb/SPKG.txt +++ /dev/null @@ -1,40 +0,0 @@ -= Sage Notebook = - -== Description == - -The Sage Notebook is a web-based graphical user interface for -mathematical software. - -== License == - -GPLv3+ - -== Upstream Contact == - - * Keshav Kini - * Homepage: https://github.com/sagemath/sagenb - -== Dependencies == - -Build-time dependencies: - - * Python - * setuptools - * twisted - * flask - - flask-autoindex - - flask-babel - - flask-openid - - flask-oldsessions - -Run-time dependencies: - - * Sage - * jinja2 - * pexpect - * docutils - * sphinx - -Optional dependency: - - * OpenSSL (including headers) diff --git a/build/pkgs/sagenb_export/SPKG.txt b/build/pkgs/sagenb_export/SPKG.rst similarity index 72% rename from build/pkgs/sagenb_export/SPKG.txt rename to build/pkgs/sagenb_export/SPKG.rst index 4c471abd0ae..8f1a7e77dd7 100644 --- a/build/pkgs/sagenb_export/SPKG.txt +++ b/build/pkgs/sagenb_export/SPKG.rst @@ -1,11 +1,13 @@ -= sagenb_export = +sagenb_export +============= -== Description == +Description +----------- This is a tool to convert SageNB notebooks to other formats, in particular IPython/Jupyter notebooks. -It includes a Jupyter notebook extension to provide a UI for the -import of SageNB notebooks. +It includes a Jupyter notebook extension to provide a UI for the import +of SageNB notebooks. https://github.com/vbraun/ExportSageNB diff --git a/build/pkgs/sagetex/SPKG.rst b/build/pkgs/sagetex/SPKG.rst new file mode 100644 index 00000000000..c0e9d9ef8e1 --- /dev/null +++ b/build/pkgs/sagetex/SPKG.rst @@ -0,0 +1,64 @@ +SageTeX +======= + +Description +----------- + +The SageTeX package allows you to embed code, results of computations, +and plots from Sage into LaTeX documents. + +License +------- + +The *source code* of the SageTeX package may be redistributed and/or +modified 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. To view a copy of this license, see +http://www.gnu.org/licenses/ or send a letter to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. + +The *documentation* of the SageTeX package is licensed under the +Creative Commons Attribution-Share Alike 3.0 License. To view a copy of +this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or +send a letter to Creative Commons, 171 Second Street, Suite 300, San +Francisco, California, 94105, USA. + + +SPKG Maintainers +---------------- + +Dan Drake (dr.dan.drake at gmail) and SageMath developers +(sage-devel@googlegroups.com) + + +Upstream Contact +---------------- + +Author: Dan Drake. Web: https://github.com/sagemath/sagetex + +Dependencies +------------ + +To install, nothing more than a standard Sage install. The +``spkg-check`` script will exit without actually testing anything if it +cannot find "latex" in your path. + +Notes +----- + +To use SageTeX, both Sage and LaTeX need to know about it. SageTeX comes +standard with Sage, so you only need to make sure LaTeX can find what it +needs. Full details are in the Sage installation guide at +http://doc.sagemath.org/html/en/installation/ and +http://doc.sagemath.org/html/en/tutorial/sagetex.html . + +The directory ``$SAGE_ROOT/local/share/doc/sagetex`` contains +documentation and an example file. See +``$SAGE_ROOT/local/share/texmf/tex/latex/sagetex`` for the source code +and some possibly useful scripts. If you have problems or suggestions +see `the sage-support +group `__. + +If you want to help develop SageTeX, please clone the github repository +(see the "Upstream Contact" above) and send me patches based on that. diff --git a/build/pkgs/sagetex/SPKG.txt b/build/pkgs/sagetex/SPKG.txt deleted file mode 100644 index e4bb1dc683f..00000000000 --- a/build/pkgs/sagetex/SPKG.txt +++ /dev/null @@ -1,56 +0,0 @@ -= SageTeX = - -== Description == - -The SageTeX package allows you to embed code, results of computations, -and plots from Sage into LaTeX documents. - -== License == - -The ''source code'' of the SageTeX package may be redistributed and/or -modified 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. To view a copy of this license, see -[[http://www.gnu.org/licenses/]] or send a letter to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. - -The ''documentation'' of the SageTeX package is licensed under the -Creative Commons Attribution-Share Alike 3.0 License. To view a copy of -this license, visit [[http://creativecommons.org/licenses/by-sa/3.0/]] -or send a letter to Creative Commons, 171 Second Street, Suite 300, San -Francisco, California, 94105, USA. - -== SPKG Maintainers == - -Dan Drake (dr.dan.drake at gmail) -and -SageMath developers (sage-devel@googlegroups.com) - -== Upstream Contact == - -Author: Dan Drake. Web: [[https://github.com/sagemath/sagetex]] - -== Dependencies == - -To install, nothing more than a standard Sage install. The -`spkg-check` script will exit without actually testing anything if -it cannot find "latex" in your path. - -== Notes == - -To use SageTeX, both Sage and LaTeX need to know about it. SageTeX comes -standard with Sage, so you only need to make sure LaTeX can find what it -needs. Full details are in the Sage installation guide at -http://doc.sagemath.org/html/en/installation/ and -http://doc.sagemath.org/html/en/tutorial/sagetex.html . - -The directory `$SAGE_ROOT/local/share/doc/sagetex` contains -documentation and an example file. See -`$SAGE_ROOT/local/share/texmf/tex/latex/sagetex` for the source code and -some possibly useful scripts. If you have problems or suggestions see -[[http://groups.google.com/group/sage-support|the sage-support group]]. - -If you want to help develop SageTeX, please clone the github -repository (see the "Upstream Contact" above) and send me -patches based on that. diff --git a/build/pkgs/scandir/SPKG.txt b/build/pkgs/scandir/SPKG.rst similarity index 76% rename from build/pkgs/scandir/SPKG.txt rename to build/pkgs/scandir/SPKG.rst index 82ac2f24bb9..99ffec860a1 100644 --- a/build/pkgs/scandir/SPKG.txt +++ b/build/pkgs/scandir/SPKG.rst @@ -1,13 +1,14 @@ -= scandir = +scandir +======= -== Description == +Description +----------- scandir, a better directory iterator and faster os.walk() scandir() is a directory iteration function like os.listdir(), except that instead of returning a list of bare filenames, it yields DirEntry -objects that include file type and stat information along with the -name. Using scandir() increases the speed of os.walk() by 2-20 times +objects that include file type and stat information along with the name. +Using scandir() increases the speed of os.walk() by 2-20 times (depending on the platform and file system) by avoiding unnecessary calls to os.stat() in most cases. - diff --git a/build/pkgs/scipoptsuite/SPKG.rst b/build/pkgs/scipoptsuite/SPKG.rst new file mode 100644 index 00000000000..febc62d889d --- /dev/null +++ b/build/pkgs/scipoptsuite/SPKG.rst @@ -0,0 +1,49 @@ +scipoptsuite +============ + +Description +----------- + +SCIP is currently one of the fastest non-commercial mixed integer +programming (MIP) solvers. It is also a framework for constraint integer +programming and branch-cut-and-price. It allows total control of the +solution process and the access of detailed information down to the guts +of the solver. + +License +------- + +ZIB Academic License + +The ZIB Academic License allows the use of software distributed under +this license without charge for research purposes as a member of a +non-commercial and academic institution, e.g., a university. The +software is available with its source code. + +http://scip.zib.de/academic.txt + + +SPKG Maintainers +---------------- + +- Martin Albrecht (original spkg) +- Matthias Koeppe (updates for new spkg style) + + +Upstream Contact +---------------- + +http://scip.zib.de/doc/html/AUTHORS.shtml + +Dependencies +------------ + +cmake + + +Special Update/Build Instructions +--------------------------------- + +We do not have permission to redistribute SCIP or SoPlex. Hence, you +must download it yourself from http://scip.zib.de and put the tarball +scipoptsuite-VERSION.tgz in $SAGE_ROOT/upstream diff --git a/build/pkgs/scipoptsuite/SPKG.txt b/build/pkgs/scipoptsuite/SPKG.txt deleted file mode 100644 index d37e355813f..00000000000 --- a/build/pkgs/scipoptsuite/SPKG.txt +++ /dev/null @@ -1,38 +0,0 @@ -= scipoptsuite = - -== Description == - -SCIP is currently one of the fastest non-commercial mixed integer programming -(MIP) solvers. It is also a framework for constraint integer programming and -branch-cut-and-price. It allows total control of the solution process and the -access of detailed information down to the guts of the solver. - -== License == - -ZIB Academic License - -The ZIB Academic License allows the use of software distributed under this -license without charge for research purposes as a member of a non-commercial and -academic institution, e.g., a university. The software is available with its -source code. - -http://scip.zib.de/academic.txt - -== SPKG Maintainers == - -* Martin Albrecht (original spkg) -* Matthias Koeppe (updates for new spkg style) - -== Upstream Contact == - -http://scip.zib.de/doc/html/AUTHORS.shtml - -== Dependencies == - -cmake - -== Special Update/Build Instructions == - -We do not have permission to redistribute SCIP or SoPlex. Hence, you -must download it yourself from http://scip.zib.de and put the tarball -scipoptsuite-VERSION.tgz in $SAGE_ROOT/upstream diff --git a/build/pkgs/scipy/SPKG.rst b/build/pkgs/scipy/SPKG.rst new file mode 100644 index 00000000000..f037ff798a5 --- /dev/null +++ b/build/pkgs/scipy/SPKG.rst @@ -0,0 +1,41 @@ +scipy +===== + +Description +----------- + +SciPy (pronounced "Sigh Pie") is open-source software for mathematics, +science, and engineering. The SciPy library depends on NumPy, which +provides convenient and fast N-dimensional array manipulation. The SciPy +library is built to work with NumPy arrays, and provides many +user-friendly and efficient numerical routines such as routines for +numerical integration and optimization. Together, they run on all +popular operating systems, are quick to install, and are free of charge. +NumPy and SciPy are easy to use, but powerful enough to be depended upon +by some of the world's leading scientists and engineers. + +License +------- + +SciPy's license is free for both commercial and non-commercial use, +under the BSD terms. See http://www.scipy.org/License_Compatibility + + +Upstream Contact +---------------- + + http://www.scipy.org/ + +Dependencies +------------ + +- Python, which in Sage has numerous dependencies +- Numpy +- Fortran +- GNU patch + + +Special Update/Build Instructions +--------------------------------- + +- None. diff --git a/build/pkgs/scipy/SPKG.txt b/build/pkgs/scipy/SPKG.txt deleted file mode 100644 index 9754f5f9f70..00000000000 --- a/build/pkgs/scipy/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= scipy = - -== Description == -SciPy (pronounced "Sigh Pie") is open-source software for mathematics, -science, and engineering. The SciPy library depends on NumPy, which provides -convenient and fast N-dimensional array manipulation. The SciPy library is -built to work with NumPy arrays, and provides many user-friendly and efficient -numerical routines such as routines for numerical integration and optimization. -Together, they run on all popular operating systems, are quick to install, and -are free of charge. NumPy and SciPy are easy to use, but powerful enough to be -depended upon by some of the world's leading scientists and engineers. - -== License == -SciPy's license is free for both commercial and non-commercial use, under the -BSD terms. See http://www.scipy.org/License_Compatibility - -== Upstream Contact == - http://www.scipy.org/ - -== Dependencies == - * Python, which in Sage has numerous dependencies - * Numpy - * Fortran - * GNU patch - -== Special Update/Build Instructions == - * None. - diff --git a/build/pkgs/scons/SPKG.rst b/build/pkgs/scons/SPKG.rst new file mode 100644 index 00000000000..2a3822517f8 --- /dev/null +++ b/build/pkgs/scons/SPKG.rst @@ -0,0 +1,30 @@ +SCons +===== + +Description +----------- + +SCons is an Open Source software construction tool—that is, a +next-generation build tool. Think of SCons as an improved, +cross-platform substitute for the classic Make utility with integrated +functionality similar to autoconf/automake and compiler caches such as +ccache. In short, SCons is an easier, more reliable and faster way to +build software. + +Website: http://www.scons.org/ + +License +------- + +X/MIT + + +Upstream Contact +---------------- + +- SCons mailing lists - see http://www.scons.org/lists.php + +Dependencies +------------ + +- Python diff --git a/build/pkgs/scons/SPKG.txt b/build/pkgs/scons/SPKG.txt deleted file mode 100644 index bad9e3a9bf9..00000000000 --- a/build/pkgs/scons/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= SCons = - -== Description == - -SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software. - -Website: http://www.scons.org/ - -== License == - -X/MIT - -== Upstream Contact == - * SCons mailing lists - see http://www.scons.org/lists.php - -== Dependencies == - * Python - diff --git a/build/pkgs/send2trash/SPKG.txt b/build/pkgs/send2trash/SPKG.rst similarity index 93% rename from build/pkgs/send2trash/SPKG.txt rename to build/pkgs/send2trash/SPKG.rst index d829cf1573b..83784265b8c 100644 --- a/build/pkgs/send2trash/SPKG.txt +++ b/build/pkgs/send2trash/SPKG.rst @@ -1,6 +1,8 @@ -= Send2Trash = +Send2Trash +========== -== Description == +Description +----------- Send file to trash natively under Mac OS X, Windows and Linux. diff --git a/build/pkgs/setuptools/SPKG.rst b/build/pkgs/setuptools/SPKG.rst new file mode 100644 index 00000000000..182ce736f0d --- /dev/null +++ b/build/pkgs/setuptools/SPKG.rst @@ -0,0 +1,41 @@ +setuptools +========== + +Description +----------- + +setuptools is a collection of enhancements to the Python distutils (for +Python 2.6 and up) that allow you to more easily build and distribute +Python packages, especially ones that have dependencies on other +packages. + +Website: http://pypi.python.org/pypi/setuptools/ + +License +------- + +PSF or ZPL. i.e Python Software Foundation License or Zope Public +License + + +Upstream Contact +---------------- + +- Phillip J. Eby (distutils-sig@python org) + +Dependencies +------------ + +- python + + +Build Instructions/Changes +-------------------------- + +The following patches are in the patches subdirectory. The patches are +applied during the build process. + +- pkg_resources.py.patch: silence warning about permissions. + +- easy_install_lock.patch: lock the easy_install.pth file to allow + simultaneous installation diff --git a/build/pkgs/setuptools/SPKG.txt b/build/pkgs/setuptools/SPKG.txt deleted file mode 100644 index 39446467083..00000000000 --- a/build/pkgs/setuptools/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= setuptools = - -== Description == - -setuptools is a collection of enhancements to the Python distutils (for -Python 2.6 and up) that allow you to more easily build and distribute -Python packages, especially ones that have dependencies on other packages. - -Website: http://pypi.python.org/pypi/setuptools/ - -== License == - -PSF or ZPL. i.e Python Software Foundation License or Zope Public License - -== Upstream Contact == - * Phillip J. Eby (distutils-sig@python org) - -== Dependencies == - * python - -== Build Instructions/Changes == - -The following patches are in the patches subdirectory. -The patches are applied during the build process. - - * pkg_resources.py.patch: silence warning about permissions. - - * easy_install_lock.patch: lock the easy_install.pth file to allow - simultaneous installation - diff --git a/build/pkgs/setuptools_scm/SPKG.txt b/build/pkgs/setuptools_scm/SPKG.rst similarity index 51% rename from build/pkgs/setuptools_scm/SPKG.txt rename to build/pkgs/setuptools_scm/SPKG.rst index 23567beee69..4ed3f3da711 100644 --- a/build/pkgs/setuptools_scm/SPKG.txt +++ b/build/pkgs/setuptools_scm/SPKG.rst @@ -1,5 +1,7 @@ -= setuptools_scm = +setuptools_scm +============== -== Description == +Description +----------- the blessed package to manage your versions by scm tags diff --git a/build/pkgs/simplegeneric/SPKG.txt b/build/pkgs/simplegeneric/SPKG.rst similarity index 50% rename from build/pkgs/simplegeneric/SPKG.txt rename to build/pkgs/simplegeneric/SPKG.rst index 0fa7cf0a667..82b468c52ff 100644 --- a/build/pkgs/simplegeneric/SPKG.txt +++ b/build/pkgs/simplegeneric/SPKG.rst @@ -1,15 +1,18 @@ -= simplegeneric = +simplegeneric +============= -== Description == +Description +----------- -Simple generic functions (similar to Python's own len(), pickle.dump(), etc.) +Simple generic functions (similar to Python's own len(), pickle.dump(), +etc.) The simplegeneric module lets you define simple single-dispatch generic -functions, akin to Python's built-in generic functions like len() -iter() and so on. However, instead of using specially-named methods, -these generic functions use simple lookup tables, akin to those used by -e.g. pickle.dump() and other generic functions found in the Python -standard library. +functions, akin to Python's built-in generic functions like len() iter() +and so on. However, instead of using specially-named methods, these +generic functions use simple lookup tables, akin to those used by e.g. +pickle.dump() and other generic functions found in the Python standard +library. As you can see from the above examples, generic functions are actually quite common in Python already, but there is no standard way to create @@ -17,9 +20,9 @@ simple ones. This library attempts to fill that gap, as generic functions are an excellent alternative to the Visitor pattern, as well as being a great substitute for most common uses of adaptation. -This library tries to be the simplest possible implementation of -generic functions, and it therefore eschews the use of multiple or -predicate dispatch, as well as avoiding speedup techniques such as C -dispatching or code generation. But it has absolutely no dependencies, -other than Python 2.4, and the implementation is just a single Python -module of less than 100 lines. +This library tries to be the simplest possible implementation of generic +functions, and it therefore eschews the use of multiple or predicate +dispatch, as well as avoiding speedup techniques such as C dispatching +or code generation. But it has absolutely no dependencies, other than +Python 2.4, and the implementation is just a single Python module of +less than 100 lines. diff --git a/build/pkgs/singledispatch/SPKG.rst b/build/pkgs/singledispatch/SPKG.rst new file mode 100644 index 00000000000..de7f7337ccb --- /dev/null +++ b/build/pkgs/singledispatch/SPKG.rst @@ -0,0 +1,25 @@ +singledispatch +============== + +Description +----------- + +This library brings functools.singledispatch from Python 3.4 to Python +2.6-3.3. + +License +------- + +MIT License + + +Upstream Contact +---------------- + +Author: Łukasz Langa Home page: +http://docs.python.org/3/library/functools.html#functools.singledispatch + +Dependencies +------------ + +Python diff --git a/build/pkgs/singledispatch/SPKG.txt b/build/pkgs/singledispatch/SPKG.txt deleted file mode 100644 index b4e1bf97614..00000000000 --- a/build/pkgs/singledispatch/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= singledispatch = - -== Description == - -This library brings functools.singledispatch from Python 3.4 to -Python 2.6-3.3. - -== License == - -MIT License - -== Upstream Contact == - -Author: Łukasz Langa -Home page: http://docs.python.org/3/library/functools.html#functools.singledispatch - -== Dependencies == - -Python - diff --git a/build/pkgs/singular/SPKG.rst b/build/pkgs/singular/SPKG.rst new file mode 100644 index 00000000000..af9574e0afd --- /dev/null +++ b/build/pkgs/singular/SPKG.rst @@ -0,0 +1,45 @@ +Singular +======== + +Description +----------- + +Singular is a computer algebra system for polynomial computations, with +special emphasis on commutative and non-commutative algebra, algebraic +geometry, and singularity theory. + +License +------- + +GPLv2 or GPLv3 + + +Upstream Contact +---------------- + +libsingular-devel@mathematik.uni-kl.de + +http://www.singular.uni-kl.de/ + +Dependencies +------------ + +- GNU patch +- readline +- GMP/MPIR +- MPFR +- NTL +- FLINT + + +Special Update/Build Instructions +--------------------------------- + +See spkg-src to create the source tarball. + +Other notes: + +- If the environment variable SAGE_DEBUG is set to "yes", then + omalloc will be replaced by xalloc. The resulting Singular executable + and libsingular library will be slower than with omalloc, but allow + for easier debugging of memory corruptions. diff --git a/build/pkgs/singular/SPKG.txt b/build/pkgs/singular/SPKG.txt deleted file mode 100644 index 6dc588577ba..00000000000 --- a/build/pkgs/singular/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= Singular = - -== Description == - -Singular is a computer algebra system for polynomial computations, -with special emphasis on commutative and non-commutative algebra, -algebraic geometry, and singularity theory. - -== License == - -GPLv2 or GPLv3 - -== Upstream Contact == - -libsingular-devel@mathematik.uni-kl.de - -http://www.singular.uni-kl.de/ - -== Dependencies == - -* GNU patch -* readline -* GMP/MPIR -* MPFR -* NTL -* FLINT - -== Special Update/Build Instructions == - -See spkg-src to create the source tarball. - -Other notes: - * If the environment variable SAGE_DEBUG is set to "yes", then - omalloc will be replaced by xalloc. The resulting Singular executable - and libsingular library will be slower than with omalloc, but allow - for easier debugging of memory corruptions. diff --git a/build/pkgs/singular_jupyter/SPKG.rst b/build/pkgs/singular_jupyter/SPKG.rst new file mode 100644 index 00000000000..282bbc5f621 --- /dev/null +++ b/build/pkgs/singular_jupyter/SPKG.rst @@ -0,0 +1,21 @@ + +jupyter-kernel-singular +======================= + +Description +----------- + +A Jupyter kernel for singular + +This is a beta version of a jupyter kernel for Singular. + +License +------- + +GPL version 2 or later + + +Upstream Contact +---------------- + +- https://github.com/sebasguts/jupyter_kernel_singular diff --git a/build/pkgs/singular_jupyter/SPKG.txt b/build/pkgs/singular_jupyter/SPKG.txt deleted file mode 100644 index ced40f28a9e..00000000000 --- a/build/pkgs/singular_jupyter/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= jupyter-kernel-singular = - -== Description == - -A Jupyter kernel for singular - -This is a beta version of a jupyter kernel for Singular. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -* https://github.com/sebasguts/jupyter_kernel_singular diff --git a/build/pkgs/sip/SPKG.rst b/build/pkgs/sip/SPKG.rst new file mode 100644 index 00000000000..d84fbc5cbf6 --- /dev/null +++ b/build/pkgs/sip/SPKG.rst @@ -0,0 +1,24 @@ +SIP +=== + +Description +----------- + +Python extension module generator for C and C++ libraries + + +Upstream contact +---------------- + +- https://www.riverbankcomputing.com/software/sip/ +- https://pypi.python.org/pypi/SIP + +License +------- + +SIP is released under the GPL v2, GPL v3 licenses, and under a +license +similar to the BSD license. + +SIP is copyright (c) Riverbank Computing Limited. Its homepage is +https://www.riverbankcomputing.com/software/sip/. diff --git a/build/pkgs/sip/SPKG.txt b/build/pkgs/sip/SPKG.txt deleted file mode 100644 index d253236fc9b..00000000000 --- a/build/pkgs/sip/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= SIP = - -== Description == - -Python extension module generator for C and C++ libraries - -== Upstream contact == - - https://www.riverbankcomputing.com/software/sip/ - https://pypi.python.org/pypi/SIP - -== License == - - SIP is released under the GPL v2, GPL v3 licenses, and under a license - similar to the BSD license. - - SIP is copyright (c) Riverbank Computing Limited. Its homepage is - https://www.riverbankcomputing.com/software/sip/. diff --git a/build/pkgs/sirocco/SPKG.rst b/build/pkgs/sirocco/SPKG.rst new file mode 100644 index 00000000000..3d88325f106 --- /dev/null +++ b/build/pkgs/sirocco/SPKG.rst @@ -0,0 +1,30 @@ +SIROCCO +======= + +Description +----------- + +sirocco is a library to compute topologically certified root +continuation of bivariate polynomials. + +License +------- + +GPLv3+ + + +SPKG Maintainers +---------------- + +- Miguel Marco + + +Upstream Contact +---------------- + +Miguel Marco (mmarco@unizar.es) + +Dependencies +------------ + +- gcc diff --git a/build/pkgs/sirocco/SPKG.txt b/build/pkgs/sirocco/SPKG.txt deleted file mode 100644 index 7110501049d..00000000000 --- a/build/pkgs/sirocco/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= SIROCCO = - -== Description == - -sirocco is a library to compute topologically certified root continuation of bivariate polynomials. - -== License == - -GPLv3+ - -== SPKG Maintainers == - -* Miguel Marco - -== Upstream Contact == - -Miguel Marco (mmarco@unizar.es) - -== Dependencies == - -* gcc diff --git a/build/pkgs/six/SPKG.rst b/build/pkgs/six/SPKG.rst new file mode 100644 index 00000000000..8176852b344 --- /dev/null +++ b/build/pkgs/six/SPKG.rst @@ -0,0 +1,24 @@ +six +=== + +Description +----------- + +Python 2 and 3 compatibility utilities + +License +------- + +MIT License + + +Upstream Contact +---------------- + +- Author: Benjamin Peterson +- Home page: http://pypi.python.org/pypi/six/ + +Dependencies +------------ + +Python diff --git a/build/pkgs/six/SPKG.txt b/build/pkgs/six/SPKG.txt deleted file mode 100644 index e0601654686..00000000000 --- a/build/pkgs/six/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= six = - -== Description == - -Python 2 and 3 compatibility utilities - -== License == - -MIT License - -== Upstream Contact == - -Author: Benjamin Peterson -Home page: http://pypi.python.org/pypi/six/ - -== Dependencies == - -Python - diff --git a/build/pkgs/snowballstemmer/SPKG.rst b/build/pkgs/snowballstemmer/SPKG.rst new file mode 100644 index 00000000000..e1da7151279 --- /dev/null +++ b/build/pkgs/snowballstemmer/SPKG.rst @@ -0,0 +1,29 @@ +snowballstemmer +=============== + +Description +----------- + +This package provides 16 stemmer algorithms (15 + Poerter English +stemmer) generated from Snowball algorithms. + +It includes following language algorithms: + +- Danish +- Dutch +- English (Standard, Porter) +- Finnish +- French +- German +- Hungarian +- Italian +- Norwegian +- Portuguese +- Romanian +- Russian +- Spanish +- Swedish +- Turkish + +This is a pure Python stemming library. If PyStemmer is available, this +module uses it to accelerate. diff --git a/build/pkgs/snowballstemmer/SPKG.txt b/build/pkgs/snowballstemmer/SPKG.txt deleted file mode 100644 index 8a649d28043..00000000000 --- a/build/pkgs/snowballstemmer/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= snowballstemmer = - -== Description == - -This package provides 16 stemmer algorithms (15 + Poerter English stemmer) generated from Snowball algorithms. - -It includes following language algorithms: - - Danish - Dutch - English (Standard, Porter) - Finnish - French - German - Hungarian - Italian - Norwegian - Portuguese - Romanian - Russian - Spanish - Swedish - Turkish - -This is a pure Python stemming library. If PyStemmer is available, this module uses it to accelerate. diff --git a/build/pkgs/speaklater/SPKG.rst b/build/pkgs/speaklater/SPKG.rst new file mode 100644 index 00000000000..1427f283d7d --- /dev/null +++ b/build/pkgs/speaklater/SPKG.rst @@ -0,0 +1,14 @@ +speaklater +========== + +Description +----------- + +Implements a lazy string for python useful for use with gettext + +A module that provides lazy strings for translations. Basically you get +an object that appears to be a string but changes the value every time +the value is evaluated based on a callable you provide. + +For example you can have a global lazy_gettext function that returns a +lazy string with the value of the current set language. diff --git a/build/pkgs/speaklater/SPKG.txt b/build/pkgs/speaklater/SPKG.txt deleted file mode 100644 index 3143efa59f3..00000000000 --- a/build/pkgs/speaklater/SPKG.txt +++ /dev/null @@ -1,12 +0,0 @@ -= speaklater = - -== Description == - -Implements a lazy string for python useful for use with gettext - -A module that provides lazy strings for translations. Basically you get an -object that appears to be a string but changes the value every time the value -is evaluated based on a callable you provide. - -For example you can have a global lazy_gettext function that returns a lazy -string with the value of the current set language. diff --git a/build/pkgs/sphinx/SPKG.rst b/build/pkgs/sphinx/SPKG.rst new file mode 100644 index 00000000000..43f741e9441 --- /dev/null +++ b/build/pkgs/sphinx/SPKG.rst @@ -0,0 +1,47 @@ +Sphinx +====== + +Description +----------- + +Sphinx is a tool that makes it easy to create intelligent and beautiful +documentation for Python projects (or other documents consisting of +multiple reStructuredText sources), written by Georg Brandl. It was +originally created to translate the new Python documentation, but has +now been cleaned up in the hope that it will be useful to many other +projects. + +License +------- + +Modified BSD; see e.g. its egg-info file for other options + + +Upstream Contact +---------------- + +- Author: Georg Brandl +- Home Page: http://sphinx.pocoo.org, + see also http://pypi.python.org/pypi/Sphinx + +Dependencies +------------ + +- six >= 1.4 +- Jinja2 >= 2.3 +- Pygments >= 2.0 +- docutils >= 0.11 +- snowballstemmer >= 1.1 +- babel >= 1.3 +- setuptools / distribute +- Python +- GNU patch (shipped with Sage) + + +Special Update/Build Instructions +--------------------------------- + +- The script create_grammar_pickle.py creates the file + Grammar2.7.pickle in site-packages/Sphinx-.../sphinx/pycode/. This + helps to avoid race conditions when building the documentation in + parallel. diff --git a/build/pkgs/sphinx/SPKG.txt b/build/pkgs/sphinx/SPKG.txt deleted file mode 100644 index fce17ba0963..00000000000 --- a/build/pkgs/sphinx/SPKG.txt +++ /dev/null @@ -1,38 +0,0 @@ -= Sphinx = - -== Description == - -Sphinx is a tool that makes it easy to create intelligent and -beautiful documentation for Python projects (or other documents -consisting of multiple reStructuredText sources), written by Georg -Brandl. It was originally created to translate the new Python -documentation, but has now been cleaned up in the hope that it will be -useful to many other projects. - -== License == - -Modified BSD; see e.g. its egg-info file for other options - -== Upstream Contact == - -Author: Georg Brandl -Home Page: http://sphinx.pocoo.org, - see also http://pypi.python.org/pypi/Sphinx - -== Dependencies == - * six >= 1.4 - * Jinja2 >= 2.3 - * Pygments >= 2.0 - * docutils >= 0.11 - * snowballstemmer >= 1.1 - * babel >= 1.3 - * setuptools / distribute - * Python - * GNU patch (shipped with Sage) - -== Special Update/Build Instructions == - - * The script create_grammar_pickle.py creates the file - Grammar2.7.pickle in site-packages/Sphinx-.../sphinx/pycode/. This - helps to avoid race conditions when building the documentation in - parallel. diff --git a/build/pkgs/sphinxcontrib_websupport/SPKG.rst b/build/pkgs/sphinxcontrib_websupport/SPKG.rst new file mode 100644 index 00000000000..27d4a863612 --- /dev/null +++ b/build/pkgs/sphinxcontrib_websupport/SPKG.rst @@ -0,0 +1,16 @@ + +sphinxcontrib-websupport +======================== + +Description +----------- + +Sphinx API for Web Apps + +sphinxcontrib-webuspport provides a Python API to easily integrate +Sphinx documentation into your Web application. + +License +------- + +BSD diff --git a/build/pkgs/sphinxcontrib_websupport/SPKG.txt b/build/pkgs/sphinxcontrib_websupport/SPKG.txt deleted file mode 100644 index cda85a6edf6..00000000000 --- a/build/pkgs/sphinxcontrib_websupport/SPKG.txt +++ /dev/null @@ -1,12 +0,0 @@ -= sphinxcontrib-websupport = - -== Description == - -Sphinx API for Web Apps - -sphinxcontrib-webuspport provides a Python API to easily integrate Sphinx -documentation into your Web application. - -== License == - -BSD diff --git a/build/pkgs/sqlite/SPKG.rst b/build/pkgs/sqlite/SPKG.rst new file mode 100644 index 00000000000..f4b5d69f9a7 --- /dev/null +++ b/build/pkgs/sqlite/SPKG.rst @@ -0,0 +1,30 @@ +SQLite +====== + +Description +----------- + +SQLite is a software library that implements a self-contained, +serverless, zero-configuration, transactional SQL database engine. + +License +------- + +Public Domain + + +Upstream contact +---------------- + +- http://www.sqlite.org + +Dependencies +------------ + +- readline + + +Special Update/Build Instructions +--------------------------------- + +- Use the autoconf version of sqlite. diff --git a/build/pkgs/sqlite/SPKG.txt b/build/pkgs/sqlite/SPKG.txt deleted file mode 100644 index 23698c87b59..00000000000 --- a/build/pkgs/sqlite/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= SQLite = - -== Description == - -SQLite is a software library that implements a self-contained, -serverless, zero-configuration, transactional SQL database engine. - -== License == - -Public Domain - -== Upstream contact == - - * http://www.sqlite.org - -== Dependencies == - -* readline - -== Special Update/Build Instructions == - -* Use the autoconf version of sqlite. diff --git a/build/pkgs/subprocess32/SPKG.txt b/build/pkgs/subprocess32/SPKG.rst similarity index 57% rename from build/pkgs/subprocess32/SPKG.txt rename to build/pkgs/subprocess32/SPKG.rst index 0bacc96c8a1..79ec8a9aac1 100644 --- a/build/pkgs/subprocess32/SPKG.txt +++ b/build/pkgs/subprocess32/SPKG.rst @@ -1,5 +1,7 @@ -= subprocess32 = +subprocess32 +============ -== Description == +Description +----------- A backport of the subprocess module from Python 3 for use on 2.x diff --git a/build/pkgs/suitesparse/SPKG.rst b/build/pkgs/suitesparse/SPKG.rst new file mode 100644 index 00000000000..773d8aebfb4 --- /dev/null +++ b/build/pkgs/suitesparse/SPKG.rst @@ -0,0 +1,1089 @@ +SuiteSparse +=========== + +SuiteSparse is a collection of software to deal with sparse matrix. It is +hosted at http://faculty.cse.tamu.edu/davis/suitesparse.html + +This spkg does a minimal install of suitesparse disabling the following + +- metis +- GraphBLAS (need cmake) +- Mongoose (need cmake) + +An external metis package can be used but we just disable its use. + +Patches: + +- The first patch disable the building of package using cmake. +- The second patch make sure we use sage's blas/lapack on OS X. By + default + suitesparse discard any configurations to use the accelerate framework. + +The building of metis is diabled by passing MY_METIS_LIB=none to make +(any value would have done) We also configure cholmod so it doesn't +require metis by passing CHOLMOD_CONFIG=-DNPARTITION to make. + +Other configurations are self explanatory. + +License: because SuiteSparse is a collection, it comes with a variety of +licenses. Find below a copy of the "LICENSES.txt" shipped with +SuiteSparse. + +AMD/Doc/License.txt +------------------- + + AMD, Copyright (c), 1996-2015, Timothy A. Davis, + Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. + + Availability: + + http://www.suitesparse.com + + AMD License: BSD 3-clause: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +BTF/Doc/License.txt +------------------- + + BTF, Copyright (C) 2004-2013, University of Florida + by Timothy A. Davis and Ekanathan Palamadai. + BTF is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + BTF is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + BTF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +CAMD/Doc/License.txt +------------------------ + + CAMD, Copyright (c) by Timothy A. Davis, + Yanqing Chen, + Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. + CAMD is available under alternate licenses, contact T. Davis for + details. + + CAMD License: BSD 3-clause + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + + Availability: + + http://www.suitesparse.com + +CCOLAMD/Doc/License.txt +----------------------- + + CCOLAMD: constrained column approximate minimum degree ordering + Copyright (C) 2005-2016, Univ. of Florida. Authors: Timothy A. Davis, + Sivasankaran Rajamanickam, and Stefan Larimore. Closely based on + COLAMD by + Davis, Stefan Larimore, in collaboration with Esmond Ng, and John + Gilbert. + http://www.suitesparse.com + + CCOLAMD license: BSD 3-clause: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +CHOLMOD/Doc/License.txt +----------------------- + + ==Check/License.txt== + + CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis + CHOLMOD is + also available under other licenses; contact authors for details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Check module only. + All CHOLMOD modules are licensed separately. + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + ==Cholesky/License.txt== + + CHOLMOD/Cholesky module, Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD is also available under other licenses; contact authors for + details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Cholesky module only. + All CHOLMOD modules are licensed separately. + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + ==Core/License.txt== + + CHOLMOD/Core Module. Copyright (C) 2005-2006, Univ. of Florida. + Author: + Timothy A. Davis. CHOLMOD is also available under other licenses; + contact + authors for details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Core module only. + All CHOLMOD modules are licensed separately. + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + ==Demo/License.txt== + + CHOLMOD/Demo Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD + is also available under other licenses; contact authors for details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Demo module only. + All CHOLMOD modules are licensed separately. + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + + ==Include/License.txt== + + CHOLMOD/Include/\* files. Copyright (C) 2005-2006, either Univ. of + Florida + or T. Davis, depending on the file. + + Each file is licensed separately, according to the Module for which + it + contains definitions and prototypes: + + Include/cholmod.h LGPL + Include/cholmod_blas.h LGPL + Include/cholmod_camd.h part of Partition module + Include/cholmod_check.h part of Check module + Include/cholmod_cholesky.h part of Cholesky module + Include/cholmod_complexity.h LGPL + Include/cholmod_config.h LGPL + Include/cholmod_core.h part of Core module + Include/cholmod_function.h no license; freely usable, no restrictions + Include/cholmod_gpu.h part of GPU module + Include/cholmod_gpu_kernels.h part of GPU module + Include/cholmod_internal.h LGPL + Include/cholmod_io64.h LGPL + Include/cholmod_matrixops.h part of MatrixOps module + Include/cholmod_modify.h part of Modify module + Include/cholmod_partition.h part of Partition module + Include/cholmod_supernodal.h part of Supernodal module + Include/cholmod_template.h LGPL + + ==MATLAB/License.txt== + + CHOLMOD/MATLAB Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD + is also available under other licenses; contact authors for details. + MATLAB(tm) is a Registered Trademark of The MathWorks, Inc. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/MATLAB module only. + All CHOLMOD modules are licensed separately. + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + + ==MatrixOps/License.txt== + + CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD is also available under other licenses; contact authors for + details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/MatrixOps module only. + All CHOLMOD modules are licensed separately. + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + + ==Modify/License.txt== + + CHOLMOD/Modify Module. Copyright (C) 2005-2006, Timothy A. Davis and + William W. Hager. CHOLMOD is also available under other licenses; + contact + authors for details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Modify module only. + All CHOLMOD modules are licensed separately. + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + + + ==Partition/License.txt== + + + CHOLMOD/Partition Module. + Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Partition module only. + All CHOLMOD modules are licensed separately. + + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + + ==Supernodal/License.txt== + + + CHOLMOD/Supernodal Module. + Copyright (C) 2005-2006, Timothy A. Davis + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Supernodal module only. + All CHOLMOD modules are licensed separately. + + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + + + ==Tcov/License.txt== + + + CHOLMOD/Tcov Module. Copyright (C) 2005-2006, Timothy A. Davis + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Tcov module only. + All CHOLMOD modules are licensed separately. + + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + + ==Valgrind/License.txt== + + CHOLMOD/Valgrind Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Valgrind module only. + All CHOLMOD modules are licensed separately. + + This Module 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. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +COLAMD/Doc/License.txt +---------------------- + + COLAMD, Copyright 1998-2016, Timothy A. Davis. + http://www.suitesparse.com + http://www.suitesparse.com + + COLAMD License: BSD 3-clause + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +CSparse/Doc/License.txt +----------------------- + + CSparse: a Concise Sparse matrix package. + Copyright (c) 2006, Timothy A. Davis. + http://www.suitesparse.com + + CSparse is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + CSparse is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +CXSparse/Doc/License.txt +------------------------ + + CXSparse: a Concise Sparse matrix package - Extended. + Copyright (c) 2006, Timothy A. Davis. + http://www.suitesparse.com + + CXSparse is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + CXSparse is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +CXSparse_newfiles/Doc/License.txt +--------------------------------- + + CXSparse: a Concise Sparse matrix package - Extended. + Copyright (c) 2006, Timothy A. Davis. + http://www.suitesparse.com + + CXSparse is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + CXSparse is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +GPUQREngine/Doc/License.txt +--------------------------- + + GPUQREngine Copyright (c) 2013, Timothy A. Davis, Sencer Nuri + Yeralan, + and Sanjay Ranka. + http://www.suitesparse.com + + GPUQREngine 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. + + GPUQREngine is distributed in the hope that it will be useful, but + WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along with + this Module; if not, write to the Free Software Foundation, Inc., 51 + Franklin + Street, Fifth Floor, Boston, MA 02110-1301, USA. + +KLU/Doc/License.txt +------------------- + + KLU, Copyright (C) 2004-2013, University of Florida + by Timothy A. Davis and Ekanathan Palamadai. + KLU is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + KLU is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + KLU is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +LDL/Doc/License.txt +------------------- + + LDL Copyright (c) 2005-2013 by Timothy A. Davis. + LDL is also available under other licenses; contact the author for + details. + http://www.suitesparse.com + + LDL is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + LDL is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +MATLAB_Tools/Doc/License.txt +---------------------------- + + The MATLAB_Tools collection of packages is + Copyright (c), Timothy A. Davis, All Rights Reserved, + with the exception of the spqr_rank package, which is + Copyright (c), Timothy A. Davis and Les Foster, All Rights Reserved, + + All packages are available under alternative licenses. + Contact the authors for details. + + MATLAB_Tools License, with the exception of SSMULT and + SuiteSparseCollection: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + + SuiteSparseCollection License: + + SuiteSparseCollection 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. + + SuiteSparseCollection is distributed in the hope that it will be + useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + SSMULT License: + + SSMULT, Copyright (c) 2007-2011, Timothy A. Davis, + http://www.suitesparse.com. + + SSMULT 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. + + SSMULT is distributed in the hope that it will be useful, but WITHOUT + ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along + with this package; if not, write to the Free Software Foundation, + Inc., 51 + Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +RBio/Doc/License.txt +-------------------- + + RBio toolbox. Copyright (C) 2006-2009, Timothy A. Davis + RBio is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + RBio 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. + + RBio is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +SPQR/Doc/License.txt +-------------------- + + SPQR, Copyright 2008-2016 by Timothy A. Davis. + All Rights Reserved. + SPQR is available under alternate licenses, contact T. Davis for + details. + + SPQR License: + + Your use or distribution of SPQR or any modified version of + SPQR implies that you agree to this License. + + This library 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. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + Permission is hereby granted to use or copy this program under the + terms of the GNU GPL, provided that the Copyright, this License, + and the Availability of the original version is retained on all + copies. + User documentation of any code that uses this code or any modified + version of this code must cite the Copyright, this License, the + Availability note, and "Used by permission." Permission to modify + the code and to distribute modified code is granted, provided the + Copyright, this License, and the Availability note are retained, + and a notice that the code was modified is included. + + Availability: + + http://www.suitesparse.com + +SuiteSparse_GPURuntime/Doc/License.txt +-------------------------------------- + + SuiteSparse_GPURuntime Copyright (c) 2013-2016, Timothy A. Davis, + Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com + + SuiteSparse_GPURuntime 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. + + SuiteSparse_GPURuntime is distributed in the hope that it will be + useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more + details. + + You should have received a copy of the GNU General Public License + along with + this Module; if not, write to the Free Software Foundation, Inc., 51 + Franklin + Street, Fifth Floor, Boston, MA 02110-1301, USA. + +ssget/Doc/License.txt +--------------------- + + Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +UMFPACK/Doc/License.txt +----------------------- + + UMFPACK, Copyright 1995-2009 by Timothy A. Davis. + All Rights Reserved. + UMFPACK is available under alternate licenses, contact T. Davis for + details. + + UMFPACK License: + + Your use or distribution of UMFPACK or any modified version of + UMFPACK implies that you agree to this License. + + This library 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. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + Permission is hereby granted to use or copy this program under the + terms of the GNU GPL, provided that the Copyright, this License, + and the Availability of the original version is retained on all + copies. + User documentation of any code that uses this code or any modified + version of this code must cite the Copyright, this License, the + Availability note, and "Used by permission." Permission to modify + the code and to distribute modified code is granted, provided the + Copyright, this License, and the Availability note are retained, + and a notice that the code was modified is included. + + Availability: + + http://www.suitesparse.com + +CSparse/MATLAB/ssget/Doc/License.txt +------------------------------------ + + Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +CXSparse/MATLAB/ssget/Doc/License.txt +------------------------------------- + + Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +GraphBLAS/Doc/License.txt +------------------------- + + SuiteSparse:GraphBLAS, Copyright 2017, Timothy A. Davis + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use SuiteSparse:GraphBLAS except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. + + +Mongoose License +---------------- + + Mongoose, Copyright 2018, Timothy A. Davis, Scott P. Kolodziej, + William W. Hager, S. Nuri Yeralan + Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June + 2007 diff --git a/build/pkgs/suitesparse/SPKG.txt b/build/pkgs/suitesparse/SPKG.txt deleted file mode 100644 index ff1fa1ca2f2..00000000000 --- a/build/pkgs/suitesparse/SPKG.txt +++ /dev/null @@ -1,967 +0,0 @@ -SuiteSpare is a collection of software to deal with sparse matrix. -It is hosted at http://faculty.cse.tamu.edu/davis/suitesparse.html - -This spkg does a minimal install of suitesparse disabling the following -* metis -* GraphBLAS (need cmake) -* Mongoose (need cmake) - -An external metis package can be used but we just disable its use. - -Patches: -* The first patch disable the building of package using cmake. -* The second patch make sure we use sage's blas/lapack on OS X. By default -suitesparse discard any configurations to use the accelerate framework. - -The building of metis is diabled by passing -MY_METIS_LIB=none to make (any value would have done) -We also configure cholmod so it doesn't require metis by -passing -CHOLMOD_CONFIG=-DNPARTITION to make. - -Other configurations are self explanatory. - -License: because SuiteSparse is a collection, it comes with a variety -of licenses. Find below a copy of the "LICENSES.txt" shipped with -SuiteSparse. - -==> AMD/Doc/License.txt <== - - AMD, Copyright (c), 1996-2015, Timothy A. Davis, - Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. - - Availability: - - http://www.suitesparse.com - - ------------------------------------------------------------------------------- - AMD License: BSD 3-clause: - ------------------------------------------------------------------------------- - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -==> BTF/Doc/License.txt <== - BTF, Copyright (C) 2004-2013, University of Florida - by Timothy A. Davis and Ekanathan Palamadai. - BTF is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - BTF is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - BTF is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> CAMD/Doc/License.txt <== - - CAMD, Copyright (c) by Timothy A. Davis, - Yanqing Chen, - Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. - CAMD is available under alternate licenses, contact T. Davis for details. - - CAMD License: BSD 3-clause - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - Availability: - - http://www.suitesparse.com - -==> CCOLAMD/Doc/License.txt <== - - CCOLAMD: constrained column approximate minimum degree ordering - Copyright (C) 2005-2016, Univ. of Florida. Authors: Timothy A. Davis, - Sivasankaran Rajamanickam, and Stefan Larimore. Closely based on COLAMD by - Davis, Stefan Larimore, in collaboration with Esmond Ng, and John Gilbert. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CCOLAMD license: BSD 3-clause: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -------------------------------------------------------------------------------- - -==> CHOLMOD/Doc/License.txt <== - -------------------------------------------------------------------------------- - ==> Check/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is - also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Check module only. - All CHOLMOD modules are licensed separately. - - ---------------------------------------------------------------------------- - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Cholesky/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Cholesky module, Copyright (C) 2005-2006, Timothy A. Davis. - CHOLMOD is also available under other licenses; contact authors for - details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Cholesky module only. - All CHOLMOD modules are licensed separately. - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Core/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Core Module. Copyright (C) 2005-2006, Univ. of Florida. Author: - Timothy A. Davis. CHOLMOD is also available under other licenses; contact - authors for details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Core module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Demo/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Demo Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD - is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Demo module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Include/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Include/* files. Copyright (C) 2005-2006, either Univ. of Florida - or T. Davis, depending on the file. - - Each file is licensed separately, according to the Module for which it - contains definitions and prototypes: - - Include/cholmod.h LGPL - Include/cholmod_blas.h LGPL - Include/cholmod_camd.h part of Partition module - Include/cholmod_check.h part of Check module - Include/cholmod_cholesky.h part of Cholesky module - Include/cholmod_complexity.h LGPL - Include/cholmod_config.h LGPL - Include/cholmod_core.h part of Core module - Include/cholmod_function.h no license; freely usable, no restrictions - Include/cholmod_gpu.h part of GPU module - Include/cholmod_gpu_kernels.h part of GPU module - Include/cholmod_internal.h LGPL - Include/cholmod_io64.h LGPL - Include/cholmod_matrixops.h part of MatrixOps module - Include/cholmod_modify.h part of Modify module - Include/cholmod_partition.h part of Partition module - Include/cholmod_supernodal.h part of Supernodal module - Include/cholmod_template.h LGPL - - -------------------------------------------------------------------------------- - ==> MATLAB/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/MATLAB Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD - is also available under other licenses; contact authors for details. - MATLAB(tm) is a Registered Trademark of The MathWorks, Inc. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/MATLAB module only. - All CHOLMOD modules are licensed separately. - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> MatrixOps/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis. - CHOLMOD is also available under other licenses; contact authors for - details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/MatrixOps module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Modify/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Modify Module. Copyright (C) 2005-2006, Timothy A. Davis and - William W. Hager. CHOLMOD is also available under other licenses; contact - authors for details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Modify module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Partition/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Partition Module. - Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Partition module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Supernodal/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Supernodal Module. - Copyright (C) 2005-2006, Timothy A. Davis - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Supernodal module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Tcov/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Tcov Module. Copyright (C) 2005-2006, Timothy A. Davis - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Tcov module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Valgrind/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Valgrind Module. Copyright (C) 2005-2006, Timothy A. Davis. - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Valgrind module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module 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. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -==> COLAMD/Doc/License.txt <== - COLAMD, Copyright 1998-2016, Timothy A. Davis. http://www.suitesparse.com - http://www.suitesparse.com - - COLAMD License: BSD 3-clause - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -==> CSparse/Doc/License.txt <== - CSparse: a Concise Sparse matrix package. - Copyright (c) 2006, Timothy A. Davis. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CSparse is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - CSparse is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> CXSparse/Doc/License.txt <== - CXSparse: a Concise Sparse matrix package - Extended. - Copyright (c) 2006, Timothy A. Davis. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CXSparse is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - CXSparse is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> CXSparse_newfiles/Doc/License.txt <== - CXSparse: a Concise Sparse matrix package - Extended. - Copyright (c) 2006, Timothy A. Davis. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CXSparse is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - CXSparse is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> GPUQREngine/Doc/License.txt <== - GPUQREngine Copyright (c) 2013, Timothy A. Davis, Sencer Nuri Yeralan, - and Sanjay Ranka. - http://www.suitesparse.com - - GPUQREngine 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. - - GPUQREngine is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin - Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -==> KLU/Doc/License.txt <== - KLU, Copyright (C) 2004-2013, University of Florida - by Timothy A. Davis and Ekanathan Palamadai. - KLU is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - KLU is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - KLU is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> LDL/Doc/License.txt <== - LDL Copyright (c) 2005-2013 by Timothy A. Davis. - LDL is also available under other licenses; contact the author for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - LDL is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - LDL is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> MATLAB_Tools/Doc/License.txt <== - The MATLAB_Tools collection of packages is - Copyright (c), Timothy A. Davis, All Rights Reserved, - with the exception of the spqr_rank package, which is - Copyright (c), Timothy A. Davis and Les Foster, All Rights Reserved, - - All packages are available under alternative licenses. - Contact the authors for details. - - -------------------------------------------------------------------------------- - MATLAB_Tools License, with the exception of SSMULT and SuiteSparseCollection: - -------------------------------------------------------------------------------- - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -------------------------------------------------------------------------------- - SuiteSparseCollection License: - -------------------------------------------------------------------------------- - - SuiteSparseCollection 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. - - SuiteSparseCollection is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - SSMULT License: - -------------------------------------------------------------------------------- - - SSMULT, Copyright (c) 2007-2011, Timothy A. Davis, - http://www.suitesparse.com. - - SSMULT 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. - - SSMULT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along - with this package; if not, write to the Free Software Foundation, Inc., 51 - Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -==> RBio/Doc/License.txt <== - RBio toolbox. Copyright (C) 2006-2009, Timothy A. Davis - RBio is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - RBio 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. - - RBio is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -==> SPQR/Doc/License.txt <== - SPQR, Copyright 2008-2016 by Timothy A. Davis. - All Rights Reserved. - SPQR is available under alternate licenses, contact T. Davis for details. - - SPQR License: - - Your use or distribution of SPQR or any modified version of - SPQR implies that you agree to this License. - - This library 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. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA - - Permission is hereby granted to use or copy this program under the - terms of the GNU GPL, provided that the Copyright, this License, - and the Availability of the original version is retained on all copies. - User documentation of any code that uses this code or any modified - version of this code must cite the Copyright, this License, the - Availability note, and "Used by permission." Permission to modify - the code and to distribute modified code is granted, provided the - Copyright, this License, and the Availability note are retained, - and a notice that the code was modified is included. - - Availability: - - http://www.suitesparse.com - - -==> SuiteSparse_GPURuntime/Doc/License.txt <== - SuiteSparse_GPURuntime Copyright (c) 2013-2016, Timothy A. Davis, - Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - SuiteSparse_GPURuntime 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. - - SuiteSparse_GPURuntime is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along with - this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin - Street, Fifth Floor, Boston, MA 02110-1301, USA. - -==> ssget/Doc/License.txt <== - Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -==> UMFPACK/Doc/License.txt <== - UMFPACK, Copyright 1995-2009 by Timothy A. Davis. - All Rights Reserved. - UMFPACK is available under alternate licenses, contact T. Davis for details. - - UMFPACK License: - - Your use or distribution of UMFPACK or any modified version of - UMFPACK implies that you agree to this License. - - This library 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. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA - - Permission is hereby granted to use or copy this program under the - terms of the GNU GPL, provided that the Copyright, this License, - and the Availability of the original version is retained on all copies. - User documentation of any code that uses this code or any modified - version of this code must cite the Copyright, this License, the - Availability note, and "Used by permission." Permission to modify - the code and to distribute modified code is granted, provided the - Copyright, this License, and the Availability note are retained, - and a notice that the code was modified is included. - - Availability: - - http://www.suitesparse.com - - -==> CSparse/MATLAB/ssget/Doc/License.txt <== - Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -==> CXSparse/MATLAB/ssget/Doc/License.txt <== - Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -==> GraphBLAS/Doc/License.txt <== - SuiteSparse:GraphBLAS, Copyright 2017, Timothy A. Davis - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use SuiteSparse:GraphBLAS except in compliance with the - License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -==> Mongoose License <== - Mongoose, Copyright 2018, Timothy A. Davis, Scott P. Kolodziej, - William W. Hager, S. Nuri Yeralan - Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 - - diff --git a/build/pkgs/surf/SPKG.rst b/build/pkgs/surf/SPKG.rst new file mode 100644 index 00000000000..1e2118c35ed --- /dev/null +++ b/build/pkgs/surf/SPKG.rst @@ -0,0 +1,39 @@ +surf +==== + +Description +----------- + +surf is a tool to visualize some real algebraic geometry: plane +algebraic curves, algebraic surfaces and hyperplane sections of +surfaces. surf is script driven and has (optionally) a nifty GUI using +the Gtk widget set. + +This is used by the Singular Jupyter kernel to produce 3D plots. + +License +------- + +GPL version 2 or later + + +Upstream Contact +---------------- + +http://surf.sourceforge.net (although the project is essentially dead) + +Dependencies +------------ + +- cups (optional) +- GNU flex Version 2.5 or higher +- GTK+ Version 1.2.0 or higher (optional) +- POSIX Threads +- GNU MP(gmp) Version 2 or higher +- lib-tiff +- lib-jpeg +- zlib +- ps2pdf (optional) + +This package is "experimental" because not all of these dependencies are +packaged with Sage. diff --git a/build/pkgs/surf/SPKG.txt b/build/pkgs/surf/SPKG.txt deleted file mode 100644 index 4967aa2cc72..00000000000 --- a/build/pkgs/surf/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= surf = - -== Description == - -surf is a tool to visualize some real algebraic geometry: plane algebraic -curves, algebraic surfaces and hyperplane sections of surfaces. surf is script -driven and has (optionally) a nifty GUI using the Gtk widget set. - -This is used by the Singular Jupyter kernel to produce 3D plots. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -http://surf.sourceforge.net -(although the project is essentially dead) - -== Dependencies == - -* cups (optional) -* GNU flex Version 2.5 or higher -* GTK+ Version 1.2.0 or higher (optional) -* POSIX Threads -* GNU MP(gmp) Version 2 or higher -* lib-tiff -* lib-jpeg -* zlib -* ps2pdf (optional) - -This package is "experimental" because not all of these dependencies are -packaged with Sage. diff --git a/build/pkgs/symmetrica/SPKG.rst b/build/pkgs/symmetrica/SPKG.rst new file mode 100644 index 00000000000..bd82eda45f7 --- /dev/null +++ b/build/pkgs/symmetrica/SPKG.rst @@ -0,0 +1,57 @@ +symmetrica +========== + +Description +----------- + +Symmetrica is a program developed by Lehrstuhl Mathematik II of the +University of Bayreuth. It has routines to handle the following topics + +- ordinary representation theory of the symmetric group and related + groups (2/11/04) +- ordinary representation theory of the classical groups +- modular representation theory of the symmetric group +- projective representation theory of the symmetric group +- combinatorics of tableaux +- symmetric functions and polynomials (7/22/04) +- commutative and non commutative Schubert polynomials +- operations of finite groups. +- ordinary representation theory of Hecke algebras of type A_n + +For more details check http://www.symmetrica.de (currently redirects to +http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA) + +License +------- + +Public Domain (see the above web site) + + +Upstream Contact +---------------- + +- Axel Kohnert - see http://www.mathe2.uni-bayreuth.de/axel/ + +Dependencies +------------ + +- GNU patch (for applying the patches to upstream) + + +Special Update/Build Instructions +--------------------------------- + +The following patches are applied in spkg-install: + +- ``bruch.patch``: store integers in a temporary variable before freeing + memory +- ``de.patch``: turn off banner +- ``int32.patch``: use ``int32_t`` and ``uint32_t`` for type INT. +- ``sort_sum_rename.patch``: rename ``sort`` to ``sym_sort``, ``sum`` to ``sym_sum`` +- We copy over our own ``Makefile``: + + ``patches/makefile`` (Fix compiler, i.e., use ``$CC``, and let it use + ``$CFLAGS``.) + +Permissions in the upstream tarball are funky, please run ``chmod 644 +src/*`` after unpacking. diff --git a/build/pkgs/symmetrica/SPKG.txt b/build/pkgs/symmetrica/SPKG.txt deleted file mode 100644 index bafe8ac922d..00000000000 --- a/build/pkgs/symmetrica/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= symmetrica = - -== Description == - -Symmetrica is a program developed by Lehrstuhl Mathematik II of the -University of Bayreuth. It has routines to handle the following topics - - * ordinary representation theory of the symmetric group and related groups (2/11/04) - * ordinary representation theory of the classical groups - * modular representation theory of the symmetric group - * projective representation theory of the symmetric group - * combinatorics of tableaux - * symmetric functions and polynomials (7/22/04) - * commutative and non commutative Schubert polynomials - * operations of finite groups. - * ordinary representation theory of Hecke algebras of type A_n - -For more details check http://www.symmetrica.de (currently redirects -to http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA) - -== License == - -Public Domain (see the above web site) - -== Upstream Contact == - * Axel Kohnert - see http://www.mathe2.uni-bayreuth.de/axel/ - -== Dependencies == - * GNU patch (for applying the patches to upstream) - -== Special Update/Build Instructions == - -The following patches are applied in spkg-install: - - * bruch.patch: store integers in a temporary variable before freeing memory - * de.patch: turn off banner - * int32.patch: use int32_t and uint32_t for type INT. - * sort_sum_rename.patch: rename sort to sym_sort, sum to sym_sum - * We copy over our own Makefile: - patches/makefile (Fix compiler, i.e., use $CC, and let it use $CFLAGS.) - -Permissions in the upstream tarball are funky, please run -"chmod 644 src/*" after unpacking. - diff --git a/build/pkgs/sympow/SPKG.rst b/build/pkgs/sympow/SPKG.rst new file mode 100644 index 00000000000..4b3dd774afe --- /dev/null +++ b/build/pkgs/sympow/SPKG.rst @@ -0,0 +1,64 @@ +sympow +====== + +Description +----------- + +SYMPOW is a package to compute special values of symmetric power +elliptic curve L-functions. It can compute up to about 64 digits of +precision. + +License +------- + +- See the file src/COPYING + + +Upstream Contact +---------------- + +SYMPOW does not appear to be maintained any longer, so there is no +upstream web site. +Mark Watkins, the package author, now works at Magma. +Previous (possibly still usable) email is watkins@maths.usyd.edu.au + +Dependencies +------------ + +- GNU patch + + +Special Update/Build Instructions +--------------------------------- + +- Some of the code is very dubious, and it is anyones guess really what + the compiler does with it. For example, the following line exists in + src/eulerfactors.c: + + if ((HECKE) && (d==1)) return hecke_good(p,ap,m,v); + + But since hecke_good is defined as returning void, it's hard to know + exactly how this code behaves. I would not be surprised by any bugs + 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 + been + opened to implement Watkins-Delaunay's algorithm for computing + modular + degrees in Sage. Once implemented, it should be possible to remove + this + package. + +- The package is configured such that the data files are in a directory + below where 'sympow' is installed. If Sage is installed globally, + then + it will be impossible to create the data files without being root. + 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 + This package will generate binary versions of all shipped datafiles, + so these will work. However, creating totally new datafiles from + scratch + will not work. diff --git a/build/pkgs/sympow/SPKG.txt b/build/pkgs/sympow/SPKG.txt deleted file mode 100644 index d108adc33ed..00000000000 --- a/build/pkgs/sympow/SPKG.txt +++ /dev/null @@ -1,43 +0,0 @@ -= sympow = - -== Description == -SYMPOW is a package to compute special values of symmetric power elliptic -curve L-functions. It can compute up to about 64 digits of precision. - -== License == - - * See the file src/COPYING - -== Upstream Contact == - SYMPOW does not appear to be maintained any longer, so there is no - upstream web site. - Mark Watkins, the package author, now works at Magma. - Previous (possibly still usable) email is watkins@maths.usyd.edu.au - -== Dependencies == - * GNU patch - -== Special Update/Build Instructions == - * Some of the code is very dubious, and it is anyones guess really what - the compiler does with it. For example, the following line exists in - src/eulerfactors.c: - - if ((HECKE) && (d==1)) return hecke_good(p,ap,m,v); - - But since hecke_good is defined as returning void, it's hard to know - exactly how this code behaves. I would not be surprised by any bugs - 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 been - opened to implement Watkins-Delaunay's algorithm for computing modular - degrees in Sage. Once implemented, it should be possible to remove this - package. - * The package is configured such that the data files are in a directory - below where 'sympow' is installed. If Sage is installed globally, then - it will be impossible to create the data files without being root. - This has been fixed in the Gentoo Linux distribution. Some information - from Christopher can be see on http://trac.sagemath.org/sage_trac/ticket/9703 - This package will generate binary versions of all shipped datafiles, - so these will work. However, creating totally new datafiles from scratch - will not work. - diff --git a/build/pkgs/sympy/SPKG.rst b/build/pkgs/sympy/SPKG.rst new file mode 100644 index 00000000000..ced31dd1e05 --- /dev/null +++ b/build/pkgs/sympy/SPKG.rst @@ -0,0 +1,39 @@ +SymPy +===== + +Description +----------- + +SymPy is a Python library for symbolic mathematics. It aims to become a +full-featured computer algebra system (CAS) while keeping the code as +simple as possible in order to be comprehensible and easily extensible. +SymPy is written entirely in Python and does not require any external +libraries, except optionally for plotting support. + +Website +------- + +http://sympy.org/ + +License +------- + +New BSD: http://www.opensource.org/licenses/bsd-license.php + + +Upstream Contact +---------------- + +sympy mailinglist: http://groups.google.com/group/sympy + +Dependencies +------------ + +- Python 2.5 or later + + +Special Update/Build Instructions +--------------------------------- + +- A simple script can be used to ease the updating of the SPKG. See the + README. diff --git a/build/pkgs/sympy/SPKG.txt b/build/pkgs/sympy/SPKG.txt deleted file mode 100644 index 0136f8ca23d..00000000000 --- a/build/pkgs/sympy/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= SymPy = - -== Description == - -SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries, except optionally for plotting support. - -== Website == - -http://sympy.org/ - -== License == - -New BSD: http://www.opensource.org/licenses/bsd-license.php - -== Upstream Contact == - -sympy mailinglist: http://groups.google.com/group/sympy - -== Dependencies == - * Python 2.5 or later - -== Special Update/Build Instructions == - - * A simple script can be used to ease the updating of the SPKG. See the README. - diff --git a/build/pkgs/tachyon/SPKG.rst b/build/pkgs/tachyon/SPKG.rst new file mode 100644 index 00000000000..702a8d92a7d --- /dev/null +++ b/build/pkgs/tachyon/SPKG.rst @@ -0,0 +1,75 @@ +tachyon +======= + +Description +----------- + +Tachyon is a raytracer developed by John E. Stone. Tachyon supports the +typical ray tracer features, most of the common geometric primitives, +shading and texturing modes, etc. It also supports less common features +such as HDR image output, ambient occlusion lighting, and support for +various triangle mesh and volumetric texture formats beneficial for +molecular visualization (e.g. rendering VMD scenes). + +Currently not all of Tachyon's functionality is exported by the Sage +interface. + +License +------- + +Copyright (c) 1994-2010 John E. Stone +All rights reserved. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. The name of the author may not be used to endorse or promote + products + derived from this software without specific prior written permission. + + +Upstream Contact +---------------- + +- http://jedi.ks.uiuc.edu/~johns/raytracer/ +- John Stone + +Dependencies +------------ + +This spkg depends on: + +- libpng + + +Special Update/Build Instructions +--------------------------------- + +- Delete the scenes directory, which has lots of cool examples. +- Delete the msvc directory, which is also large and not used within + Sage. +- The CVS subdirectories are currently (almost) empty, but should + otherwise be deleted. + +- The upstream files had strange permissions, i.e. some source files + were executable, while almost all files weren't world-readable. + +- There's seems to be some crap like ``tachyon.html.tar.gz`` and a few + ``.#*`` files I haven't [yet] deleted, since they're not that large. + +- TODO: Check whether building multi-threaded versions on MacOS X + meanwhile works. (This was said to fail with an old beta.) + +- TODO: Use ``patch`` instead of copying over pre-patched files. +- TODO: [Optionally] also install some of the documentation. +- TODO: I doubt the CFLAGS set for AIX and HP-UX won't get overridden + by the created Makefile, but that's a minor issue. -leif diff --git a/build/pkgs/tachyon/SPKG.txt b/build/pkgs/tachyon/SPKG.txt deleted file mode 100644 index 5c3deaba733..00000000000 --- a/build/pkgs/tachyon/SPKG.txt +++ /dev/null @@ -1,61 +0,0 @@ -= tachyon = - -== Description == - -Tachyon is a raytracer developed by John E. Stone. Tachyon supports -the typical ray tracer features, most of the common geometric -primitives, shading and texturing modes, etc. It also supports less -common features such as HDR image output, ambient occlusion lighting, -and support for various triangle mesh and volumetric texture formats -beneficial for molecular visualization (e.g. rendering VMD scenes). - -Currently not all of Tachyon's functionality is exported by the Sage -interface. - - -== License == - - * Copyright (c) 1994-2010 John E. Stone - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - - -== Upstream Contact == - -http://jedi.ks.uiuc.edu/~johns/raytracer/ -John Stone - - -== Dependencies == - -This spkg depends on: - - * libpng - - -== Special Update/Build Instructions == - - * Delete the scenes directory, which has lots of cool examples. - * Delete the msvc directory, which is also large and not used within Sage. - * The CVS subdirectories are currently (almost) empty, but should - otherwise be deleted. - * The upstream files had strange permissions, i.e. some source files - were executable, while almost all files weren't world-readable. - * There's seems to be some crap like `tachyon.html.tar.gz` and a few - `.#*` files I haven't [yet] deleted, since they're not that large. - * TODO: Check whether building multi-threaded versions on MacOS X - meanwhile works. (This was said to fail with an old beta.) - * TODO: Use `patch` instead of copying over pre-patched files. - * TODO: [Optionally] also install some of the documentation. - * TODO: I doubt the CFLAGS set for AIX and HP-UX won't get overridden - by the created Makefile, but that's a minor issue. -leif diff --git a/build/pkgs/tdlib/SPKG.rst b/build/pkgs/tdlib/SPKG.rst new file mode 100644 index 00000000000..84034a66e59 --- /dev/null +++ b/build/pkgs/tdlib/SPKG.rst @@ -0,0 +1,32 @@ +TdLib +===== + +Description +----------- + +Providing algorithms concerning treedecompositions + +website: http://www.tdi.informatik.uni-frankfurt.de/~lukas/tdlib.html + +License +------- + +GNU General Public License v2 + + +SPKG Maintainers +---------------- + +Lukas Larisch (larisch@informatik.uni-frankfurt.de) + + +Upstream Contact +---------------- + +- Lukas Larisch (larisch@informatik.uni-frankfurt.de) +- git-repo: git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib + +Dependencies +------------ + +- None diff --git a/build/pkgs/tdlib/SPKG.txt b/build/pkgs/tdlib/SPKG.txt deleted file mode 100644 index a4567c1b9c4..00000000000 --- a/build/pkgs/tdlib/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= TdLib = - -== Description == -Providing algorithms concerning treedecompositions - -website: http://www.tdi.informatik.uni-frankfurt.de/~lukas/tdlib.html - -== License == -GNU General Public License v2 - -== SPKG Maintainers == -Lukas Larisch (larisch@informatik.uni-frankfurt.de) - -== Upstream Contact == -Lukas Larisch (larisch@informatik.uni-frankfurt.de) -git-repo: git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib - -== Dependencies == - * None - diff --git a/build/pkgs/termcap/SPKG.rst b/build/pkgs/termcap/SPKG.rst new file mode 100644 index 00000000000..65e96b3469a --- /dev/null +++ b/build/pkgs/termcap/SPKG.rst @@ -0,0 +1,30 @@ +termcap +======= + +Description +----------- + +A library of C functions that enable programs to send control strings to +terminals in a way independent of the terminal type. + +License +------- + +GPL version 2 + + +Upstream Contact +---------------- + +Please report any bugs in this library to bug-gnu-emacs@prep.ai.mit.edu + +Dependencies +------------ + +- GNU patch + + +Special Update/Build Instructions +--------------------------------- + +None diff --git a/build/pkgs/termcap/SPKG.txt b/build/pkgs/termcap/SPKG.txt deleted file mode 100644 index 7a26059e18f..00000000000 --- a/build/pkgs/termcap/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= termcap = - -== Description == - -A library of C functions that enable programs to send control strings -to terminals in a way independent of the terminal type. - -== License == - -GPL version 2 - -== Upstream Contact == - -Please report any bugs in this library to bug-gnu-emacs@prep.ai.mit.edu - -== Dependencies == - - * GNU patch - -== Special Update/Build Instructions == - -None - diff --git a/build/pkgs/terminado/SPKG.txt b/build/pkgs/terminado/SPKG.rst similarity index 87% rename from build/pkgs/terminado/SPKG.txt rename to build/pkgs/terminado/SPKG.rst index 8f5a4b8d6ff..38970eddb75 100644 --- a/build/pkgs/terminado/SPKG.txt +++ b/build/pkgs/terminado/SPKG.rst @@ -1,6 +1,8 @@ -= terminado = +terminado +========= -== Description == +Description +----------- This is a Tornado websocket backend for the term.js Javascript terminal emulator library. diff --git a/build/pkgs/testpath/SPKG.txt b/build/pkgs/testpath/SPKG.rst similarity index 73% rename from build/pkgs/testpath/SPKG.txt rename to build/pkgs/testpath/SPKG.rst index 2ea91ce9d57..3a0a44b070d 100644 --- a/build/pkgs/testpath/SPKG.txt +++ b/build/pkgs/testpath/SPKG.rst @@ -1,8 +1,8 @@ -= testpath = +testpath +======== -== Description == - -Testpath +Description +----------- Testpath is a collection of utilities for testing code which uses and manipulates the filesystem and system commands diff --git a/build/pkgs/texlive/SPKG.rst b/build/pkgs/texlive/SPKG.rst new file mode 100644 index 00000000000..a81008a27cc --- /dev/null +++ b/build/pkgs/texlive/SPKG.rst @@ -0,0 +1,39 @@ +TeXlive +======= + +Description +----------- + +TeX Live is an easy way to get up and running with the TeX document +production system. It provides a comprehensive TeX system with binaries +for most flavors of Unix, including GNU/Linux, and also Windows. It +includes all the major TeX-related programs, macro packages, and fonts +that are free software, including support for many languages around the +world. + +This package installs all texlive packages required to build Sage. If +necessary, texlive itself is installed. + +License +------- + +Various FSF-approved free software licenses. See +https://www.tug.org/texlive/copying.html for details. + + +Upstream Contact +---------------- + +Home page: https://www.tug.org/texlive + +Dependencies +------------ + +- python + + +Special Update/Build Instructions +--------------------------------- + +This package requires internet access to download texlive packages for +the TeX mirrors. diff --git a/build/pkgs/texlive/SPKG.txt b/build/pkgs/texlive/SPKG.txt deleted file mode 100644 index 36e2c9825bd..00000000000 --- a/build/pkgs/texlive/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= TeXlive = - -== Description == - -TeX Live is an easy way to get up and running with the TeX document -production system. It provides a comprehensive TeX system with -binaries for most flavors of Unix, including GNU/Linux, and also -Windows. It includes all the major TeX-related programs, macro -packages, and fonts that are free software, including support for many -languages around the world. - -This package installs all texlive packages required to build Sage. If -necessary, texlive itself is installed. - -== License == - -Various FSF-approved free software licenses. See -https://www.tug.org/texlive/copying.html for details. - -== Upstream Contact == - -Home page: https://www.tug.org/texlive - -== Dependencies == - -* python - -== Special Update/Build Instructions == - -This package requires internet access to download texlive packages for -the TeX mirrors. diff --git a/build/pkgs/thebe/SPKG.rst b/build/pkgs/thebe/SPKG.rst new file mode 100644 index 00000000000..39a07327e9f --- /dev/null +++ b/build/pkgs/thebe/SPKG.rst @@ -0,0 +1,37 @@ +thebe +===== + +Description +----------- + +Jupyter javascript plugin for static sites. Thebe takes the Jupyter +front end, and make it work outside of the notebook context. + +This is used by Sage's Sphinx-based documentation build system to +produce html documentation that can be turned live (see +https://trac.sagemath.org/ticket/20690). + +License +------- + +MIT + + +Upstream Contact +---------------- + +- Home page: https://oreillymedia.github.io/thebe/ +- Source: https://github.com/oreillymedia/thebe/ + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +There are no release numbers, hence find the latest commit, download +https://github.com/oreillymedia/thebe/archive/$%7BCOMMIT%7D.zip and +rename it thebe-${COMMIT:0:8}.zip diff --git a/build/pkgs/thebe/SPKG.txt b/build/pkgs/thebe/SPKG.txt deleted file mode 100644 index de5c05c7c5b..00000000000 --- a/build/pkgs/thebe/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= thebe = - -== Description == - -Jupyter javascript plugin for static sites. Thebe takes the Jupyter front end, -and make it work outside of the notebook context. - -This is used by Sage's Sphinx-based documentation build system to produce html -documentation that can be turned live (see -https://trac.sagemath.org/ticket/20690). - -== License == - -MIT - -== Upstream Contact == - -Home page: https://oreillymedia.github.io/thebe/ -Source: https://github.com/oreillymedia/thebe/ - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -There are no release numbers, hence find the latest commit, download -https://github.com/oreillymedia/thebe/archive/${COMMIT}.zip and rename it -thebe-${COMMIT:0:8}.zip - diff --git a/build/pkgs/threejs/SPKG.rst b/build/pkgs/threejs/SPKG.rst new file mode 100644 index 00000000000..2891a05b51c --- /dev/null +++ b/build/pkgs/threejs/SPKG.rst @@ -0,0 +1,29 @@ +Three.js +======== + +Description +----------- + +Three.js is a JavaScript library to display 3D graphics in the browser. + +License +------- + +MIT License + + +Upstream Contact +---------------- + +Home page: http://threejs.org + +Dependencies +------------ + +None. + + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/threejs/SPKG.txt b/build/pkgs/threejs/SPKG.txt deleted file mode 100644 index 57052228b76..00000000000 --- a/build/pkgs/threejs/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= Three.js = - -== Description == - -Three.js is a JavaScript library to display 3D graphics in the browser. - -== License == - -MIT License - -== Upstream Contact == - -Home page: http://threejs.org - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/tides/SPKG.rst b/build/pkgs/tides/SPKG.rst new file mode 100644 index 00000000000..ba7738d2eff --- /dev/null +++ b/build/pkgs/tides/SPKG.rst @@ -0,0 +1,33 @@ +TIDES +===== + +Description +----------- + +TIDES is a library for integration of ODE's with high precision. + +License +------- + +GPLv3+ + + +Upstream Contact +---------------- + +- Marcos Rodriguez (marcos@unizar.es) + +Dependencies +------------ + +- gcc +- mpfr +- gmp + + +Special Update/Build Instructions +--------------------------------- + +minc_tides.patch changes the size of the name of the temporal files, so +there is no problem in systems that use long names. Also solves a bug in +the inverse function. diff --git a/build/pkgs/tides/SPKG.txt b/build/pkgs/tides/SPKG.txt deleted file mode 100644 index da9bbbd729c..00000000000 --- a/build/pkgs/tides/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= TIDES = - -== Description == - -TIDES is a library for integration of ODE's with high precision. - -== License == - -GPLv3+ - -== Upstream Contact == - -* Marcos Rodriguez (marcos@unizar.es) - -== Dependencies == - -* gcc -* mpfr -* gmp - -== Special Update/Build Instructions == - -minc_tides.patch changes the size of the name of the temporal files, so -there is no problem in systems that use long names. Also solves a bug -in the inverse function. diff --git a/build/pkgs/topcom/SPKG.rst b/build/pkgs/topcom/SPKG.rst new file mode 100644 index 00000000000..60d53f2f8aa --- /dev/null +++ b/build/pkgs/topcom/SPKG.rst @@ -0,0 +1,47 @@ +TOPCOM +====== + +Description +----------- + +TOPCOM is a collection of clients to compute Triangulations Of Point +Configurations and Oriented Matroids, resp. + +The algorithms use only combinatorial data of the point configuration as +is given by its oriented matroid. Some basic commands for computing and +manipulating oriented matroids can also be accessed by the user. + +It was very much inspired by the maple program PUNTOS, which was written +by Jesus de Loera. TOPCOM is entirely written in C++, so there is a +significant speed up compared to PUNTOS. + +License +------- + +GPL v2 + + +Upstream Contact +---------------- + +:: + + Prof. Dr. Jörg Rambau + Lehrstuhl für Wirtschaftsmathematik + Raum FAN-D.1.29 (Sekretariat: FAN-D.1.30) + Universität Bayreuth + D-95440 Bayreuth + Germany + Tel: +49-921-55-7350, Fax: +49-921-55-7352 + http://www.rambau.wm.uni-bayreuth.de + +Dependencies +------------ + +- gmp, libcdd + + +Special Update/Build Instructions +--------------------------------- + +See spkg-src diff --git a/build/pkgs/topcom/SPKG.txt b/build/pkgs/topcom/SPKG.txt deleted file mode 100644 index 51772f4a3b8..00000000000 --- a/build/pkgs/topcom/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= TOPCOM = - -== Description == -TOPCOM is a collection of clients to compute Triangulations Of Point -Configurations and Oriented Matroids, resp. - -The algorithms use only combinatorial data of the point configuration -as is given by its oriented matroid. Some basic commands for computing -and manipulating oriented matroids can also be accessed by the user. - -It was very much inspired by the maple program PUNTOS, which was -written by Jesus de Loera. TOPCOM is entirely written in C++, so there -is a significant speed up compared to PUNTOS. - -== License == -GPL v2 - -== Upstream Contact == -Prof. Dr. Jörg Rambau -Lehrstuhl für Wirtschaftsmathematik -Raum FAN-D.1.29 (Sekretariat: FAN-D.1.30) -Universität Bayreuth -D-95440 Bayreuth -Germany -Tel: +49-921-55-7350, Fax: +49-921-55-7352 -http://www.rambau.wm.uni-bayreuth.de - -== Dependencies == -* gmp, libcdd - -== Special Update/Build Instructions == - -See spkg-src - diff --git a/build/pkgs/tornado/SPKG.txt b/build/pkgs/tornado/SPKG.rst similarity index 51% rename from build/pkgs/tornado/SPKG.txt rename to build/pkgs/tornado/SPKG.rst index 5938a047bed..db446514d67 100644 --- a/build/pkgs/tornado/SPKG.txt +++ b/build/pkgs/tornado/SPKG.rst @@ -1,18 +1,23 @@ -= tornado = +tornado +======= -== Description == +Description +----------- Python web framework and asynchronous networking library -== License == +License +------- Apache License -== Upstream Contact == + +Upstream Contact +---------------- Home page: http://www.tornadoweb.org -== Dependencies == +Dependencies +------------ Python - diff --git a/build/pkgs/traitlets/SPKG.txt b/build/pkgs/traitlets/SPKG.rst similarity index 65% rename from build/pkgs/traitlets/SPKG.txt rename to build/pkgs/traitlets/SPKG.rst index 0cca54ec4bf..0d624dc30c8 100644 --- a/build/pkgs/traitlets/SPKG.txt +++ b/build/pkgs/traitlets/SPKG.rst @@ -1,6 +1,8 @@ -= traitlets = +traitlets +========= -== Description == +Description +----------- Traitlets Python config system diff --git a/build/pkgs/twisted/SPKG.txt b/build/pkgs/twisted/SPKG.rst similarity index 82% rename from build/pkgs/twisted/SPKG.txt rename to build/pkgs/twisted/SPKG.rst index d2122e44f7e..5b6e9293e55 100644 --- a/build/pkgs/twisted/SPKG.txt +++ b/build/pkgs/twisted/SPKG.rst @@ -1,6 +1,8 @@ -= twisted = +twisted +======= -== Description == +Description +----------- An asynchronous networking framework written in Python diff --git a/build/pkgs/typing/SPKG.txt b/build/pkgs/typing/SPKG.rst similarity index 89% rename from build/pkgs/typing/SPKG.txt rename to build/pkgs/typing/SPKG.rst index 273da4324fc..5bdd9ff8ebc 100644 --- a/build/pkgs/typing/SPKG.txt +++ b/build/pkgs/typing/SPKG.rst @@ -1,6 +1,8 @@ -= typing = +typing +====== -== Description == +Description +----------- Typing – Type Hints for Python @@ -12,6 +14,7 @@ annotations. The notation can be used for documenting code in a concise, standard format, and it has been designed to also be used by static and runtime type checkers, static analyzers, IDEs and other tools. -== License == +License +------- Python Software Foundation License diff --git a/build/pkgs/valgrind/SPKG.rst b/build/pkgs/valgrind/SPKG.rst new file mode 100644 index 00000000000..e3553325b7f --- /dev/null +++ b/build/pkgs/valgrind/SPKG.rst @@ -0,0 +1,54 @@ +Valgrind +======== + +Description +----------- + +This is an optional spkg. It supports Linux on x86, x86-64, ppc, ppc64 +and ARM as well as Darwin (Mac OS X 10.5 and 10.6) on x86 and x86-64. + +Valgrind is an instrumentation framework for building dynamic analysis +tools. There are Valgrind tools that can automatically detect many +memory management and threading bugs, and profile your programs in +detail. You can also use Valgrind to build new tools. + +The Valgrind distribution currently includes six production-quality +tools: a memory error detector, two thread error detectors, a cache and +branch-prediction profiler, a call-graph generating cache and +branch-prediction profiler, and a heap profiler. It also includes three +experimental tools: a heap/stack/global array overrun detector, a second +heap profiler that examines how heap blocks are used, and a SimPoint +basic block vector generator. It runs on the following platforms: +X86/Linux, AMD64/Linux, ARM/Linux, PPC32/Linux, PPC64/Linux, +S390X/Linux, ARM/Android (2.3.x), X86/Darwin and AMD64/Darwin (Mac OS X +10.6 and 10.7). + +License +------- + +Valgrind is Open Source / Free Software, and is freely available under +the GNU General Public License, version 2. + + +Upstream Contact +---------------- + +- http://www.valgrind.org/ +- valgrind-user, valgrind-devel mailing lists + +Dependencies +------------ + +- None + + +Special Build Instructions +-------------------------- + +- To build on OS X, you need to use Apple's compiler. FSF GCC is + unsupported. + +Patches +~~~~~~~ + +- None. diff --git a/build/pkgs/valgrind/SPKG.txt b/build/pkgs/valgrind/SPKG.txt deleted file mode 100644 index fa065c32de4..00000000000 --- a/build/pkgs/valgrind/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= Valgrind = - -== Description == - -This is an optional spkg. It supports Linux on x86, x86-64, ppc, ppc64 and ARM -as well as Darwin (Mac OS X 10.5 and 10.6) on x86 and x86-64. - -Valgrind is an instrumentation framework for building dynamic analysis tools. -There are Valgrind tools that can automatically detect many memory management -and threading bugs, and profile your programs in detail. You can also use -Valgrind to build new tools. - -The Valgrind distribution currently includes six production-quality tools: -a memory error detector, two thread error detectors, a cache and -branch-prediction profiler, a call-graph generating cache and branch-prediction -profiler, and a heap profiler. It also includes three experimental tools: a -heap/stack/global array overrun detector, a second heap profiler that examines -how heap blocks are used, and a SimPoint basic block vector generator. It runs -on the following platforms: X86/Linux, AMD64/Linux, ARM/Linux, PPC32/Linux, -PPC64/Linux, S390X/Linux, ARM/Android (2.3.x), X86/Darwin and AMD64/Darwin -(Mac OS X 10.6 and 10.7). - -== License == - -Valgrind is Open Source / Free Software, and is freely available under the -GNU General Public License, version 2. - -== Upstream Contact == - - * http://www.valgrind.org/ - * valgrind-user, valgrind-devel mailing lists - -== Dependencies == - - * None - -== Special Build Instructions == - - * To build on OS X, you need to use Apple's compiler. FSF GCC is unsupported. - -=== Patches === - - * None. - diff --git a/build/pkgs/vcversioner/SPKG.rst b/build/pkgs/vcversioner/SPKG.rst new file mode 100644 index 00000000000..31ade501ff3 --- /dev/null +++ b/build/pkgs/vcversioner/SPKG.rst @@ -0,0 +1,25 @@ +vcversioner +=========== + +Description +----------- + +Write a setup.py with no version information specified, and vcversioner +will find a recent, properly-formatted VCS tag and extract a version +from it. + +License +------- + +Python Software Foundation License + + +Upstream Contact +---------------- + +Home page: https://pypi.python.org/pypi/vcversioner/ + +Dependencies +------------ + +Python, Setuptools diff --git a/build/pkgs/vcversioner/SPKG.txt b/build/pkgs/vcversioner/SPKG.txt deleted file mode 100644 index eae91aa062e..00000000000 --- a/build/pkgs/vcversioner/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= vcversioner = - -== Description == - -Write a setup.py with no version information specified, and -vcversioner will find a recent, properly-formatted VCS tag and extract -a version from it. - -== License == - -Python Software Foundation License - -== Upstream Contact == - -Home page: https://pypi.python.org/pypi/vcversioner/ - -== Dependencies == - -Python, Setuptools - diff --git a/build/pkgs/wcwidth/SPKG.txt b/build/pkgs/wcwidth/SPKG.rst similarity index 72% rename from build/pkgs/wcwidth/SPKG.txt rename to build/pkgs/wcwidth/SPKG.rst index d91b994aacf..ed233830d3a 100644 --- a/build/pkgs/wcwidth/SPKG.txt +++ b/build/pkgs/wcwidth/SPKG.rst @@ -1,6 +1,8 @@ -= wcwidth = +wcwidth +======= -== Description == +Description +----------- Measures number of Terminal column cells of wide-character codes diff --git a/build/pkgs/webencodings/SPKG.txt b/build/pkgs/webencodings/SPKG.rst similarity index 52% rename from build/pkgs/webencodings/SPKG.txt rename to build/pkgs/webencodings/SPKG.rst index 7480c468420..3fa1c3aed62 100644 --- a/build/pkgs/webencodings/SPKG.txt +++ b/build/pkgs/webencodings/SPKG.rst @@ -1,17 +1,23 @@ -= webencodings = +webencodings +============ -== Description == +Description +----------- Character encoding aliases for legacy web content. -== License == +License +------- BSD License -== Upstream Contact == + +Upstream Contact +---------------- Home Page: https://github.com/gsnedders/python-webencodings -== Dependencies == +Dependencies +------------ Python diff --git a/build/pkgs/werkzeug/SPKG.rst b/build/pkgs/werkzeug/SPKG.rst new file mode 100644 index 00000000000..860d3762b49 --- /dev/null +++ b/build/pkgs/werkzeug/SPKG.rst @@ -0,0 +1,21 @@ +Werkzeug +======== + +Description +----------- + +The Swiss Army knife of Python web development + +Werkzeug started as simple collection of various utilities for WSGI +applications and has become one of the most advanced WSGI utility +modules. It includes a powerful debugger, full featured request and +response objects, HTTP utilities to handle entity tags, cache control +headers, HTTP dates, cookie handling, file uploads, a powerful URL +routing system and a bunch of community contributed addon modules. + +Werkzeug is unicode aware and doesn't enforce a specific template +engine, database adapter or anything else. It doesn’t even enforce a +specific way of handling requests and leaves all that up to the +developer. It's most useful for end user applications which should work +on as many server environments as possible (such as blogs, wikis, +bulletin boards, etc.). diff --git a/build/pkgs/werkzeug/SPKG.txt b/build/pkgs/werkzeug/SPKG.txt deleted file mode 100644 index fac6f309dee..00000000000 --- a/build/pkgs/werkzeug/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= Werkzeug = - -== Description == - -The Swiss Army knife of Python web development - -Werkzeug started as simple collection of various utilities for WSGI -applications and has become one of the most advanced WSGI utility modules. It -includes a powerful debugger, full featured request and response objects, HTTP -utilities to handle entity tags, cache control headers, HTTP dates, cookie -handling, file uploads, a powerful URL routing system and a bunch of community -contributed addon modules. - -Werkzeug is unicode aware and doesn't enforce a specific template engine, -database adapter or anything else. It doesn’t even enforce a specific way of -handling requests and leaves all that up to the developer. It's most useful -for end user applications which should work on as many server environments as -possible (such as blogs, wikis, bulletin boards, etc.). diff --git a/build/pkgs/widgetsnbextension/SPKG.rst b/build/pkgs/widgetsnbextension/SPKG.rst new file mode 100644 index 00000000000..7c14261cf95 --- /dev/null +++ b/build/pkgs/widgetsnbextension/SPKG.rst @@ -0,0 +1,7 @@ +widgetsnbextension +================== + +Description +----------- + +Interactive HTML widgets for Jupyter notebooks. diff --git a/build/pkgs/widgetsnbextension/SPKG.txt b/build/pkgs/widgetsnbextension/SPKG.txt deleted file mode 100644 index e432175c9e0..00000000000 --- a/build/pkgs/widgetsnbextension/SPKG.txt +++ /dev/null @@ -1,6 +0,0 @@ -= widgetsnbextension = - -== Description == - -Interactive HTML widgets for Jupyter notebooks. - diff --git a/build/pkgs/xz/SPKG.rst b/build/pkgs/xz/SPKG.rst new file mode 100644 index 00000000000..ded4e934abb --- /dev/null +++ b/build/pkgs/xz/SPKG.rst @@ -0,0 +1,23 @@ +xz +== + +Description +----------- + +XZ Utils is free general-purpose data compression software with a high +compression ratio. + +License +------- + +Some parts public domain, other parts GNU LGPLv2.1, GNU GPLv2, or GNU +GPLv3. + + +Upstream Contact +---------------- + +http://tukaani.org/xz/ + +Dependencies +------------ diff --git a/build/pkgs/xz/SPKG.txt b/build/pkgs/xz/SPKG.txt deleted file mode 100644 index 7a66b43d63e..00000000000 --- a/build/pkgs/xz/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= xz = - -== Description == - -XZ Utils is free general-purpose data compression software with a high compression ratio. - -== License == - -Some parts public domain, -other parts GNU LGPLv2.1, GNU GPLv2, or GNU GPLv3. - -== Upstream Contact == - -http://tukaani.org/xz/ - -== Dependencies == - diff --git a/build/pkgs/yasm/SPKG.rst b/build/pkgs/yasm/SPKG.rst new file mode 100644 index 00000000000..63a33301845 --- /dev/null +++ b/build/pkgs/yasm/SPKG.rst @@ -0,0 +1,41 @@ +yasm +==== + +Description +----------- + +Yasm is a complete rewrite of the NASM assembler under the “new” BSD +License (some portions are under other licenses, see COPYING for +details). + +Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM +and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit +Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates +source debugging information in STABS, DWARF 2, and CodeView 8 formats. + +Yasm can be easily integrated into Visual Studio 2005/2008 and 2010 for +assembly of NASM or GAS syntax code into Win32 or Win64 object files. + +See https://yasm.tortall.net + +License +------- + +Yasm is licensed under the 2-clause and 3-clause “revised” BSD licenses, +with one exception: the Bit::Vector module used by the mainline version +of Yasm to implement its large integer and machine-independent floating +point support is triple-licensed under the Artistic license, GPL, and +LGPL. The “yasm-nextgen” codebase uses a different BSD-licensed +implementation and is thus entirely under BSD-equivalent licenses. The +full text of the licenses are provided in the Yasm source distribution. + + +Upstream Contact +---------------- + +- https://yasm.tortall.net + +Dependencies +------------ + +- none diff --git a/build/pkgs/yasm/SPKG.txt b/build/pkgs/yasm/SPKG.txt deleted file mode 100644 index 3dd72875678..00000000000 --- a/build/pkgs/yasm/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= yasm = - -== Description == -Yasm is a complete rewrite of the NASM assembler under the “new” BSD License (some portions are under other licenses, see COPYING for details). - -Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats. - -Yasm can be easily integrated into Visual Studio 2005/2008 and 2010 for assembly of NASM or GAS syntax code into Win32 or Win64 object files. - -See https://yasm.tortall.net - -== License == -Yasm is licensed under the 2-clause and 3-clause “revised” BSD licenses, with one exception: the Bit::Vector module used by the mainline version of Yasm to implement its large integer and machine-independent floating point support is triple-licensed under the Artistic license, GPL, and LGPL. The “yasm-nextgen” codebase uses a different BSD-licensed implementation and is thus entirely under BSD-equivalent licenses. The full text of the licenses are provided in the Yasm source distribution. - -== Upstream Contact == - * https://yasm.tortall.net - -== Dependencies == - * none diff --git a/build/pkgs/zeromq/SPKG.txt b/build/pkgs/zeromq/SPKG.rst similarity index 56% rename from build/pkgs/zeromq/SPKG.txt rename to build/pkgs/zeromq/SPKG.rst index 7459f724a82..37d6c669b58 100644 --- a/build/pkgs/zeromq/SPKG.txt +++ b/build/pkgs/zeromq/SPKG.rst @@ -1,24 +1,31 @@ -= zeromq = +zeromq +====== -== Description == +Description +----------- A modern networking library. Also known as 0mq or zmq. The same API is provided by http://www.crossroads.io, though we currently use the http://www.zeromq.org implementation. -== License == +License +------- LGPLv3+ -== Upstream Contact == + +Upstream Contact +---------------- http://www.zeromq.org -== Dependencies == +Dependencies +------------ A working compiler. -== Special Update/Build Instructions == -N/A +Special Update/Build Instructions +--------------------------------- +N/A diff --git a/build/pkgs/zlib/SPKG.rst b/build/pkgs/zlib/SPKG.rst new file mode 100644 index 00000000000..0d32a6327f9 --- /dev/null +++ b/build/pkgs/zlib/SPKG.rst @@ -0,0 +1,33 @@ +zlib +==== + +Description +----------- + +Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also +Free, Not to Mention Unencumbered by Patents) + +License +------- + +- Modified BSD. + + +Upstream Contact +---------------- + +- http://www.zlib.net/ + +Dependencies +------------ + +- None + + +Special Update/Build Instructions +--------------------------------- + +Patches +~~~~~~~ + +- cygwin_symbols.patch: remove undefined symbols on Cygwin. diff --git a/build/pkgs/zlib/SPKG.txt b/build/pkgs/zlib/SPKG.txt deleted file mode 100644 index eeb3ae76007..00000000000 --- a/build/pkgs/zlib/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= zlib = - -== Description == - -Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also -Free, Not to Mention Unencumbered by Patents) - -== License == - - * Modified BSD. - -== Upstream Contact == - - * http://www.zlib.net/ - -== Dependencies == - - * None - -== Special Update/Build Instructions == - -=== Patches === - - * cygwin_symbols.patch: remove undefined symbols on Cygwin. diff --git a/build/pkgs/zn_poly/SPKG.rst b/build/pkgs/zn_poly/SPKG.rst new file mode 100644 index 00000000000..5448fa62620 --- /dev/null +++ b/build/pkgs/zn_poly/SPKG.rst @@ -0,0 +1,96 @@ +zn_poly +======= + +Description +----------- + +zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is +any modulus that fits into an unsigned long. + +Website: https://gitlab.com/sagemath/zn_poly + +Note: Original website is at http://cims.nyu.edu/~harvey/zn_poly/ but is +no longer maintained. Sage maintains an "official" continuation of the +project at the above link. + +License +------- + +GPL V2 or V3. Some of the code has been copied from other projects - see +the file src/COPYING for details. + + +Upstream Contact +---------------- + +- David Harvey +- \E. M. Bray + +Dependencies +------------ + +- GMP/MPIR +- (some) Python (to create the Makefile) +- GNU patch +- NTL apparently only if we configured zn_poly differently (same for + FLINT) + + +Special Update/Build Instructions +--------------------------------- + +- Make sure the patches still apply. + + Especially changes in ``makemakefile.py`` may also require changes to + ``spkg-install`` (and perhaps also ``spkg-check``). + +- There's also a ``--use-flint`` option to ``configure``; no idea what + it does, + and we currently don't use it either. + +- TODO: +- Use ``make install`` instead of manually "installing" (copying and + symlinking) the [shared] libraries and header files. This requires + further + tweaking of ``makemakefile.py``, since it currently only installs a + static + library and the headers. + +- If everything's fine, i.e., no problems arise, some comments and + especially some code I currently just commented out can certainly be removed. + (-leif, 04/2012) + +- The version number "0.9.p11" is used as a doctest in the function + package_versions in sage/misc/packages.py, so if this package gets + upgraded, that doctest needs to be changed. + +Patches +~~~~~~~ + +- All patches from Sage have been merged into upstream. These include: +- makemakefile.py.patch: + + Improves the Python script creating the Makeefile for better use at + least within Sage; see patch for details. (Last modified at #12433, + which added and changed a lot.) + +- profiler.c.patch, zn_poly.h.patch: + + Fix potential redefinition of ``ulong`` (in combination with other + headers). + +- mpn_mulmid-tune.c.patch, mulmid-tune.c.patch, mul-tune.c.patch: + + Fix "jump into scope of identifier with variably modified type" + errors. (See #8771). + +- mpn_mulmid-test.c.patch: + + Fix a potential problem when the value of ZNP_mpn_smp_kara_thresh is + SIZE_MAX, this is usually irrealistic but can happen at least on + linux on power7 with gcc-4.7.1 (see #14098). + +- fix_fudge_factor_in_nuss-test.c.patch: + + As the name says; fix provided by upstream (David Harvey); see + #13947. diff --git a/build/pkgs/zn_poly/SPKG.txt b/build/pkgs/zn_poly/SPKG.txt deleted file mode 100644 index e6f3dde412a..00000000000 --- a/build/pkgs/zn_poly/SPKG.txt +++ /dev/null @@ -1,70 +0,0 @@ -= zn_poly = - -== Description == - -zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is any -modulus that fits into an unsigned long. - -Website: https://gitlab.com/sagemath/zn_poly - -Note: Original website is at http://cims.nyu.edu/~harvey/zn_poly/ but is no -longer maintained. Sage maintains an "official" continuation of the project -at the above link. - -== License == - -GPL V2 or V3. Some of the code has been copied from other projects - see -the file src/COPYING for details. - -== Upstream Contact == - - * David Harvey - * E. M. Bray - -== Dependencies == - - * GMP/MPIR - * (some) Python (to create the Makefile) - * GNU patch - * NTL apparently only if we configured zn_poly differently (same for FLINT) - -== Special Update/Build Instructions == - - * Make sure the patches still apply. - Especially changes in `makemakefile.py` may also require changes to - `spkg-install` (and perhaps also `spkg-check`). - * There's also a `--use-flint` option to `configure`; no idea what it does, - and we currently don't use it either. - * TODO: - - Use `make install` instead of manually "installing" (copying and sym- - linking) the [shared] libraries and header files. This requires further - tweaking of `makemakefile.py`, since it currently only installs a static - library and the headers. - - If everything's fine, i.e., no problems arise, some comments and especial- - ly some code I currently just commented out can certainly be removed. - (-leif, 04/2012) - * The version number "0.9.p11" is used as a doctest in the function - package_versions in sage/misc/packages.py, so if this package gets - upgraded, that doctest needs to be changed. - -=== Patches === - - * All patches from Sage have been merged into upstream. These include: - * makemakefile.py.patch: - Improves the Python script creating the Makeefile for better use at - least within Sage; see patch for details. (Last modified at #12433, - which added and changed a lot.) - * profiler.c.patch, zn_poly.h.patch: - Fix potential redefinition of `ulong` (in combination with other - headers). - * mpn_mulmid-tune.c.patch, mulmid-tune.c.patch, mul-tune.c.patch: - Fix "jump into scope of identifier with variably modified type" - errors. (See #8771). - * mpn_mulmid-test.c.patch: - Fix a potential problem when the value of ZNP_mpn_smp_kara_thresh is - SIZE_MAX, this is usually irrealistic but can happen at least on - linux on power7 with gcc-4.7.1 (see #14098). - * fix_fudge_factor_in_nuss-test.c.patch: - As the name says; fix provided by upstream (David Harvey); see - #13947. - diff --git a/build/pkgs/zope_interface/SPKG.rst b/build/pkgs/zope_interface/SPKG.rst new file mode 100644 index 00000000000..19310888c32 --- /dev/null +++ b/build/pkgs/zope_interface/SPKG.rst @@ -0,0 +1,16 @@ +zope.interface +============== + +Description +----------- + +This package is intended to be independently reusable in any Python +project. It is maintained by the Zope Toolkit project. + +This package provides an implementation of "object interfaces" for +Python. Interfaces are a mechanism for labeling objects as conforming to +a given API or contract. So, this package can be considered as +implementation of the Design By Contract methodology support in Python. + +For detailed documentation, please see +http://docs.zope.org/zope.interface diff --git a/build/pkgs/zope_interface/SPKG.txt b/build/pkgs/zope_interface/SPKG.txt deleted file mode 100644 index ca529666746..00000000000 --- a/build/pkgs/zope_interface/SPKG.txt +++ /dev/null @@ -1,13 +0,0 @@ -= zope.interface = - -== Description == - -This package is intended to be independently reusable in any Python project. -It is maintained by the Zope Toolkit project. - -This package provides an implementation of "object interfaces" for Python. -Interfaces are a mechanism for labeling objects as conforming to a given API -or contract. So, this package can be considered as implementation of the -Design By Contract methodology support in Python. - -For detailed documentation, please see http://docs.zope.org/zope.interface diff --git a/build/sage_bootstrap/app.py b/build/sage_bootstrap/app.py index 45818546a18..30a4d90c917 100644 --- a/build/sage_bootstrap/app.py +++ b/build/sage_bootstrap/app.py @@ -137,10 +137,10 @@ def fix_all_checksums(self): log.debug('Ignoring {0} because tarball is not cached'.format(pkg.tarball_filename)) continue if pkg.tarball.checksum_verifies(): - log.debug('Checksum of {0} unchanged'.format(pkg.tarball_filename)) + log.debug('Checksum of {0} (tarball {1}) unchanged'.format(pkg.name, pkg.tarball_filename)) continue update = ChecksumUpdater(pkg.name) - print('Updating checksum of {0}'.format(pkg.tarball_filename)) + print('Updating checksum of {0} (tarball {1})'.format(pkg.name, pkg.tarball_filename)) update.fix_checksum() def fix_checksum(self, package_name): @@ -154,9 +154,9 @@ def fix_checksum(self, package_name): update = ChecksumUpdater(package_name) pkg = update.package if pkg.tarball.checksum_verifies(): - print('Checksum of {0} unchanged'.format(pkg.tarball_filename)) + print('Checksum of {0} (tarball {1}) unchanged'.format(package_name, pkg.tarball_filename)) else: - print('Updating checksum of {0}'.format(pkg.tarball_filename)) + print('Updating checksum of {0} (tarball {1})'.format(package_name, pkg.tarball_filename)) update.fix_checksum() def create(self, package_name, version, tarball, pkg_type, upstream_url): diff --git a/build/sage_bootstrap/cmdline.py b/build/sage_bootstrap/cmdline.py index abb617dd65a..48dc0d9c3fe 100644 --- a/build/sage_bootstrap/cmdline.py +++ b/build/sage_bootstrap/cmdline.py @@ -134,7 +134,7 @@ EXAMPLE: $ sage --package fix-checksum pari - Updating checksum of pari-2.8-2044-g89b0f1e.tar.gz + Updating checksum of pari (tarball pari-2.8-2044-g89b0f1e.tar.gz) """ epilog_create = \ diff --git a/build/test/test_package_cmdline.py b/build/test/test_package_cmdline.py index 69011314e1f..739fbe76d30 100644 --- a/build/test/test_package_cmdline.py +++ b/build/test/test_package_cmdline.py @@ -140,7 +140,7 @@ def test_fix_checksum(self): # Prints to stdout self.assertEqual( stdout.rstrip(), - 'Checksum of {0} unchanged'.format(pkg.tarball_filename)) + 'Checksum of {0} (tarball {1}) unchanged'.format(pkg.name, pkg.tarball_filename)) def test_create(self): tmp = tempfile.mkdtemp() diff --git a/configure.ac b/configure.ac index db7325ac044..87ceba98628 100644 --- a/configure.ac +++ b/configure.ac @@ -375,22 +375,18 @@ SAGE_CHECK_OSX_SUPPORTED() ############################################################################### # Python version -AC_MSG_CHECKING([Python version to install]) AC_ARG_WITH([python], -[AS_HELP_STRING([--with-python=2], - [build and use Python 2])] [AS_HELP_STRING([--with-python=3], [build and use Python 3 (default)])]) case "$with_python" in - 2*) SAGE_PYTHON_VERSION=2;; - 3*) SAGE_PYTHON_VERSION=3;; + 3) SAGE_PYTHON_VERSION=3;; + 3*) AC_MSG_WARN([the only allowed value for --with-python is 3; specific Python 3.x versions cannot be requested using --with-python. For compatibility reasons, this is only a warning. Use './configure PYTHON3=/path/to/python3' to use a specific Python 3 binary for the Sage venv.]) + SAGE_PYTHON_VERSION=3;; "") SAGE_PYTHON_VERSION=3;; *) - AC_MSG_ERROR([allowed values for --with-python are 2 and 3]);; + AC_MSG_ERROR([the only allowed value for --with-python is 3. Support for Python 2 has been removed in Sage 9.2.]);; esac - -AC_MSG_RESULT([$SAGE_PYTHON_VERSION]) AC_SUBST(SAGE_PYTHON_VERSION) # $(TOOLCHAIN) variable containing prerequisites for the build diff --git a/src/bin/sage b/src/bin/sage index b3e02d65d6a..4fc35077123 100755 --- a/src/bin/sage +++ b/src/bin/sage @@ -24,30 +24,21 @@ usage() { echo echo "Optional arguments:" echo " file.[sage|py|spyx] -- run given .sage, .py or .spyx file" - echo " -advanced -- list all command line options" + echo " --advanced -- list all command line options" echo " -c -- Evaluates cmd as sage code" - echo " -experimental -- list all experimental packages that can be installed" - echo " -gap [...] -- run Sage's Gap with given arguments" - echo " -gap3 [...] -- run Sage's Gap3 with given arguments" - echo " -gp [...] -- run Sage's PARI/GP calculator with given arguments" - echo " -h, -? -- print this help message" - echo " -i [packages] -- install the given Sage packages" - echo " -pip [...] -- invoke pip, the Python package manager" - echo " -inotebook [...] -- start the *insecure* Sage notebook (deprecated)" - echo " -maxima [...] -- run Sage's Maxima with given arguments" - echo " -mwrank [...] -- run Sage's mwrank with given arguments" + echo " --gap [...] -- run Sage's Gap with given arguments" + echo " --gp [...] -- run Sage's PARI/GP calculator with given arguments" + echo " -h -- print this help message" + echo " --pip [...] -- invoke pip, the Python package manager" + echo " --maxima [...] -- run Sage's Maxima with given arguments" + echo " --mwrank [...] -- run Sage's mwrank with given arguments" echo " --notebook=[...] -- start the Sage notebook (valid options are" - echo " 'default', 'sagenb', 'jupyter', and 'export')" + echo " 'default', 'jupyter', and 'export')" echo " Current default is 'export' from sagenb to jupyter" echo " -n, --notebook -- shortcut for --notebook=default" - echo " -optional -- list all optional packages that can be installed" - echo " -python [...] -- run the Python interpreter" - echo " -python2 [...] -- run the Python 2 interpreter" - echo " -python3 [...] -- run the Python 3 interpreter" + echo " --python [...], --python3 [...] -- run the Python 3 interpreter" echo " -R [...] -- run Sage's R with given arguments" - echo " -singular [...] -- run Sage's singular with given arguments" - echo " -sqlite3 [...] -- run Sage's sqlite3 with given arguments" - echo " -root -- print the Sage root directory" + echo " --singular [...] -- run Sage's singular with given arguments" echo " --nodotsage -- run Sage without using the user's .sage directory:" echo " create and use a temporary .sage directory instead" echo " -t [options] <--all|files|dir>" @@ -56,236 +47,16 @@ usage() { echo " --long - include lines with the phrase 'long time'" echo " --verbose - print debugging output during the test" echo " --optional - controls which optional tests are run" - echo " --sagenb - test all sagenb files" echo " --help - show all testing options" - echo " -upgrade [version] -- download, build and install the given version. Here," - echo " 'version' is a git branch or tag name. Useful values" - echo " are 'master' (the current development version, this" - echo " is the default) or a version number like '5.13'." - echo " -v, -version -- display Sage version information" - exit 0 -} - -usage_advanced() { - sage_version -v - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo - echo "Running Sage:" - echo " file.[sage|py|spyx] -- run given .sage, .py or .spyx file" - echo " -advanced -- print this advanced help message" - echo " -c -- Evaluates cmd as sage code" - echo " -h, -? -- print short help message" - echo " -min [...] -- do not populate global namespace (must be first" - echo " option)" - echo " -preparse -- preparse file.sage and produce corresponding file.sage.py" - echo " -q -- quiet; start with no banner" - echo " -root -- print the Sage root directory" - echo " -gthread, -qthread, -q4thread, -wthread, -pylab" - echo " -- pass the option through to ipython" - echo " -v, -version -- display Sage version information" - echo " -dumpversion -- print Sage version" - echo " -git-branch -- print the current git branch" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Running the notebook:" - echo " --notebook=[...] -- start the Sage notebook (valid options are" - echo " 'default', 'sagenb', 'jupyter' and 'export')." - echo " Current default is 'export' sagenb to jupyter." - echo " See the output of sage --notebook --help" - echo " for more details and examples of how to pass" - echo " optional arguments" - echo " -bn, -build-and-notebook [...] -- build the Sage library then start" - echo " the Sage notebook" - echo " -inotebook [...] -- start the *insecure* Sage notebook (deprecated)" - echo " -n, -notebook [...] -- start the default Sage notebook (options are the" - echo " same as for the notebook command in Sage). See the" - echo " output of sage -n -h for more details" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Running external programs:" - echo " -cleaner -- run the Sage cleaner" - echo " -cython [...] -- run Cython with given arguments" - echo " -ecl [...] -- run Common Lisp" - echo " -gap [...] -- run Sage's Gap with given arguments" - echo " -gap3 [...] -- run Sage's Gap3 with given arguments" - echo " -gdb -- run Sage under the control of gdb" - echo " -gp [...] -- run Sage's PARI/GP calculator with given arguments" - echo " -ipython [...] -- run Sage's IPython using the default environment (not" - echo " Sage), passing additional options to IPython" - echo " -ipython3 [...] -- same as above, but using Python 3" - echo " -jupyter [...] -- run Sage's Jupyter with given arguments" - echo " -kash [...] -- run Sage's Kash with given arguments" - command -v kash &>/dev/null || \ - echo " (not installed currently, run sage -i kash)" - echo " -lisp [...] -- run Lisp interpreter included with Sage" - echo " -M2 [...] -- run Sage's Macaulay2 with given arguments" - command -v M2 &>/dev/null || \ - echo " (not installed currently, run sage -i macaulay2)" - echo " -maxima [...] -- run Sage's Maxima with given arguments" - echo " -mwrank [...] -- run Sage's mwrank with given arguments" - echo " -polymake [...] -- run Sage's Polymake with given arguments" - command -v polymake &>/dev/null || \ - echo " (not installed currently, run sage -i polymake)" - echo " -python [...] -- run the Python interpreter" - echo " -python2 [...] -- run the Python 2 interpreter" - echo " -python3 [...] -- run the Python 3 interpreter" - echo " -R [...] -- run Sage's R with given arguments" - echo " -scons [...] -- run Sage's scons" - echo " -sh [...] -- run \$SHELL ($SHELL) with Sage environment variables" - echo " as they are set in the runtime of Sage" - echo " -buildsh [...] -- run \$SHELL ($SHELL) with Sage environment variables" - echo " as they are set while building Sage and its packages" - echo " -singular [...] -- run Sage's singular with given arguments" - echo " -sqlite3 [...] -- run Sage's sqlite3 with given arguments" - echo " -twistd [...] -- run Twisted server" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Installing packages and upgrading:" - echo " -package [args] -- call the new package manager with given arguments." - echo " Run without arguments for package-specific help." - echo " -experimental -- list all experimental packages that can be installed" - echo " -f [opts] [packages]-- shortcut for -i -f: force build of the given Sage" - echo " packages" - echo " -i [opts] [packages]-- install the given Sage packages. Options:" - echo " -c -- run the packages' test suites" - echo " -d -- only download, do not install packages" - echo " -f -- force build: install the packages even" - echo " if they are already installed" - echo " -s -- do not delete the temporary build directories" - echo " after a successful build" - echo " -y -- reply yes to prompts about experimental" - echo " and old-style packages; warning: there" - echo " is no guarantee that these packages will" - echo " build correctly; use at your own risk" - echo " -n -- reply no to prompts about experimental" - echo " and old-style packages" - echo " -p [opts] [packages]-- install the given Sage packages, without dependency" - echo " checking and with support for old-style spkgs." - echo " Options are -c, -d and -s with the same meaning as" - echo " for the -i command" - echo " -info [packages] -- print the SPKG.txt of the given packages" - echo " --location -- if needed, fix paths to make Sage relocatable" - echo " -optional -- list all optional packages that can be installed" - echo " -standard -- list all standard packages that can be installed" - echo " -installed -- list all installed packages" - echo " -upgrade [version] -- download, build and install the given version. Here," - echo " 'version' is a git branch or tag name. Useful values" - echo " are 'master' (the current development version, this" - echo " is the default) or a version number like '5.13'." - echo " -pip [...] -- invoke pip, the Python package manager" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Building and testing the Sage library:" - echo " -b -- build Sage library." - echo " -ba -- same as -b and rebuild all Cython code" - echo " -ba-force -- same as -ba, but don't query before rebuilding" - echo " -br -- build and run Sage" - echo " -bt [...] -- build and test, options like -t below" - echo " -btp [...] -- build and test parallel, options like -tp below" - echo " -btnew [...] -- build and test modified files, options like -tnew" - echo " -fixdoctests [output_file] [--long]" - echo " -- replace failing doctests with the actual output. With" - echo " optional output_file: redirect there. With the --long" - echo " option: include #long time tests." - echo " -startuptime [module] -- display how long each component of Sage takes to" - echo " start up; optionally specify a module to get more" - echo " details about that particular module" - echo " -t [options] <--all|files|dir>" - echo " -- test examples in .py, .pyx, .sage, .tex or .rst files" - echo " selected options:" - echo " --long - include lines with the phrase 'long time'" - echo " --verbose - print debugging output during the test" - echo " --all - test all files" - echo " --sagenb - test all sagenb files" - echo " --optional - controls which optional tests are run" - echo " --new - only test files modified since last commit" - echo " --initial - only show the first failure per block" - echo " --debug - drop into PDB after an unexpected error" - echo " --failed - only test files that failed last test" - echo " --warn-long [timeout] - warning if doctest is slow" - echo " --only-errors - only output failures, not successes" - echo " --gc=GC - control garbarge collection (ALWAYS:" - echo " collect garbage before every test; NEVER:" - echo " disable gc; DEFAULT: Python default)" - echo " --help - show all testing options" - echo " -tp [...] -- like -t above, but tests in parallel using N threads" - echo " with 0 interpreted as a sensible default" - echo " -testall [options] -- test all source files, docs, and examples. options" - echo " like -t" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Documentation:" - echo " -coverage -- give info about doctest coverage of files" - echo " -coverageall -- give summary info about doctest coverage of all" - echo " files in the Sage library" - echo " -docbuild [lang/] -- Build the Sage documentation" - echo " -search_src -- search through all the Sage library code for string" - echo " -search_doc -- search through the Sage documentation for string" - echo " -grep -- same as -search_src" - echo " -grepdoc -- same as -search_doc" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "File conversion:" - echo " -rst2ipynb [...] -- Generates Jupyter notebook (.ipynb) from standalone" - echo " reStructuredText source." - command -v rst2ipynb &>/dev/null || \ - echo " (not installed currently, run sage -i rst2ipynb)" - echo " -ipynb2rst [...] -- Generates a reStructuredText source file from" - echo " a Jupyter notebook (.ipynb)." - echo " -rst2txt [...] -- Generates Sage worksheet text file from standalone" - echo " reStructuredText source." - echo " -rst2sws [...] -- Generates Sage worksheet (.sws) from standalone" - echo " reStructuredText source." - echo " -sws2rst -- Generates a reStructuredText source file from" - echo " a Sage worksheet (.sws) document." - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Making Sage packages or distributions:" - echo " -sdist -- build a source distribution of Sage" - echo " -fix-pkg-checksums -- fix the checksums from build/pkgs directories from " - echo " the packages located in upstream/" - - echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Valgrind memory debugging:" - echo " -cachegrind -- run Sage using Valgrind's cachegrind tool. The log" - echo " files are named sage-cachegrind.PID can be found in" - echo " $DOT_SAGE" - echo " -callgrind -- run Sage using Valgrind's callgrind tool. The log" - echo " files are named sage-callgrind.PID can be found in" - echo " $DOT_SAGE" - echo " -massif -- run Sage using Valgrind's massif tool. The log" - echo " files are named sage-massif.PID can be found in" - echo " $DOT_SAGE" - echo " -memcheck -- run Sage using Valgrind's memcheck tool. The log" - echo " files are named sage-memcheck.PID can be found in" - echo " $DOT_SAGE" - echo " -omega -- run Sage using Valgrind's omega tool. The log" - echo " files are named sage-omega.PID can be found in" - echo " $DOT_SAGE" - echo " -valgrind -- this is an alias for -memcheck" - echo - echo "You can also use -- before a long option, e.g., 'sage --optional'." - echo + echo " -v, --version -- display Sage version information" + if [ -n "$SAGE_ROOT" ]; then + exec "$SAGE_ROOT/build/bin/sage-site" "-h" + fi exit 0 } +# 'usage_advanced', which prints a longer help message, is defined +# below, after sourcing sage-env. ##################################################################### # Special options to be processed without sage-env @@ -384,7 +155,7 @@ if [ "$1" = '-i' ]; then # See https://trac.sagemath.org/ticket/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, use -p instead of -i to install it" + echo >&2 "Note: if it is an old-style package, installing these is no longer supported" exit 1 fi $MAKE SAGE_SPKG="sage-spkg $INSTALL_OPTIONS" "$PKG" @@ -395,7 +166,6 @@ if [ "$1" = '-i' ]; then exit 0 fi - ##################################################################### # Report information about the Sage environment ##################################################################### @@ -415,15 +185,6 @@ if [ "$1" = '-root' -o "$1" = '--root' ]; then exit 0 fi -if [ $# -gt 0 ]; then - if [ "$1" = '-h' -o "$1" = '-?' -o "$1" = '-help' -o "$1" = '--help' ]; then - usage - fi - if [ "$1" = "-advanced" -o "$1" = "--advanced" ]; then - usage_advanced - fi -fi - ##################################################################### # Source sage-env ($0 is the name of this "sage" script, so we can just @@ -443,6 +204,11 @@ if [ -z "$DOT_SAGE" ]; then export DOT_SAGE="$HOME/.sage" fi + +##################################################################### +# Helper functions +##################################################################### + # Prepare for running Sage, either interactively or non-interactively. sage_setup() { # Check that we're not in a source tarball which hasn't been built yet (#13561). @@ -489,6 +255,211 @@ interactive_sage() { exec sage-ipython "$@" -i } +##################################################################### +# sage --advanced +##################################################################### + +usage_advanced() { + sage_version -v + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo + echo "Running Sage, the most common options:" + echo + echo " file.[sage|py|spyx] -- run given .sage, .py or .spyx file" + echo " -h, -?, --help -- print a short help message" + echo " -v, --version -- print the Sage version" + echo " --advanced -- print this list of Sage options" + echo " -c cmd -- evaluate cmd as sage code. For example," + echo " \"sage -c 'print(factor(35))'\" will" + echo " print \"5 * 7\"." + echo + echo "Running Sage, other options:" + echo + echo " --dumpversion -- print brief Sage version" + echo " --preparse file.sage -- preparse \"file.sage\", and produce" + echo " the corresponding Python file" + echo " \"file.sage.py\"" + echo " -q -- quiet; start with no banner" + echo " --min -- do not populate global namespace" + echo " (must be first option)" + echo " --nodotsage -- run Sage without using the user's" + echo " .sage directory: create and use a temporary" + echo " .sage directory instead." + echo " --gthread, --qthread, --q4thread, --wthread, --pylab" + echo " -- pass the option through to IPython" + if [ -n "$SAGE_SRC" -a -d "$SAGE_SRC" ]; then + echo " --grep [options] " + echo " -- regular expression search through the Sage" + echo " library for \"string\". Any options will" + echo " get passed to the \"grep\" command." + echo " --grepdoc [options] " + echo " -- regular expression search through the" + echo " Sage documentation for \"string\"." + echo " --search_src ... -- same as --grep" + echo " --search_doc ... -- same as --grepdoc" + fi + echo + echo "Running external programs:" + echo + echo " --cython [...] -- run Cython with the given arguments" + echo " --ecl [...], --lisp [...] -- run Sage's copy of ECL (Embeddable" + echo " Common Lisp) with the given arguments" + echo " --gap [...] -- run Sage's Gap with the given arguments" + echo " --gap3 [...] -- run Sage's Gap3 with the given arguments" + command -v gap3 &>/dev/null || \ + echo " (not installed currently, run sage -i gap3)" + echo " --gdb -- run Sage under the control of gdb" + echo " --gdb-ipython -- run Sage's IPython under the control of gdb" + echo " --git [...] -- run Sage's Git with the given arguments" + echo " --gp [...] -- run Sage's PARI/GP calculator with the" + echo " given arguments" + echo " --ipython [...], --ipython3 [...]" + echo " -- run Sage's IPython using the default" + echo " environment (not Sage), passing additional" + echo " additional options to IPython" + echo " --jupyter [...] -- run Sage's Jupyter with given arguments" + echo " --kash [...] -- run Sage's Kash with the given arguments" + command -v kash &>/dev/null || \ + echo " (not installed currently, run sage -i kash)" + echo " --M2 [...] -- run Sage's Macaulay2 with the given arguments" + command -v M2 &>/dev/null || \ + echo " (not installed currently, run sage -i macaulay2)" + echo " --maxima [...] -- run Sage's Maxima with the given arguments" + echo " --mwrank [...] -- run Sage's mwrank with the given arguments" + echo " --pip [...] -- invoke pip, the Python package manager" + echo " --polymake [...] -- run Sage's Polymake with given arguments" + command -v polymake &>/dev/null || \ + echo " (not installed currently, run sage -i polymake)" + echo " --python [...], --python3 [...]" + echo " -- run the Python 3 interpreter" + echo " -R [...] -- run Sage's R with the given arguments" + echo " --scons [...] -- run Sage's scons" + echo " --singular [...] -- run Sage's singular with the given arguments" + echo " --sqlite3 [...] -- run Sage's sqlite3 with given arguments" + echo + echo "Running the notebook:" + echo + echo " -n [...], --notebook=[...]" + echo " -- start the notebook; valid options" + echo " include \"default\", \"jupyter\", \"export\"." + echo " Current default is \"jupyter\"." + echo " Run \"sage --notebook --help\" for more details." + echo + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo "Testing files:" + echo + echo " -t [options] -- test examples in .py, .pyx, .sage" + echo " or .tex files. Options:" + echo " --long -- include lines with the phrase 'long time'" + echo " --verbose -- print debugging output during the test" + echo " --all -- test all files" + echo " --optional -- also test all examples labeled \"# optional\"" + echo " --only-optional[=tags]" + echo " -- if no 'tags' are specified, only run" + echo " blocks of tests containing a line labeled" + echo " \"# optional\". If a comma-separated" + echo " list of tags is specified, only run block" + echo " containing a line labeled \"# optional tag\"" + echo " for any of the tags given, and in these blocks" + echo " only run the lines which are unlabeled or" + echo " labeled \"# optional\" or labeled" + echo " \"# optional tag\" for any of the tags given." + echo " --randorder[=seed] -- randomize order of tests" + echo " --new -- only test files modified since last commit" + echo " --initial -- only show the first failure per block" + echo " --debug -- drop into PDB after an unexpected error" + echo " --failed -- only test files that failed last test" + echo " --warn-long [timeout] -- warning if doctest is slow" + echo " --only-errors -- only output failures, not successes" + echo " --gc=GC -- control garbarge collection (ALWAYS:" + echo " collect garbage before every test; NEVER:" + echo " disable gc; DEFAULT: Python default)" + echo " --short[=secs] -- run as many doctests as possible in about 300" + echo " seconds (or the number of seconds given.) This runs" + echo " the tests for each module from the top of the file" + echo " and skips tests once it exceeds the budget" + echo " allocated for that file." + echo " --help -- show all testing options" + echo " --tnew [...] -- equivalent to -t --new" + echo " -tp [...] -- like -t above, but tests in parallel using" + echo " N threads, with 0 interpreted as min(8, cpu_count())" + echo " --testall [options] -- equivalent to -t --all" + echo + echo " --coverage -- give information about doctest coverage of files" + echo " --coverageall -- give summary info about doctest coverage of" + echo " all files in the Sage library" + echo " --startuptime [module] -- display how long each component of Sage takes to" + echo " start up; optionally specify a module to get more" + echo " details about that particular module" + echo + echo "Some developer utilities:" + echo + echo " --sh [...] -- run a shell with Sage environment variables" + echo " as they are set in the runtime of Sage" + echo " --cleaner -- run the Sage cleaner. This cleans up after Sage," + echo " removing temporary directories and spawned processes." + echo " (This gets run by Sage automatically, so it is usually" + echo " not necessary to run it separately.)" + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo "File conversion:" + echo + echo " --rst2ipynb [...] -- Generates Jupyter notebook (.ipynb) from standalone" + echo " reStructuredText source." + command -v rst2ipynb &>/dev/null || \ + echo " (not installed currently, run sage -i rst2ipynb)" + echo " --ipynb2rst [...] -- Generates a reStructuredText source file from" + echo " a Jupyter notebook (.ipynb)." + echo " --rst2txt [...] -- Generates Sage worksheet text file from standalone" + echo " reStructuredText source." + echo " --rst2sws [...] -- Generates Sage worksheet (.sws) from standalone" + echo " reStructuredText source." + echo " --sws2rst -- Generates a reStructuredText source file from" + echo " a Sage worksheet (.sws) document." + echo + #### 1.......................26..................................................78 + #### |.....................--.|...................................................| + echo "Valgrind memory debugging:" + echo + echo " --cachegrind -- run Sage using Valgrind's cachegrind tool. The log" + echo " files are named sage-cachegrind.PID can be found in" + echo " \$DOT_SAGE" + echo " --callgrind -- run Sage using Valgrind's callgrind tool. The log" + echo " files are named sage-callgrind.PID can be found in" + echo " \$DOT_SAGE" + echo " --massif -- run Sage using Valgrind's massif tool. The log" + echo " files are named sage-massif.PID can be found in" + echo " \$DOT_SAGE" + echo " --memcheck -- run Sage using Valgrind's memcheck tool. The log" + echo " files are named sage-memcheck.PID can be found in" + echo " \$DOT_SAGE" + echo " --omega -- run Sage using Valgrind's omega tool. The log" + echo " files are named sage-omega.PID can be found in" + echo " \$DOT_SAGE" + echo " --valgrind -- this is an alias for --memcheck" + if [ -n "$SAGE_ROOT/" ]; then + exec "$SAGE_ROOT/build/bin/sage-site" "--advanced" + fi + echo + exit 0 +} + +if [ $# -gt 0 ]; then + if [ "$1" = '-h' -o "$1" = '-?' -o "$1" = '-help' -o "$1" = '--help' ]; then + usage + fi + if [ "$1" = "-advanced" -o "$1" = "--advanced" ]; then + usage_advanced + fi +fi + + +##################################################################### +# Running Sage +##################################################################### + if [ "$1" = '-min' -o "$1" = '--min' ]; then shift export SAGE_IMPORTALL=no @@ -503,17 +474,76 @@ if [ $# -eq 0 ]; then interactive_sage fi +##################################################################### +# Other basic options +##################################################################### + +if [ "$1" = '-c' ]; then + shift + sage_setup + unset TERM # See Trac #12263 + exec sage-eval "$@" +fi + +if [ "$1" = '-preparse' -o "$1" = "--preparse" ]; then + shift + exec sage-preparse "$@" +fi + if [ "$1" = '-cleaner' -o "$1" = '--cleaner' ]; then exec sage-cleaner fi ##################################################################### -# Run Sage's versions of the standard Algebra/Geometry etc. software +# Run Sage's versions of Python, pip, IPython, Jupyter. +##################################################################### + +if [ "$1" = '-pip' -o "$1" = '--pip' ]; then + shift + exec sage-python -m pip "$@" +fi + +if [ "$1" = '--pip3' ]; then + shift + exec "$SAGE_LOCAL"/bin/python3 -m pip "$@" +fi + +if [ "$1" = '-python' -o "$1" = '--python' ]; then + shift + if [ "$SAGE_PYTHON3" = 'yes' ]; then + exec "$SAGE_LOCAL"/bin/python3 "$@" + else + exec "$SAGE_LOCAL"/bin/python2 "$@" + fi +fi + +if [ "$1" = '-python3' -o "$1" = '--python3' ]; then + shift + exec "$SAGE_LOCAL"/bin/python3 "$@" +fi + +if [ "$1" = '-ipython' -o "$1" = '--ipython' ]; then + shift + exec "$SAGE_LOCAL"/bin/ipython "$@" +fi + +if [ "$1" = '-ipython3' -o "$1" = '--ipython3' ]; then + shift + exec "$SAGE_LOCAL"/bin/ipython3 "$@" +fi + +if [ "$1" = '-jupyter' -o "$1" = '--jupyter' ]; then + shift + exec "$SAGE_LOCAL"/bin/jupyter "$@" +fi + +##################################################################### +# Run Sage's versions of its component packages ##################################################################### -if [ "$1" = '-axiom' -o "$1" = '--axiom' ]; then +if [ "$1" = "-cython" -o "$1" = '--cython' -o "$1" = '-pyrex' -o "$1" = "--pyrex" ]; then shift - exec axiom "$@" + exec sage-cython "$@" fi if [ "$1" = '-gap' -o "$1" = '--gap' ]; then @@ -546,16 +576,6 @@ if [ "$1" = '-sqlite3' -o "$1" = '--sqlite3' ]; then exec sqlite3 "$@" fi -if [ "$1" = '-sws2rst' -o "$1" = '--sws2rst' ]; then - shift - exec sage-sws2rst "$@" -fi - -if [ "$1" = '-twistd' -o "$1" = '--twistd' ]; then - shift - exec twistd "$@" -fi - if [ "$1" = '-ecl' -o "$1" = '--ecl' ]; then shift exec ecl "$@" @@ -571,11 +591,6 @@ if [ "$1" = '-kash' -o "$1" = '--kash' ]; then exec kash "$@" fi -if [ "$1" = '-fixdoctests' -o "$1" = '--fixdoctests' ]; then - shift - exec sage-fixdoctests "$@" -fi - if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then shift exec maxima "$@" @@ -596,69 +611,19 @@ if [ "$1" = '-scons' -o "$1" = '--scons' ]; then exec scons "$@" fi -if [ "$1" = '-pip' -o "$1" = '--pip' ]; then - shift - exec sage-python -m pip "$@" -fi - -if [ "$1" = '--pip3' ]; then - shift - exec "$SAGE_LOCAL"/bin/python3 -m pip "$@" -fi - -if [ "$1" = '-fix-pkg-checksums' -o "$1" = '--fix-pkg-checksums' ]; then - shift - exec sage-fix-pkg-checksums "$@" -fi - -if [ "$1" = '-python' -o "$1" = '--python' ]; then - shift - if [ "$SAGE_PYTHON3" = 'yes' ]; then - exec "$SAGE_LOCAL"/bin/python3 "$@" - else - exec "$SAGE_LOCAL"/bin/python2 "$@" - fi -fi - -if [ "$1" = '-python2' -o "$1" = '--python2' ]; then - shift - exec "$SAGE_LOCAL"/bin/python2 "$@" -fi - -if [ "$1" = '-python3' -o "$1" = '--python3' ]; then - shift - exec "$SAGE_LOCAL"/bin/python3 "$@" -fi - if [ "$1" = '-R' -o "$1" = '--R' ]; then shift exec R "$@" fi -if [ "$1" = '-ipython' -o "$1" = '--ipython' ]; then - shift - exec "$SAGE_LOCAL"/bin/ipython "$@" -fi - -if [ "$1" = '-ipython3' -o "$1" = '--ipython3' ]; then - shift - exec "$SAGE_LOCAL"/bin/ipython3 "$@" -fi - -if [ "$1" = '-jupyter' -o "$1" = '--jupyter' ]; then - shift - exec "$SAGE_LOCAL"/bin/jupyter "$@" -fi - if [ "$1" = '-git' -o "$1" = '--git' ]; then shift exec git "$@" fi -if [ "$1" = '-git-branch' -o "$1" = '--git-branch' ]; then - shift - exec git --git-dir="$SAGE_ROOT"/.git rev-parse --abbrev-ref HEAD -fi +##################################################################### +# sage --sh and sage --buildsh +##################################################################### if [ "$1" = '-sh' -o "$1" = '--sh' -o "$1" = '-buildsh' -o "$1" = '--buildsh' ]; then # AUTHORS: @@ -791,20 +756,6 @@ EOF exit $status fi -##################################################################### -# Test coverage of a module? -##################################################################### - -if [ "$1" = "-coverage" -o "$1" = "--coverage" ]; then - shift - exec sage-coverage "$@" -fi - -if [ "$1" = "-coverageall" -o "$1" = "--coverageall" ]; then - shift - exec sage-coverageall "$@" -fi - ##################################################################### # File conversion ##################################################################### @@ -832,10 +783,18 @@ if [ "$1" = '-rst2sws' -o "$1" = '--rst2sws' ]; then exec sage-rst2sws "$@" fi +if [ "$1" = '-sws2rst' -o "$1" = '--sws2rst' ]; then + shift + exec sage-sws2rst "$@" +fi + ##################################################################### -# Run Sage's versions of the standard Algebra/Geometry etc. software +# The notebook, grep, building Sage, testing Sage ##################################################################### +# build_sage, sage -b, sage -br, etc. could be moved to +# build/bin/sage-site. See #29111. + build_sage() { maybe_sage_location ( cd "$SAGE_SRC" && $MAKE ) || exit $? @@ -858,22 +817,20 @@ if [ "$1" = "-bn" -o "$1" = "--build-and-notebook" ]; then exec sage-notebook --notebook=default "$@" fi -if [ "$1" = "-inotebook" -o "$1" = '--inotebook' ]; then - shift - sage-cleaner &>/dev/null & - exec sage-notebook --notebook=sagenb secure=False "$@" -fi - -if [ "$1" = '-grep' -o "$1" = "--grep" -o "$1" = "-search_src" -o "$1" = "--search_src" ]; then - shift - sage-grep "$@" - exit 0 -fi +if [ -n "$SAGE_SRC" -a -d "$SAGE_SRC" ]; then + # Source inspection facilities, supported on sage-the-distribution and on distributions + # that package the Sage sources. + if [ "$1" = '-grep' -o "$1" = "--grep" -o "$1" = "-search_src" -o "$1" = "--search_src" ]; then + shift + sage-grep "$@" + exit 0 + fi -if [ "$1" = '-grepdoc' -o "$1" = "--grepdoc" -o "$1" = "-search_doc" -o "$1" = "--search_doc" ]; then - shift - sage-grepdoc "$@" - exit 0 + if [ "$1" = '-grepdoc' -o "$1" = "--grepdoc" -o "$1" = "-search_doc" -o "$1" = "--search_doc" ]; then + shift + sage-grepdoc "$@" + exit 0 + fi fi if [ "$1" = '-b' ]; then @@ -929,13 +886,31 @@ if [ "$1" = '-testall' -o "$1" = "--testall" ]; then exec sage-runtests -a "$@" fi -if [ "$1" = '-c' ]; then +if [ "$1" = '-fixdoctests' -o "$1" = '--fixdoctests' ]; then shift - sage_setup - unset TERM # See Trac #12263 - exec sage-eval "$@" + exec sage-fixdoctests "$@" +fi + +if [ "$1" = "-coverage" -o "$1" = "--coverage" ]; then + shift + exec sage-coverage "$@" +fi + +if [ "$1" = "-coverageall" -o "$1" = "--coverageall" ]; then + shift + exec sage-coverageall "$@" fi +if [ "$1" = '-startuptime' -o "$1" = '--startuptime' ]; then + exec sage-startuptime.py "$@" +fi + +##################################################################### +# Creating and handling Sage distributions +##################################################################### + +# The following could be moved to build/bin/sage-site. See #29111. + if [ "$1" = '--location' ]; then maybe_sage_location exit 0 @@ -1025,22 +1000,9 @@ if [ "$1" = '-sdist' -o "$1" = "--sdist" ]; then exec sage-sdist "$@" fi -if [ "$1" = '-rsyncdist' -o "$1" = "--rsyncdist" ]; then - if [ $# -ne 2 ]; then - echo >&2 "** MISSING VERSION NUMBER! **" - exit 2 - fi - maybe_sage_location - exec sage-rsyncdist $2 -fi - -if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then - # Redirect stdin from /dev/null. This helps with running TeX which - # tends to ask interactive questions if something goes wrong. These - # cause the build to hang. If stdin is /dev/null, TeX just aborts. - shift - exec sage-python -m sage_setup.docbuild "$@" -# -# Distributed under the terms of the GNU General Public License (GPL) -# as published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** - - -# Exit on error -set -e - - -# Check whether gzip supports --rsyncable, otherwise bail out immediately -if ! gzip --rsyncable /dev/null 2>/dev/null; then - echo >&2 "It seems your version of gzip does not support the --rsyncable option." - echo >&2 "In order to run sage --rsyncdist, you need a patched gzip." - echo >&2 "For more information about the patch, see" - echo >&2 "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=118118" - exit 1 -fi - - -# If $1 starts with "sage-", remove this prefix -SAGE_VERSION=`echo "$1" | sed 's/^sage-//'` -if [ -z "$SAGE_VERSION" ]; then - echo >&2 "Usage: $0 " - echo >&2 "Create an rsyncable source distribution of Sage" - exit 2 -fi - -# Run this script from SAGE_ROOT -[ -z "$SAGE_ROOT" ] || cd "$SAGE_ROOT" - -if [ ! -r "dist/sage-$SAGE_VERSION.tar" ]; then - echo >&2 "The sdist tarball dist/sage-$SAGE_VERSION.tar has not been created yet." - echo >&2 "You should call this script after running ./sage --sdist - exit 1 -fi - -# Extract existing sdist tarball -mkdir -p "dist/sage-rsync" -cd "dist/sage-rsync" -echo "Extracting sdist tarball sage-$SAGE_VERSION.tar" -tar -x --strip-components 1 -f "../sage-$SAGE_VERSION.tar" - -# Create a shell script to repack the spkgs. The repacked spkgs will -# not be compressed, but that's not a problem. It just means one -# should not make an sdist from an rsyncable Sage distribution. -exec 5>rsyncpack.sh -chmod 755 rsyncpack.sh -cat >&5 <&2 "Cannot determine base package name for $spkg" - exit 1 - fi - - echo "Extracting $spkg to directory $spkgname" - ( bzip2 -cd $spkg || gzip -cd $spkg || cat $spkg ) 2>/dev/null |\ - tar -x --delay-directory-restore - rm $spkg - mv "$spkgnamever" "$spkgname" - - echo "mv '$spkgname' '$spkgnamever' && tar c '$spkgnamever' >'$spkg' && rm -rf '$spkgnamever'" >&5 -done -exec 5<&- -cd ../.. - -# Put files in the tar file in *alphabetical* order, which is much -# better for rsync. Print directories with trailing slash for -# better sorting and skip '.' -echo "Packing tarball sage-rsync.tar.gz" -find . '!' -name . '(' -type d -printf '%P/\n' -or -printf '%P\n' ')' |\ -sort |\ -tar -c --no-recursion -T /dev/stdin |\ -gzip --best --rsyncable >../sage-rsync.tar.gz diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index a22186797fc..e0b573e5b87 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -1,5 +1,5 @@ # Sage version information for shell scripts # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='9.2.beta0' -SAGE_RELEASE_DATE='2020-05-28' -SAGE_VERSION_BANNER='SageMath version 9.2.beta0, Release Date: 2020-05-28' +SAGE_VERSION='9.2.beta1' +SAGE_RELEASE_DATE='2020-06-13' +SAGE_VERSION_BANNER='SageMath version 9.2.beta1, Release Date: 2020-06-13' diff --git a/src/doc/.gitignore b/src/doc/.gitignore index a4b0d22f3bd..a52195617d8 100644 --- a/src/doc/.gitignore +++ b/src/doc/.gitignore @@ -2,5 +2,7 @@ /en/reference/*/sagenb /en/reference/sage /en/reference/sagenb +/en/reference/spkg/*.rst /output /en/installation/*.txt +/en/reference/repl/*.txt diff --git a/src/doc/bootstrap b/src/doc/bootstrap index eaefc1c83f4..fbeb0b90a99 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -49,3 +49,36 @@ for SYSTEM in arch debian fedora cygwin homebrew; do echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort)))" > "$OUTPUT_DIR"/$SYSTEM.txt echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $OPTIONAL_SYSTEM_PACKAGES | xargs -n 1 echo | sort)))" > "$OUTPUT_DIR"/$SYSTEM-optional.txt done + +OUTPUT_DIR="src/doc/en/reference/spkg" +mkdir -p "$OUTPUT_DIR" +echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst" +OUTPUT_INDEX="$OUTPUT_DIR"/index.rst +cat > "$OUTPUT_INDEX" <> "$OUTPUT_INDEX" " $PKG_BASE" + fi + fi +done +cat >> "$OUTPUT_INDEX" <&2 $0:$LINENO: installing "$OUTPUT" +./sage -advanced > "$OUTPUT" diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index 33b8305721e..ae918205b20 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -156,7 +156,7 @@ a minimum the following files: |-- dependencies |-- package-version.txt |-- spkg-install.in - |-- SPKG.txt + |-- SPKG.rst `-- type The following are some additional files which can be added: @@ -459,8 +459,8 @@ example, the ``scipy`` ``spkg-check.in`` file contains the line .. _section-spkg-SPKG-txt: -The SPKG.txt File ------------------ +The SPKG.rst or SPKG.txt File +----------------------------- The ``SPKG.txt`` file should follow this pattern: @@ -497,6 +497,8 @@ with ``PACKAGE_NAME`` replaced by the package name. Legacy ``SPKG.txt`` files have an additional changelog section, but this information is now kept in the git repository. +It is now also possible to use an ``SPKG.rst`` file instead, with the same +sections. .. _section-dependencies: @@ -880,7 +882,7 @@ License Information If you are patching a standard Sage spkg, then you should make sure that the license information for that package is up-to-date, both in its -``SPKG.txt`` file and in the file ``SAGE_ROOT/COPYING.txt``. For +``SPKG.rst`` or ``SPKG.txt`` file and in the file ``SAGE_ROOT/COPYING.txt``. For example, if you are producing an spkg which upgrades the vanilla source to a new version, check whether the license changed between versions. diff --git a/src/doc/en/reference/combinat/module_list.rst b/src/doc/en/reference/combinat/module_list.rst index 64e844e9b8a..47dbe0fb281 100644 --- a/src/doc/en/reference/combinat/module_list.rst +++ b/src/doc/en/reference/combinat/module_list.rst @@ -25,6 +25,7 @@ Comprehensive Module list sage/combinat/baxter_permutations sage/combinat/binary_recurrence_sequences sage/combinat/binary_tree + sage/combinat/blob_algebra sage/combinat/cartesian_product sage/combinat/catalog_partitions sage/combinat/chas/__init__ diff --git a/src/doc/en/reference/index.rst b/src/doc/en/reference/index.rst index ee2aa969af3..9ad57e5cec5 100644 --- a/src/doc/en/reference/index.rst +++ b/src/doc/en/reference/index.rst @@ -151,6 +151,7 @@ Interfaces General Information =================== +* :doc:`External Packages ` * :doc:`References ` * :doc:`History and License ` * :ref:`genindex` diff --git a/src/doc/en/reference/interfaces/index.rst b/src/doc/en/reference/interfaces/index.rst index 8680b94deb8..95a8678b071 100644 --- a/src/doc/en/reference/interfaces/index.rst +++ b/src/doc/en/reference/interfaces/index.rst @@ -76,6 +76,7 @@ and testing to make sure nothing funny is going on). sage/interfaces/gp sage/interfaces/jmoldata sage/interfaces/kash + sage/interfaces/kenzo sage/interfaces/latte sage/interfaces/lie sage/interfaces/lisp diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index fdac52eda90..528b89566c0 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1186,6 +1186,10 @@ REFERENCES: .. [Car1972] \R. W. Carter. *Simple groups of Lie type*, volume 28 of Pure and Applied Mathematics. John Wiley and Sons, 1972. +.. [CQ2019] \A. Cassella and C. Quadrelli. + *Right-angled Artin groups and enhanced Koszul properties*. + Preprint, :arxiv:`1907.03824`, (2019). + .. [CS1996] \G. Call and J. Silverman. Computing the Canonical Height on K3 Surfaces. Mathematics of Comp. , 65 (1996), 259-290. @@ -2420,9 +2424,13 @@ REFERENCES: .. [Gr2007] \J. Green, Polynomial representations of `GL_n`, Springer Verlag, 2007. +.. [Graham1985] \J. Graham, + *Modular representations of Hecke algebras and related algebras*. + PhD thesis, University of Sydney, 1985. + .. [GriRei18] Darij Grinberg, Victor Reiner, *Hopf Algebras in Combinatorics*, - :arxiv:`1409.8356v5`. + :arxiv:`1409.8356v6`. .. [GR1989] \A. M. Garsia, C. Reutenauer. *A decomposition of Solomon's descent algebra.* Adv. Math. **77** (1989). @@ -2857,6 +2865,11 @@ REFERENCES: Science, 447, 74–84 (2012). :doi:`10.1016/j.tcs.2011.11.011` +.. [ILZ2018] \K. Iohara, G. Lehrer, and R. Zhang. + *Schur-Weyl duality for certain infinite dimensional* + `U_q(\mathfrak{sl}_2)`-*modules*. + Preprint, :arxiv:`1811.01325` (2018). + .. [IR1990] \K. Ireland and M. Rosen, *A Classical Introduction to Modern Number Theory*, Springer-Verlag, GTM volume 84, 1990. @@ -3978,6 +3991,10 @@ REFERENCES: .. [MS1977] \F. J. MacWilliams, N. J. A. Sloane, *The Theory of Error-Correcting Codes*, North-Holland, Amsterdam, 1977 +.. [MS1994] \P. Martin and H. Saleur. + *The blob algebra and the periodic Temperley-Lieb algebra*. + Lett. Math. Phys., **30** (1994), no. 3. pp. 189-206. + .. [MS2003] \T. Mulders, A. Storjohann, "On lattice reduction for polynomial matrices", J. Symbolic Comput. 35 (2003), no. 4, 377--401 diff --git a/src/doc/en/reference/repl/options.rst b/src/doc/en/reference/repl/options.rst index 9cdb63f1506..715a6816608 100644 --- a/src/doc/en/reference/repl/options.rst +++ b/src/doc/en/reference/repl/options.rst @@ -9,219 +9,4 @@ Installation Guide for information about making sure your Command-line options for Sage ----------------------------- -.. rubric:: Running Sage, the most common options - -- ``file.[sage|py|spyx]`` -- run the given .sage, .py or .spyx - files (as in ``sage my_file.sage``) -- ``-h``, ``-?``, ``--help`` -- print a short help message -- ``-v``, ``--version`` -- print the Sage version -- ``--advanced`` -- print (essentially this) list of Sage options -- ``-c cmd`` -- evaluate ``cmd`` as sage code. For example, ``sage - -c 'print(factor(35))'`` will print "5 * 7". - -.. rubric:: Running Sage, other options - -- ``--preparse file.sage`` -- preparse ``file.sage``, a file of - Sage code, and produce the corresponding Python file - ``file.sage.py``. See the Sage tutorial for more about preparsing - and the differences between Sage and Python. -- ``-q`` -- quiet; start with no banner -- ``--grep [options] `` -- grep through all the Sage library - code for ``string``. Any options will get passed to the "grep" - command; for example, ``sage --grep -i epstein`` will search for - ``epstein``, and the ``-i`` flag tells grep to ignore case when - searching. Note that while running Sage, you can also use the - function :func:`search_src ` to - accomplish the same thing. -- ``--grepdoc [options] `` -- grep through all the Sage - documentation for ``string``. Note that while running Sage, you can - also use the function :func:`search_doc - ` to accomplish the same thing. -- ``--min [...]`` -- do not populate global namespace (must be first - option) -- ``-gthread``, ``-qthread``, ``-q4thread``, ``-wthread``, - ``-pylab`` -- pass the option through to IPython -- ``--nodotsage`` -- run Sage without using the user's - :file:`.sage` directory: create and use a temporary :file:`.sage` - directory instead. Warning: notebooks are stored in the - :file:`.sage` directory, so any notebooks created while running with - ``--nodotsage`` will be temporary also. - -.. rubric:: Running the notebook - -- ``-n [...]``, ``--notebook=[...]`` -- start the notebook, valid options - are ``default``, ``sagenb``, ``jupyter`` and ``export`` (see the - output of ``sage --notebook --help`` for more details and examples of - how to pass optional arguments) -- ``-bn [...]``, ``--build-and-notebook [...]`` -- build the Sage - library (as by running ``sage -b``) then start the Sage notebook -- ``--inotebook [...]`` -- start the *insecure* Sage notebook - -.. rubric:: Running external programs and utilities - -- ``--cython [...]`` -- run Cython with the given arguments -- ``--ecl [...]``, ``--lisp [...]`` -- run Sage's copy of ECL - (Embeddable Common Lisp) with the given arguments -- ``--gap [...]`` -- run Sage's Gap with the given arguments -- ``--git [...]`` -- run Sage's Git with the given arguments -- ``--gp [...]`` -- run Sage's PARI/GP calculator with the given arguments -- ``--ipython [...]`` -- run Sage's IPython using the default - environment (not Sage), passing additional options to IPython -- ``--kash [...]`` -- run Sage's Kash with the given arguments -- ``--M2 [...]`` -- run Sage's Macaulay2 with the given arguments -- ``--maxima [...]`` -- run Sage's Maxima with the given arguments -- ``--mwrank [...]`` -- run Sage's mwrank with the given arguments -- ``--python [...]``, ``--python2 [...]`` -- run the Python 2 interpreter -- ``--python3 [...]`` -- run the Python 3 interpreter -- ``-R [...]`` -- run Sage's R with the given arguments -- ``--scons [...]`` -- run Sage's scons -- ``--singular [...]`` -- run Sage's singular with the given arguments -- ``--twistd [...]`` -- run Twisted server -- ``--sh [...]`` -- run a shell with Sage environment variables - as they are set in the runtime of Sage -- ``--buildsh [...]`` -- run a shell with Sage environment variables - as they are set while building Sage and its packages -- ``--gdb`` -- run Sage under the control of gdb -- ``--gdb-ipython`` -- run Sage's IPython under the control of gdb -- ``--cleaner`` -- run the Sage cleaner. This cleans up after Sage, - removing temporary directories and spawned processes. (This gets - run by Sage automatically, so it is usually not necessary to run - it separately.) - -.. rubric:: Installing packages and upgrading - -- ``-i [options] [packages]`` -- install the given Sage packages (unless - they are already installed); if no packages are given, print - a list of all installed packages. Options: - - - ``-c`` -- run the packages' test suites, overriding the settings of - :envvar:`SAGE_CHECK` and :envvar:`SAGE_CHECK_PACKAGES`. - - ``-f`` -- force build: install the packages even if they are - already installed. - - ``-s`` -- do not delete the ``spkg/build`` directories after a - successful build -- useful for debugging. - -- ``-f [options] [packages]`` -- shortcut for ``-i -f``: force build of - the given Sage packages. -- ``--info [packages]`` -- display the ``SPKG.txt`` file of the given - Sage packages. -- ``--standard`` -- list all standard packages that can be installed -- ``--optional`` -- list all optional packages that can be installed -- ``--experimental`` -- list all experimental packages that can be installed -- ``--upgrade [url]`` -- download, build and install standard - packages from given url. If url not given, automatically selects - a suitable mirror. If url='ask', it lets you select the mirror. - -.. rubric:: Building and testing the Sage library - -- ``--root`` -- print the Sage root directory -- ``-b`` -- build Sage library -- do this if you have modified - any source code files in :file:`$SAGE_ROOT/src/sage/`. -- ``-ba`` -- same as ``-b``, but rebuild *all* Cython - code. This could take a while, so you will be asked if you want - to proceed. -- ``-ba-force`` -- same as ``-ba``, but don't query before rebuilding -- ``--br`` -- build and run Sage -- ``-t [options] `` -- test examples in .py, .pyx, .sage - or .tex files. Options: - - - ``--long`` -- include lines with the phrase 'long time' - - ``--verbose`` -- print debugging output during the test - - ``--optional`` -- also test all examples labeled ``# optional`` - - ``--only-optional[=tags]`` -- if no ``tags`` are specified, only - run blocks of tests containing a line labeled ``# optional``. If - a comma separated list of tags is specified, only run blocks containing - a line labeled ``# optional tag`` for any of the tags given and in these blocks only - run the lines which are unlabeled or labeled ``#optional`` or labeled - ``#optional tag`` for any of the tags given. - - ``--randorder[=seed]`` -- randomize order of tests - - ``--short[=seconds]`` -- run as many doctests as possible in about 300 - seconds (or the number of seconds given.) This runs the tests for each - module from the top of the file and skips tests once it exceeds the budget - allocated for that file. - -- ``-tnew [...]`` -- like ``-t`` above, but only tests files - modified since last commit -- ``-tp [...]`` -- like ``-t`` above, but tests in parallel - using ``N`` threads with 0 interpreted as ``minimum(8, cpu_count())`` -- ``--testall [options]`` -- test all source files, docs, and - examples; options are the same as for ``-t``. -- ``-bt [...]`` -- build and test, options like ``-t`` above -- ``-btp [...]`` -- build and test in parallel, options like - ``-tp`` above -- ``-btnew [...]`` -- build and test modified files, options like ``-tnew`` -- ``--fixdoctests file.py [output_file] [--long]`` -- writes a new - version of ``file.py`` to ``output_file`` (default: ``file.py.out``) - that will pass the doctests. With the optional ``--long`` argument - the long time tests are also checked. A patch for the new file is - printed to stdout. -- ``--startuptime [module]`` -- display how long each component of Sage takes - to start up. Optionally specify a module (e.g., "sage.rings.qqbar") to get - more details about that particular module. -- ``--coverage `` -- give information about doctest coverage - of files -- ``--coverageall`` -- give summary info about doctest coverage of - all files in the Sage library - -.. rubric:: Documentation - -- ``--docbuild [options] document (format | command)`` -- build or - return information about the Sage documentation. - - - ``document`` -- name of the document to build - - ``format`` -- document output format - - ``command`` -- document-specific command - - A ``document`` and either a ``format`` or a ``command`` are required, unless a - list of one or more of these is requested. - - Options: - - - ``help``, ``-h``, ``--help`` -- print a help message - - ``-H``, ``--help-all`` -- print an extended help message, - including the output from the options ``-h``, ``-D``, ``-F``, - ``-C all``, and a short list of examples. - - ``-D``, ``--documents`` -- list all available documents - - ``-F``, ``--formats`` -- list all output formats - - ``-C DOC``, ``--commands=DOC`` -- list all commands for document - ``DOC``; use ``-C all`` to list all - - ``-i``, ``--inherited`` -- include inherited members in - reference manual; may be slow, may fail for PDF output - - ``-u``, ``--underscore`` -- include variables prefixed with - ``_`` in reference manual; may be slow, may fail for PDF output - - ``-j``, ``--jsmath`` -- render math using jsMath; formats: - ``html``, ``json``, ``pickle``, ``web`` - - ``--no-pdf-links`` -- do not include PDF links in document - ``website``; formats: ``html``, ``json``, ``pickle``, ``web`` - - ``--check-nested`` -- check picklability of nested classes in - document ``reference`` - - ``-N``, ``--no-colors`` -- do not color output; does not affect - children - - ``-q``, ``--quiet`` -- work quietly; same as ``--verbose=0`` - - ``-v LEVEL``, ``--verbose=LEVEL`` -- report progress at level 0 - (quiet), 1 (normal), 2 (info), or 3 (debug); does not affect - children - - Advanced -- use these options with care: - - - ``-S OPTS``, ``--sphinx-opts=OPTS`` -- pass comma-separated ``OPTS`` - to sphinx-build - - ``-U``, ``--update-mtimes`` -- before building reference manual, - update modification times for auto-generated ReST files - -.. rubric:: Making Sage packages or distributions - -- ``--pkg dir`` -- create the Sage package ``dir.spkg`` from the - directory ``dir`` -- ``--pkg_nc dir`` -- as ``--pkg``, but do not compress the package -- ``--merge`` -- run Sage's automatic merge and test script -- ``--sdist`` -- build a source distribution of Sage - -.. rubric:: Valgrind memory debugging - -- ``--cachegrind`` -- run Sage using Valgrind's cachegrind tool -- ``--callgrind`` -- run Sage using Valgrind's callgrind tool -- ``--massif`` -- run Sage using Valgrind's massif tool -- ``--memcheck`` -- run Sage using Valgrind's memcheck tool -- ``--omega`` -- run Sage using Valgrind's omega tool -- ``--valgrind`` -- this is an alias for ``--memcheck`` +.. literalinclude:: options.txt diff --git a/src/doc/en/reference/spkg/conf.py b/src/doc/en/reference/spkg/conf.py new file mode 120000 index 00000000000..2bdf7e68470 --- /dev/null +++ b/src/doc/en/reference/spkg/conf.py @@ -0,0 +1 @@ +../conf_sub.py \ No newline at end of file diff --git a/src/sage/algebras/catalog.py b/src/sage/algebras/catalog.py index e3824417e89..76a59c355cc 100644 --- a/src/sage/algebras/catalog.py +++ b/src/sage/algebras/catalog.py @@ -12,6 +12,7 @@ - :class:`algebras.ArikiKoike ` - :class:`algebras.AskeyWilson ` +- :class:`algebras.Blob ` - :class:`algebras.Brauer ` - :class:`algebras.Clifford ` - :class:`algebras.ClusterAlgebra ` @@ -102,6 +103,7 @@ lazy_import('sage.combinat.diagram_algebras', 'PartitionAlgebra', 'Partition') lazy_import('sage.combinat.diagram_algebras', 'PlanarAlgebra', 'PlanarPartition') lazy_import('sage.combinat.diagram_algebras', 'TemperleyLiebAlgebra', 'TemperleyLieb') +lazy_import('sage.combinat.blob_algebra', 'BlobAlgebra', 'Blob') lazy_import('sage.combinat.posets.moebius_algebra', 'MoebiusAlgebra', 'Moebius') lazy_import('sage.combinat.free_prelie_algebra', 'FreePreLieAlgebra', 'FreePreLie') lazy_import('sage.combinat.free_dendriform_algebra', 'FreeDendriformAlgebra', 'FreeDendriform') diff --git a/src/sage/algebras/commutative_dga.py b/src/sage/algebras/commutative_dga.py index 7780d8c563e..09d528cc2c3 100644 --- a/src/sage/algebras/commutative_dga.py +++ b/src/sage/algebras/commutative_dga.py @@ -2532,7 +2532,7 @@ def minimal_model(self, i=3, max_iterations=3): def extend(phi, ndegrees, ndifs, nimags, nnames): """ - Extend phi to a new algebra with new genererators, labeled by nnames + Extend phi to a new algebra with new generators, labeled by nnames """ B = phi.domain() names = [str(g) for g in B.gens()] diff --git a/src/sage/algebras/free_zinbiel_algebra.py b/src/sage/algebras/free_zinbiel_algebra.py index ce378ef1e0a..63cd7023e57 100644 --- a/src/sage/algebras/free_zinbiel_algebra.py +++ b/src/sage/algebras/free_zinbiel_algebra.py @@ -40,7 +40,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): .. MATH:: - a \circ (b \circ c) = a \circ (b \circ c) + a \circ (c \circ b). + (a \circ b) \circ c = a \circ (b \circ c) + a \circ (c \circ b). Zinbiel algebras were first introduced by Loday (see [Lod1995]_ and [LV2012]_) as the Koszul dual to Leibniz algebras (hence the name @@ -114,7 +114,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): sage: x*(y*z) + x*(z*y) Z[xyz] + Z[xzy] - We see that the Zinbiel algebra is not associative, nor even + We see that the Zinbiel algebra is not associative, not even power associative:: sage: x*(y*z) @@ -124,7 +124,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): sage: (x*x)*x 2*Z[xxx] - We verify that it is a divided powers algebra:: + We verify that it is a divided power algebra:: sage: (x*(x*x)) * (x*(x*(x*x))) 15*Z[xxxxxxx] @@ -479,7 +479,7 @@ def _coerce_map_from_(self, R): def construction(self): """ Return a pair ``(F, R)``, where ``F`` is a :class:`ZinbielFunctor` - and `R` is a ring, such that ``F(R)`` returns ``self``. + and ``R`` is a ring, such that ``F(R)`` returns ``self``. EXAMPLES:: @@ -654,7 +654,7 @@ def check(x): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. EXAMPLES:: diff --git a/src/sage/algebras/lie_algebras/classical_lie_algebra.py b/src/sage/algebras/lie_algebras/classical_lie_algebra.py index 30e5176fdde..9bceec86923 100644 --- a/src/sage/algebras/lie_algebras/classical_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/classical_lie_algebra.py @@ -14,15 +14,15 @@ - Travis Scrimshaw (2019-07-09): Implemented compact real form """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2013-2017 Travis Scrimshaw # # 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. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from collections import OrderedDict from sage.misc.abstract_method import abstract_method @@ -238,7 +238,7 @@ def epsilon(self, i, h): """ return h[i-1,i-1] - # Do we want this to be optional or requried? + # Do we want this to be optional or required? # There probably is a generic implementation we can do. @abstract_method(optional=True) def simple_root(self, i, h): diff --git a/src/sage/algebras/lie_algebras/verma_module.py b/src/sage/algebras/lie_algebras/verma_module.py index 8781879bc8c..c59d964499f 100644 --- a/src/sage/algebras/lie_algebras/verma_module.py +++ b/src/sage/algebras/lie_algebras/verma_module.py @@ -11,15 +11,15 @@ and return as the ``construction()``. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2017 Travis Scrimshaw # # 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. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from sage.misc.lazy_attribute import lazy_attribute from sage.misc.cachefunc import cached_method @@ -651,7 +651,7 @@ def _acted_upon_(self, scalar, self_on_left=False): try: scalar = P._pbw(scalar) except (ValueError, TypeError): - # Cannot be made into a PBW element, so propogate it up + # Cannot be made into a PBW element, so propagate it up return CombinatorialFreeModule.Element._acted_upon_(self, scalar, self_on_left) diff --git a/src/sage/algebras/shuffle_algebra.py b/src/sage/algebras/shuffle_algebra.py index c9816cd1e27..86b8b8c1cac 100644 --- a/src/sage/algebras/shuffle_algebra.py +++ b/src/sage/algebras/shuffle_algebra.py @@ -115,6 +115,15 @@ class ShuffleAlgebra(CombinatorialFreeModule): sage: R = ShuffleAlgebra(QQ,'xy') sage: R.is_commutative() True + + Check for a fix when using numbers as generators:: + + sage: A = algebras.Shuffle(QQ,[0,1]) + sage: A_d = A.dual_pbw_basis() + sage: W = A.basis().keys() + sage: x = A(W([0,1,0])) + sage: A_d(x) + -2*S[word: 001] + S[word: 010] """ @staticmethod def __classcall_private__(cls, R, names, prefix=None): @@ -379,6 +388,12 @@ def algebra_generators(self): sage: A = ShuffleAlgebra(QQ, ['x1','x2']) sage: A.algebra_generators() Family (B[word: x1], B[word: x2]) + + TESTS:: + + sage: A = ShuffleAlgebra(ZZ,[0,1]) + sage: A.algebra_generators() + Family (B[word: 0], B[word: 1]) """ Words = self.basis().keys() return Family([self.monomial(Words([a])) for a in self._alphabet]) @@ -765,7 +780,7 @@ def algebra_generators(self): (S[word: a], S[word: b]) """ W = self.basis().keys() - return tuple(self.monomial(W(a)) for a in self._alphabet) + return tuple(self.monomial(W([a])) for a in self._alphabet) gens = algebra_generators @@ -941,7 +956,7 @@ def expansion_on_basis(self, w): return self._alg.monomial(w) if w.is_lyndon(): W = self.basis().keys() - letter = W(w[0]) + letter = W([w[0]]) expansion = self.expansion_on_basis(W(w[1:])) return self._alg.sum_of_terms((letter * i, c) for i, c in expansion) diff --git a/src/sage/all.py b/src/sage/all.py index 94337b48d5f..7de24e26a94 100644 --- a/src/sage/all.py +++ b/src/sage/all.py @@ -57,12 +57,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -# Future statements which apply to this module. We delete the -# future globals because we do not want these to appear in the sage.all -# namespace. This deleting does not affect the parsing of this module. -from __future__ import absolute_import, division, print_function -del absolute_import, division, print_function - import os import sys import operator @@ -79,7 +73,8 @@ warnings.filterwarnings('ignore', category=ImportWarning) warnings.filterwarnings('ignore', category=ResourceWarning) else: - warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0)) + deprecationWarning = ('ignore', None, DeprecationWarning, None, 0) + if deprecationWarning in warnings.filters: warnings.filters.remove(deprecationWarning) # The psutil swap_memory() function tries to collect some statistics # that may not be available and that we don't need. Hide the warnings @@ -91,7 +86,7 @@ # Ignore all deprecations from IPython etc. warnings.filterwarnings('ignore', category=DeprecationWarning, - module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)') + module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic|jedi)') # Ignore collections.abc warnings, there are a lot of them but they are # harmless. warnings.filterwarnings('ignore', category=DeprecationWarning, diff --git a/src/sage/categories/bialgebras_with_basis.py b/src/sage/categories/bialgebras_with_basis.py index f7ced53db0a..831bab3f068 100644 --- a/src/sage/categories/bialgebras_with_basis.py +++ b/src/sage/categories/bialgebras_with_basis.py @@ -82,7 +82,7 @@ def convolution_product(self, *maps): EXAMPLES: We construct some maps: the identity, the antipode and - projection onto the homogeneous componente of degree 2:: + projection onto the homogeneous component of degree 2:: sage: Id = lambda x: x sage: Antipode = lambda x: x.antipode() diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index 60fbb8d97be..82f3800aa62 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -860,6 +860,8 @@ def noncrossing_partition_lattice(self, c=None, L=None, L = list(self.absolute_order_ideal(gens=c, in_unitary_group=in_unitary_group, return_lengths=True)) + else: + L = [(pi, pi.reflection_length()) for pi in L] rels = [] ref_lens = {pi:l for (pi, l) in L} for (pi, l) in L: @@ -980,8 +982,20 @@ def absolute_poset(self, in_unitary_group=False): Irreducible complex reflection group of rank 2 and type ST4 sage: W.absolute_poset() # optional - gap3 Finite poset containing 24 elements + + TESTS:: + + sage: W1 = CoxeterGroup(['A',2]) + sage: W2 = WeylGroup(['A',2]) + sage: W3 = SymmetricGroup(3) + sage: W1.absolute_poset() + Finite poset containing 6 elements + sage: W2.absolute_poset() + Finite poset containing 6 elements + sage: W3.absolute_poset() + Finite poset containing 6 elements """ - return self.noncrossing_partition_lattice(L=self, in_unitary_group=in_unitary_group) + return self.noncrossing_partition_lattice(L=tuple(self), in_unitary_group=in_unitary_group) class WellGenerated(CategoryWithAxiom): diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index d3280aad2cb..a410fdd1c76 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -127,9 +127,9 @@ def __mul__(self, other): """ if not isinstance(self, ConstructionFunctor) and not isinstance(other, ConstructionFunctor): raise CoercionException("Non-constructive product") - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self - if isinstance(self,IdentityConstructionFunctor): + if isinstance(self, IdentityConstructionFunctor): return other return CompositeConstructionFunctor(other, self) @@ -233,7 +233,7 @@ def _repr_(self): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. .. NOTE:: @@ -261,13 +261,13 @@ def commutes(self, other): """ Determine whether ``self`` commutes with another construction functor. - NOTE: + .. NOTE:: - By default, ``False`` is returned in all cases (even if the two - functors are the same, since in this case :meth:`merge` will apply - anyway). So far there is no construction functor that overloads - this method. Anyway, this method only becomes relevant if two - construction functors have the same rank. + By default, ``False`` is returned in all cases (even if the two + functors are the same, since in this case :meth:`merge` will apply + anyway). So far there is no construction functor that overloads + this method. Anyway, this method only becomes relevant if two + construction functors have the same rank. EXAMPLES:: @@ -287,9 +287,9 @@ def expand(self): """ Decompose ``self`` into a list of construction functors. - NOTE: + .. NOTE:: - The default is to return the list only containing ``self``. + The default is to return the list only containing ``self``. EXAMPLES:: @@ -530,7 +530,7 @@ def __mul__(self, other): """ if isinstance(self, CompositeConstructionFunctor): all = [other] + self.all - elif isinstance(other,IdentityConstructionFunctor): + elif isinstance(other, IdentityConstructionFunctor): return self else: all = other.all + [self] @@ -548,17 +548,17 @@ def _repr_(self): """ s = "..." for c in self.all: - s = "%s(%s)" % (c,s) + s = "%s(%s)" % (c, s) return s def expand(self): """ Return expansion of a CompositeConstructionFunctor. - NOTE: + .. NOTE:: - The product over the list of components, as returned by - the ``expand()`` method, is equal to ``self``. + The product over the list of components, as returned by + the ``expand()`` method, is equal to ``self``. EXAMPLES:: @@ -644,7 +644,6 @@ def __eq__(self, other): """ c = (type(self) == type(other)) if not c: - from sage.categories.functor import IdentityFunctor_generic if isinstance(other, IdentityFunctor_generic): return True return c @@ -670,10 +669,10 @@ def __mul__(self, other): """ Compose construction functors to a composit construction functor, unless one of them is the identity. - NOTE: + .. NOTE:: - The product is in functorial notation, i.e., when applying the product to an object - then the second factor is applied first. + The product is in functorial notation, i.e., when applying the + product to an object then the second factor is applied first. TESTS:: @@ -919,14 +918,14 @@ def __ne__(self, other): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. - NOTE: + .. NOTE:: - Internally, the merging is delegated to the merging of - multipolynomial construction functors. But in effect, - this does the same as the default implementation, that - returns ``None`` unless the to-be-merged functors coincide. + Internally, the merging is delegated to the merging of + multipolynomial construction functors. But in effect, + this does the same as the default implementation, that + returns ``None`` unless the to-be-merged functors coincide. EXAMPLES:: @@ -1074,7 +1073,7 @@ def __mul__(self, other): sage: G*F MPoly[x,y,t] """ - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, MultiPolynomialFunctor): if self.term_order != other.term_order: @@ -1082,15 +1081,15 @@ def __mul__(self, other): if set(self.vars).intersection(other.vars): raise CoercionException("Overlapping variables (%s,%s)" % (self.vars, other.vars)) return MultiPolynomialFunctor(other.vars + self.vars, self.term_order) - elif isinstance(other, CompositeConstructionFunctor) \ - and isinstance(other.all[-1], MultiPolynomialFunctor): + elif (isinstance(other, CompositeConstructionFunctor) + and isinstance(other.all[-1], MultiPolynomialFunctor)): return CompositeConstructionFunctor(other.all[:-1], self * other.all[-1]) else: return CompositeConstructionFunctor(other, self) def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. EXAMPLES:: @@ -1249,7 +1248,7 @@ def __init__(self, gens, order, implementation): True """ - if len(gens)<1: + if not gens: raise ValueError("Infinite Polynomial Rings have at least one generator") ConstructionFunctor.__init__(self, Rings(), Rings()) self._gens = tuple(gens) @@ -1258,7 +1257,7 @@ def __init__(self, gens, order, implementation): def _apply_functor_to_morphism(self, f): """ - Morphisms for inifinite polynomial rings are not implemented yet. + Morphisms for infinite polynomial rings are not implemented yet. TESTS:: @@ -1268,10 +1267,10 @@ def _apply_functor_to_morphism(self, f): sage: R.construction()[0](f) # indirect doctest Traceback (most recent call last): ... - NotImplementedError: Morphisms for inifinite polynomial rings are not implemented yet. + NotImplementedError: Morphisms for infinite polynomial rings are not implemented yet. """ - raise NotImplementedError("Morphisms for inifinite polynomial rings are not implemented yet.") + raise NotImplementedError("Morphisms for infinite polynomial rings are not implemented yet.") def _apply_functor(self, R): """ @@ -1296,7 +1295,7 @@ def _repr_(self): InfPoly{[a,b,x], "degrevlex", "sparse"} """ - return 'InfPoly{[%s], "%s", "%s"}'%(','.join(self._gens), self._order, self._imple) + return 'InfPoly{[%s], "%s", "%s"}' % (','.join(self._gens), self._order, self._imple) def __eq__(self, other): """ @@ -1336,10 +1335,10 @@ def __mul__(self, other): """ Compose construction functors to a composite construction functor, unless one of them is the identity. - NOTE: + .. NOTE:: - The product is in functorial notation, i.e., when applying the product to an object - then the second factor is applied first. + The product is in functorial notation, i.e., when applying the + product to an object then the second factor is applied first. TESTS:: @@ -1358,7 +1357,7 @@ def __mul__(self, other): InfPoly{[x,y], "degrevlex", "dense"}(FractionField(...)) """ - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, self.__class__): # INT = set(self._gens).intersection(other._gens) @@ -1398,7 +1397,7 @@ def __mul__(self, other): BadOverlap = False for x in othervars: if x.count('_') == 1: - g,n = x.split('_') + g, n = x.split('_') if n.isdigit(): if g.isalnum(): # we can interprete x in any InfinitePolynomialRing if g in self._gens: # we can interprete x in self, hence, we will not use it as a variable anymore. @@ -1406,12 +1405,12 @@ def __mul__(self, other): IsOverlap = True # some variables of other can be interpreted in self. if OverlappingVars: # Is OverlappingVars in the right order? - g0,n0 = OverlappingVars[-1].split('_') + g0, n0 = OverlappingVars[-1].split('_') i = self._gens.index(g) i0 = self._gens.index(g0) - if iint(n0): # wrong order + if i == i0 and int(n) > int(n0): # wrong order BadOverlap = True OverlappingVars.append(x) else: @@ -1429,18 +1428,18 @@ def __mul__(self, other): if BadOverlap: # the overlapping variables appear in the wrong order raise CoercionException("Overlapping variables (%s,%s) are incompatible" % (self._gens, OverlappingVars)) - if len(OverlappingVars)>1: # multivariate, hence, the term order matters - if other.term_order.name()!=self._order: + if len(OverlappingVars) > 1: # multivariate, hence, the term order matters + if other.term_order.name() != self._order: raise CoercionException("Incompatible term orders %s, %s" % (self._order, other.term_order.name())) # ok, the overlap is fine, we will return something. if RemainingVars: # we can only partially merge other into self - if len(RemainingVars)>1: - return CompositeConstructionFunctor(MultiPolynomialFunctor(RemainingVars,term_order=other.term_order), self) + if len(RemainingVars) > 1: + return CompositeConstructionFunctor(MultiPolynomialFunctor(RemainingVars, term_order=other.term_order), self) return CompositeConstructionFunctor(PolynomialFunctor(RemainingVars[0]), self) return self return CompositeConstructionFunctor(other, self) - def merge(self,other): + def merge(self, other): """ Merge two construction functors of infinite polynomial rings, regardless of monomial order and implementation. @@ -1473,13 +1472,13 @@ def merge(self,other): return self return None try: - OUT = self*other + OUT = self * other # The following happens if "other" has the same order type etc. if not isinstance(OUT, CompositeConstructionFunctor): return OUT except CoercionException: pass - if isinstance(other,InfinitePolynomialFunctor): + if isinstance(other, InfinitePolynomialFunctor): # We don't require that the orders coincide. This is a difference to self*other # We only merge if other's generators are an ordered subset of self's generators for g in other._gens: @@ -1487,7 +1486,7 @@ def merge(self,other): return None # The sequence of variables is part of the ordering. It must coincide in both rings Ind = [self._gens.index(g) for g in other._gens] - if sorted(Ind)!=Ind: + if sorted(Ind) != Ind: return None # OK, other merges into self. Now, choose the default dense implementation, # unless both functors refer to the sparse implementation @@ -1633,6 +1632,7 @@ def __ne__(self, other): def merge(self, other): """ Merging is only happening if both functors are matrix functors of the same dimension. + The result is sparse if and only if both given functors are sparse. EXAMPLES:: @@ -1789,6 +1789,7 @@ def __ne__(self, other): def merge(self, other): """ Two Laurent polynomial construction functors merge if the variable names coincide. + The result is multivariate if one of the arguments is multivariate. EXAMPLES:: @@ -1858,7 +1859,7 @@ def __init__(self, n, is_sparse=False, inner_product_matrix=None): """ # Functor.__init__(self, Rings(), FreeModules()) # FreeModules() takes a base ring # Functor.__init__(self, Objects(), Objects()) # Object() makes no sense, since FreeModule raises an error, e.g., on Set(['a',1]). - ## FreeModule requires a commutative ring. Thus, we have + # FreeModule requires a commutative ring. Thus, we have Functor.__init__(self, CommutativeRings(), CommutativeAdditiveGroups()) self.n = n self.is_sparse = is_sparse @@ -1906,7 +1907,7 @@ def _apply_functor_to_morphism(self, f): ... NotImplementedError: Can not create induced morphisms of free modules yet """ - ## TODO: Implement this! + # TODO: Implement this! raise NotImplementedError("Can not create induced morphisms of free modules yet") def __eq__(self, other): @@ -1926,7 +1927,8 @@ def __eq__(self, other): True """ if isinstance(other, VectorFunctor): - return (self.n == other.n and self.inner_product_matrix==other.inner_product_matrix) + return (self.n == other.n and + self.inner_product_matrix == other.inner_product_matrix) return False def __ne__(self, other): @@ -2018,10 +2020,10 @@ class SubspaceFunctor(ConstructionFunctor): """ Constructing a subspace of an ambient free module, given by a basis. - NOTE: + .. NOTE:: - This construction functor keeps track of the basis. It can only be applied - to free modules into which this basis coerces. + This construction functor keeps track of the basis. It can only be + applied to free modules into which this basis coerces. EXAMPLES:: @@ -2062,11 +2064,11 @@ def __init__(self, basis): [1 2 3] [4 0 1] """ -## Functor.__init__(self, FreeModules(), FreeModules()) # takes a base ring -## Functor.__init__(self, Objects(), Objects()) # is too general - ## It seems that the category of commutative additive groups - ## currently is the smallest base ring free category that - ## contains in- and output +# Functor.__init__(self, FreeModules(), FreeModules()) # takes a base ring +# Functor.__init__(self, Objects(), Objects()) # is too general + # It seems that the category of commutative additive groups + # currently is the smallest base ring free category that + # contains in- and output Functor.__init__(self, CommutativeAdditiveGroups(), CommutativeAdditiveGroups()) self.basis = basis @@ -2237,7 +2239,8 @@ def merge(self, other): if not self.basis: return other try: - P = pushout(self.basis[0].parent().ambient_module(),other.basis[0].parent().ambient_module()) + P = pushout(self.basis[0].parent().ambient_module(), + other.basis[0].parent().ambient_module()) except CoercionException: return None try: @@ -2246,7 +2249,7 @@ def merge(self, other): submodule = P.span except AttributeError: return None - S = submodule(self.basis+other.basis).echelonized_basis() + S = submodule(self.basis + other.basis).echelonized_basis() return SubspaceFunctor(S) else: return None @@ -2400,10 +2403,10 @@ def __init__(self, p, prec, extras=None): from sage.rings.infinity import Infinity if self.p == Infinity: if self.type not in self._real_types: - raise ValueError("completion type must be one of %s"%(", ".join(self._real_types))) + raise ValueError("completion type must be one of %s" % (", ".join(self._real_types))) else: if self.type not in self._dvr_types: - raise ValueError("completion type must be one of %s"%(", ".join(self._dvr_types[1:]))) + raise ValueError("completion type must be one of %s" % (", ".join(self._dvr_types[1:]))) def _repr_(self): """ @@ -2432,36 +2435,36 @@ def _apply_functor(self, R): """ try: - if len(self.extras) == 0: + if not self.extras: if self.type is None: try: return R.completion(self.p, self.prec) except TypeError: return R.completion(self.p, self.prec, {}) else: - return R.completion(self.p, self.prec, {'type':self.type}) + return R.completion(self.p, self.prec, {'type': self.type}) else: extras = self.extras.copy() extras['type'] = self.type return R.completion(self.p, self.prec, extras) - except (NotImplementedError,AttributeError): + except (NotImplementedError, AttributeError): if R.construction() is None: - raise NotImplementedError("Completion is not implemented for %s"%R.__class__) + raise NotImplementedError("Completion is not implemented for %s" % R.__class__) F, BR = R.construction() M = self.merge(F) or F.merge(self) if M is not None: return M(BR) if self.commutes(F) or F.commutes(self): return F(self(BR)) - raise NotImplementedError("Don't know how to apply %s to %s"%(repr(self),repr(R))) + raise NotImplementedError("Don't know how to apply %s to %s" % (repr(self), repr(R))) def __eq__(self, other): """ - NOTE: + .. NOTE:: - Only the prime used in the completion is relevant to comparison - of Completion functors, although the resulting rings also take - the precision into account. + Only the prime used in the completion is relevant to comparison + of Completion functors, although the resulting rings also take + the precision into account. TESTS:: @@ -2584,11 +2587,16 @@ def merge(self, other): from sage.all import Infinity if self.p == Infinity: new_prec = min(self.prec, other.prec) - new_type = self._real_types[min(self._real_types.index(self.type), \ + new_type = self._real_types[min(self._real_types.index(self.type), self._real_types.index(other.type))] - new_scinot = max(self.extras.get('sci_not',0), other.extras.get('sci_not',0)) - new_rnd = min(self.extras.get('rnd', 0), other.extras.get('rnd', 0)) - return CompletionFunctor(self.p, new_prec, {'type':new_type, 'sci_not':new_scinot, 'rnd':new_rnd}) + new_scinot = max(self.extras.get('sci_not', 0), + other.extras.get('sci_not', 0)) + new_rnd = min(self.extras.get('rnd', 0), + other.extras.get('rnd', 0)) + return CompletionFunctor(self.p, new_prec, + {'type': new_type, + 'sci_not': new_scinot, + 'rnd': new_rnd}) else: new_type = self._dvr_types[min(self._dvr_types.index(self.type), self._dvr_types.index(other.type))] if new_type in ('fixed-mod', 'floating-point'): @@ -2602,13 +2610,13 @@ def merge(self, other): extras['type'] = new_type return CompletionFunctor(self.p, new_prec, extras) -## Completion has a lower rank than FractionField -## and is thus applied first. However, fact is that -## both commute. This is used in the call method, -## since some fraction fields have no completion method -## implemented. +# Completion has a lower rank than FractionField +# and is thus applied first. However, fact is that +# both commute. This is used in the call method, +# since some fraction fields have no completion method +# implemented. - def commutes(self,other): + def commutes(self, other): """ Completion commutes with fraction fields. @@ -2655,9 +2663,9 @@ class QuotientFunctor(ConstructionFunctor): """ Construction functor for quotient rings. - NOTE: + .. NOTE:: - The functor keeps track of variable names. + The functor keeps track of variable names. EXAMPLES:: @@ -2753,12 +2761,12 @@ def _apply_functor(self, R): if I.ring().has_coerce_map_from(R): R = I.ring() else: - R = pushout(R,I.ring().base_ring()) - I = [R(1)*t for t in I.gens()]*R + R = pushout(R, I.ring().base_ring()) + I = [R.one() * t for t in I.gens()] * R try: - Q = R.quo(I,names=self.names) + Q = R.quo(I, names=self.names) except IndexError: # That may happen! - raise CoercionException("Can not apply this quotient functor to %s"%R) + raise CoercionException("Can not apply this quotient functor to %s" % R) if self.as_field:# and hasattr(Q, 'field'): try: Q = Q.field() @@ -3047,9 +3055,9 @@ def _apply_functor(self, R): """ from sage.all import QQ, ZZ, CyclotomicField if self.cyclotomic: - if R==QQ: + if R == QQ: return CyclotomicField(self.cyclotomic) - if R==ZZ: + if R == ZZ: return CyclotomicField(self.cyclotomic).maximal_order() if len(self.polys) == 1: return R.extension(self.polys[0], names=self.names[0], embedding=self.embeddings[0], @@ -3091,7 +3099,7 @@ def __ne__(self, other): __hash__ = ConstructionFunctor.__hash__ - def merge(self,other): + def merge(self, other): """ Merging with another :class:`AlgebraicExtensionFunctor`. @@ -3114,7 +3122,7 @@ def merge(self,other): - If these two extensions are defined by Conway polynomials over finite fields, merges them into a single extension of degree the lcm of the two degrees. - - Otherwise, None is returned. + - Otherwise, ``None`` is returned. REMARK: @@ -3185,12 +3193,12 @@ def merge(self,other): # *after* expanding the functors. Hence, we can # assume that both functors have a single variable. # But for being on the safe side...: - if len(self.names)!=1 or len(other.names)!=1: + if not (len(self.names) == 1 == len(other.names)): return None -## We don't accept a forgetful coercion, since, together -## with bidirectional coercions between two embedded -## number fields, it would yield to contradictions in -## the coercion system. +# We don't accept a forgetful coercion, since, together +# with bidirectional coercions between two embedded +# number fields, it would yield to contradictions in +# the coercion system. # if self.polys==other.polys and self.names==other.names: # # We have a forgetful functor: # if self.embeddings==[None]: @@ -3198,7 +3206,7 @@ def merge(self,other): # if other.embeddings==[None]: # return other # ... or we may use the given embeddings: - if self.embeddings!=[None] and other.embeddings!=[None]: + if self.embeddings != [None] and other.embeddings != [None]: from sage.all import QQ KS = self(QQ) KO = other(QQ) @@ -3217,20 +3225,21 @@ def merge(self,other): # Finite fields and unramified local extensions may use # integers to encode degrees of extensions. from sage.rings.integer import Integer - if (isinstance(self.polys[0], Integer) and isinstance(other.polys[0], Integer) - and self.embeddings == other.embeddings == [None] - and self.structures == other.structures == [None] - and self.kwds == other.kwds): + if (isinstance(self.polys[0], Integer) + and isinstance(other.polys[0], Integer) + and self.embeddings == other.embeddings == [None] + and self.structures == other.structures == [None] + and self.kwds == other.kwds): return AlgebraicExtensionFunctor([self.polys[0].lcm(other.polys[0])], [None], **self.kwds) def __mul__(self, other): """ Compose construction functors to a composit construction functor, unless one of them is the identity. - NOTE: + .. NOTE:: - The product is in functorial notation, i.e., when applying the product to an object - then the second factor is applied first. + The product is in functorial notation, i.e., when applying the + product to an object then the second factor is applied first. TESTS:: @@ -3242,7 +3251,7 @@ def __mul__(self, other): True """ - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, AlgebraicExtensionFunctor): if set(self.names).intersection(other.names): @@ -3253,8 +3262,8 @@ def __mul__(self, other): precs=self.precs + other.precs, implementations=self.implementations + other.implementations, **self.kwds) - elif isinstance(other, CompositeConstructionFunctor) \ - and isinstance(other.all[-1], AlgebraicExtensionFunctor): + elif (isinstance(other, CompositeConstructionFunctor) + and isinstance(other.all[-1], AlgebraicExtensionFunctor)): return CompositeConstructionFunctor(other.all[:-1], self * other.all[-1]) else: return CompositeConstructionFunctor(other, self) @@ -3334,7 +3343,7 @@ def _apply_functor(self, R): """ try: c = R.construction() - if c is not None and c[0]==self: + if c is not None and c[0] == self: return R except AttributeError: pass @@ -3348,14 +3357,14 @@ def merge(self, other): TESTS:: - sage: K.=NumberField(x^3+x^2+1) + sage: K. = NumberField(x^3+x^2+1) sage: CDF.construction()[0].merge(K.construction()[0]) is None True sage: CDF.construction()[0].merge(CDF.construction()[0]) AlgebraicClosureFunctor """ - if self==other: + if self == other: return self return None # Mathematically, Algebraic Closure subsumes Algebraic Extension. @@ -3390,7 +3399,7 @@ def _repr_(self): sage: PF PermutationGroupFunctor[(1,2)] """ - return "PermutationGroupFunctor%s"%self.gens() + return "PermutationGroupFunctor%s" % self.gens() def __call__(self, R): """ @@ -3418,7 +3427,7 @@ def gens(self): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. EXAMPLES:: @@ -3485,7 +3494,7 @@ def __init__(self, box): sage: FM == loads(dumps(FM)) True """ - ConstructionFunctor.__init__(self,Objects(),Objects()) + ConstructionFunctor.__init__(self, Objects(), Objects()) if not callable(box): raise TypeError("input must be callable") self.box = box @@ -3985,8 +3994,8 @@ def pushout(R, S): S_tower = expand_tower(S_tower[:len(Ss)]) else: # Rc is a list of functors from Z to R and Sc is a list of functors from Z to S - R_tower = expand_tower(R_tower[:len(Rs)+1]) - S_tower = expand_tower(S_tower[:len(Ss)+1]) + R_tower = expand_tower(R_tower[:len(Rs) + 1]) + S_tower = expand_tower(S_tower[:len(Ss) + 1]) Rc = [c[0] for c in R_tower[1:]] Sc = [c[0] for c in S_tower[1:]] @@ -4005,9 +4014,9 @@ def apply_from(Xc): try: while Rc or Sc: # if we are out of functors in either tower, there is no ambiguity - if len(Sc) == 0: + if not Sc: all = apply_from(Rc) - elif len(Rc) == 0: + elif not Rc: all = apply_from(Sc) # if one of the functors has lower rank, do it first elif Rc[-1].rank < Sc[-1].rank: @@ -4064,7 +4073,6 @@ def apply_from(Xc): raise CoercionException(ex) - def pushout_lattice(R, S): r""" Given a pair of objects `R` and `S`, try to construct a @@ -4115,11 +4123,11 @@ def pushout_lattice(R, S): return None # truncate at common ancestor - R_tower = list(reversed(R_tower[:Rs.index(start)+1])) - S_tower = list(reversed(S_tower[:Ss.index(start)+1])) - Rs = [c[1] for c in R_tower] # the list of objects + R_tower = list(reversed(R_tower[:Rs.index(start) + 1])) + S_tower = list(reversed(S_tower[:Ss.index(start) + 1])) + Rs = [c[1] for c in R_tower] # the list of objects Ss = [c[1] for c in S_tower] - Rc = [c[0] for c in R_tower] # the list of functors + Rc = [c[0] for c in R_tower] # the list of functors Sc = [c[0] for c in S_tower] # Here we try and construct a 2-dimensional lattice as follows. @@ -4133,10 +4141,10 @@ def pushout_lattice(R, S): # / \ # Qp Frac(Z[t]) # - for i in range(len(Rs)): - lattice[i,0] = Rs[i] - for j in range(len(Ss)): - lattice[0,j] = Ss[j] + for i, Rsi in enumerate(Rs): + lattice[i, 0] = Rsi + for j, Ssj in enumerate(Ss): + lattice[0, j] = Ssj # Now we attempt to fill in the center, one (diagonal) row at a time, # one commuting square at a time. @@ -4156,42 +4164,43 @@ def pushout_lattice(R, S): # Note that when applying the functors in the correct order, base extension # is not needed (though it may occur in the resulting morphisms). # - for i in range(len(Rc)-1): - for j in range(len(Sc)-1): + for i in range(len(Rc) - 1): + for j in range(len(Sc) - 1): try: - if lattice[i,j+1] == lattice[i+1,j]: + if lattice[i, j + 1] == lattice[i + 1, j]: # In this case we have R <- S -> R # We don't want to perform the operation twice # and all subsequent squares will come from objects # where the operation was already performed (either # to the left or right) Rc[i] = Sc[j] = None # IdentityConstructionFunctor() - lattice[i+1,j+1] = lattice[i,j+1] + lattice[i + 1, j + 1] = lattice[i, j + 1] elif Rc[i] is None and Sc[j] is None: - lattice[i+1,j+1] = lattice[i,j+1] + lattice[i + 1, j + 1] = lattice[i, j + 1] elif Rc[i] is None: - lattice[i+1,j+1] = Sc[j](lattice[i+1,j]) + lattice[i + 1, j + 1] = Sc[j](lattice[i + 1, j]) elif Sc[j] is None: - lattice[i+1,j+1] = Rc[i](lattice[i,j+1]) + lattice[i + 1, j + 1] = Rc[i](lattice[i, j + 1]) else: # For now, we just look at the rank. # TODO: be more sophisticated and query the functors themselves if Rc[i].rank < Sc[j].rank: - lattice[i+1,j+1] = Sc[j](lattice[i+1,j]) - Rc[i] = None # force us to use pre-applied Rc[i] + lattice[i + 1, j + 1] = Sc[j](lattice[i + 1, j]) + Rc[i] = None # force us to use pre-applied Rc[i] else: - lattice[i+1,j+1] = Rc[i](lattice[i,j+1]) - Sc[j] = None # force us to use pre-applied Sc[i] + lattice[i + 1, j + 1] = Rc[i](lattice[i, j + 1]) + Sc[j] = None # force us to use pre-applied Sc[i] except (AttributeError, NameError): # pp(lattice) - for i in range(100): - for j in range(100): + for ni in range(100): + for nj in range(100): try: - R = lattice[i,j] - print(i, j, R) + R = lattice[ni, nj] + print(ni, nj, R) except KeyError: break - raise CoercionException("%s does not support %s" % (lattice[i,j], 'F')) + raise CoercionException("%s does not support %s" + % (lattice[ni, nj], 'F')) # If we are successful, we should have something that looks like this. # @@ -4205,41 +4214,43 @@ def pushout_lattice(R, S): # \ / # Frac(Qp[t]) # - R_loc = len(Rs)-1 - S_loc = len(Ss)-1 + R_loc = len(Rs) - 1 + S_loc = len(Ss) - 1 # Find the composition coercion morphisms along the bottom left... if S_loc > 0: - R_map = lattice[R_loc,1].coerce_map_from(R) + R_map = lattice[R_loc, 1].coerce_map_from(R) for i in range(1, S_loc): - map = lattice[R_loc, i+1].coerce_map_from(lattice[R_loc, i]) # The functor used is implicit here, should it be? + map = lattice[R_loc, i + 1].coerce_map_from(lattice[R_loc, i]) + # The functor used is implicit here, should it be? R_map = map * R_map else: - R_map = R.coerce_map_from(R) # id + R_map = R.coerce_map_from(R) # id # ... and bottom right if R_loc > 0: S_map = lattice[1, S_loc].coerce_map_from(S) for i in range(1, R_loc): - map = lattice[i+1, S_loc].coerce_map_from(lattice[i, S_loc]) + map = lattice[i + 1, S_loc].coerce_map_from(lattice[i, S_loc]) S_map = map * S_map else: - S_map = S.coerce_map_from(S) # id + S_map = S.coerce_map_from(S) # id return R_map, S_map -## def pp(lattice): -## """ -## Used in debugging to print the current lattice. -## """ -## for i in range(100): -## for j in range(100): -## try: -## R = lattice[i,j] -## print(i, j, R) -## except KeyError: -## break +# def pp(lattice): +# """ +# Used in debugging to print the current lattice. +# """ +# for i in range(100): +# for j in range(100): +# try: +# R = lattice[i,j] +# print(i, j, R) +# except KeyError: +# break + def construction_tower(R): """ @@ -4269,12 +4280,13 @@ def construction_tower(R): f, R = c if not isinstance(f, ConstructionFunctor): f = BlackBoxConstructionFunctor(f) - tower.append((f,R)) + tower.append((f, R)) if not isinstance(R, Parent): break c = R.construction() return tower + def expand_tower(tower): """ An auxiliary function that is used in :func:`pushout`. @@ -4313,6 +4325,7 @@ def expand_tower(tower): new_tower.append((fs[0], R)) return list(reversed(new_tower)) + def type_to_parent(P): """ An auxiliary function that is used in :func:`pushout`. diff --git a/src/sage/combinat/algebraic_combinatorics.py b/src/sage/combinat/algebraic_combinatorics.py index f0ff485a5a2..599913ffdb8 100644 --- a/src/sage/combinat/algebraic_combinatorics.py +++ b/src/sage/combinat/algebraic_combinatorics.py @@ -36,6 +36,7 @@ - :class:`~sage.algebras.affine_nil_temperley_lieb.AffineNilTemperleyLiebTypeA` - :ref:`sage.combinat.descent_algebra` - :ref:`sage.combinat.diagram_algebras` +- :ref:`sage.combinat.blob_algebra` Combinatorial Representation Theory ----------------------------------- diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py new file mode 100644 index 00000000000..8d719b29103 --- /dev/null +++ b/src/sage/combinat/blob_algebra.py @@ -0,0 +1,681 @@ +# -*- coding: utf-8 -*- +r""" +Blob Algebras + +AUTHORS: + +- Travis Scrimshaw (2020-05-16): Initial version +""" + +# **************************************************************************** +# Copyright (C) 2020 Travis Scrimshaw +# +# 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 sage.structure.parent import Parent +from sage.structure.unique_representation import UniqueRepresentation +from sage.structure.element import Element, get_coercion_model +from sage.structure.richcmp import richcmp +#from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass +from sage.misc.cachefunc import cached_method +from sage.misc.misc import powerset +from sage.functions.other import binomial +from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets +from sage.categories.algebras import Algebras +from sage.combinat.diagram_algebras import (TemperleyLiebDiagrams, diagram_latex, + TL_diagram_ascii_art) +from sage.combinat.free_module import CombinatorialFreeModule +from sage.combinat.dyck_word import DyckWords + +#@add_metaclass(InheritComparisonClasscallMetaclass) +class BlobDiagram(Element): + r""" + A blob diagram. + + A blob diagram consists of a perfect matching of the set + `\{1, \ldots, n\} \sqcup \{-1, \ldots, -n\}` such that the result + is a noncrossing matching (a :class:`Temperley-Lieb diagram + `), divided + into two sets of pairs: one for the pairs with blobs and one for + those without. The blobed pairs must either be either the leftmost + propagating strand or to the left of it and not nested. + """ + def __init__(self, parent, marked, unmarked): + r""" + Initialize ``self``. + + TESTS:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: TestSuite(B).run() + """ + Element.__init__(self, parent) + self.marked = tuple(sorted([tuple(sorted(pair)) for pair in marked])) + self.unmarked = tuple(sorted([tuple(sorted(pair)) for pair in unmarked])) + + def _repr_(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + ({{-3, 1}}, {{-4, 2}, {-2, -1}, {3, 4}}) + """ + return '({{{}}}, {{{}}})'.format(', '.join('{' + repr(X)[1:-1] + '}' + for X in self.marked), + ', '.join('{' + repr(X)[1:-1] + '}' + for X in self.unmarked)) + + def __hash__(self): + r""" + Return the hash of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: hash(B) in [hash(D) for D in BD4] + True + sage: len(set([hash(D) for D in BD4])) == len(BD4) + True + """ + return hash((self.marked, self.unmarked)) + + def _richcmp_(self, other, op): + r""" + Compare ``self`` to ``other`` with operation ``op``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: any(B == D for D in BD4) + True + sage: B2 = BD4([], [[1,-3], [2,-4], [3,4], [-1,-2]]) + sage: B == B2 + False + sage: B != B2 + True + sage: sorted(BlobDiagrams(3)) + [({}, {{-3, -2}, {-1, 1}, {2, 3}}), + ({}, {{-3, -2}, {-1, 3}, {1, 2}}), + ({}, {{-3, 1}, {-2, -1}, {2, 3}}), + ({}, {{-3, 3}, {-2, -1}, {1, 2}}), + ({}, {{-3, 3}, {-2, 2}, {-1, 1}}), + ({{-3, 1}}, {{-2, -1}, {2, 3}}), + ({{-3, 3}}, {{-2, -1}, {1, 2}}), + ({{-2, -1}}, {{-3, 1}, {2, 3}}), + ({{-2, -1}}, {{-3, 3}, {1, 2}}), + ({{-1, 1}}, {{-3, -2}, {2, 3}}), + ({{-1, 1}}, {{-3, 3}, {-2, 2}}), + ({{-1, 3}}, {{-3, -2}, {1, 2}}), + ({{1, 2}}, {{-3, -2}, {-1, 3}}), + ({{1, 2}}, {{-3, 3}, {-2, -1}}), + ({{-3, 1}, {-2, -1}}, {{2, 3}}), + ({{-3, 3}, {-2, -1}}, {{1, 2}}), + ({{-3, 3}, {1, 2}}, {{-2, -1}}), + ({{-2, -1}, {1, 2}}, {{-3, 3}}), + ({{-1, 3}, {1, 2}}, {{-3, -2}}), + ({{-3, 3}, {-2, -1}, {1, 2}}, {})] + """ + return richcmp((len(self.marked), self.marked, self.unmarked), + (len(other.marked), other.marked, other.unmarked), + op) + + def temperley_lieb_diagram(self): + r""" + Return the Temperley-Lieb diagram corresponding to ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: B.temperley_lieb_diagram() + {{-4, 2}, {-3, 1}, {-2, -1}, {3, 4}} + """ + return self.parent()._TL_diagrams(self.marked + self.unmarked) + +class BlobDiagrams(Parent, UniqueRepresentation): + r""" + The set of all blob diagrams. + """ + def __init__(self, n): + r""" + Initialize ``self``. + + TESTS:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: TestSuite(BD4).run() + """ + self._n = n + self._TL_diagrams = TemperleyLiebDiagrams(n) + Parent.__init__(self, category=FiniteEnumeratedSets()) + + def _repr_(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BlobDiagrams(4) + Blob diagrams of order 4 + """ + return "Blob diagrams of order {}".format(self._n) + + def cardinality(self): + r""" + Return the cardinality of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4.cardinality() + 70 + """ + return binomial(2*self._n, self._n) + + def order(self): + r""" + Return the order of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4.order() + 4 + """ + return self._n + + @cached_method + def base_set(self): + r""" + Return the base set of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: sorted(BD4.base_set()) + [-4, -3, -2, -1, 1, 2, 3, 4] + """ + return frozenset(range(1,self._n+1)).union(range(-self._n,0)) + + def _element_constructor_(self, marked, unmarked=None): + r""" + Construct an element of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4([[1,-3]], [[-1,-2], [2,3], [-4,4]]) + ({{-3, 1}}, {{-4, 4}, {-2, -1}, {2, 3}}) + sage: BD4([[(1,-3)], ([-1,-2], (2,3), [-4,4])]) + ({{-3, 1}}, {{-4, 4}, {-2, -1}, {2, 3}}) + """ + if unmarked is None: + marked, unmarked = marked + ret = self.element_class(self, marked, unmarked) + if ret not in self: + raise ValueError("not a blob diagram of order {}".format(self._n)) + return ret + + def __contains__(self, X): + r""" + Check if ``X`` is contained in ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4([[1,-3], [-1,-2]], [[2,-4], [3,4]]) # indirect doctest + ({{-3, 1}, {-2, -1}}, {{-4, 2}, {3, 4}}) + sage: BD4([[1,4], [-1,-2], [-3,-4]], [[2,3]]) # indirect doctest + ({{-4, -3}, {-2, -1}, {1, 4}}, {{2, 3}}) + + sage: BD4([[1,-2], [-1,-3]], [[2,-4], [3,4]]) # crossing strands + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,-4], [-1,-2]], [[2,-3], [3,4]]) # crossing strands + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,-2], [-1,-3]], [[3,-4], [2,4]]) # crossing strands + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,-3], [-1,-2], [3,4]], [[2,-4]]) # trapped blob cup + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[-1,3], [1,2], [-3,-4]], [[-2,4]]) # trapped blob cap + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,4], [-1,-2], [-3,-4], [2,3]], []) # nested blob cup + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[-1,-4], [1,2], [3,4], [-2,-3]], []) # nested blob cap + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[3,-3]], [[1,-1],[2,-2],[4,-4]]) # trapped propogating line + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + """ + if not isinstance(X, BlobDiagram): + return False + # Check that it is a Temperley-Lieb diagram + TL = X.marked + X.unmarked # the TL diagram + if TL not in self._TL_diagrams: + return False + # Check left escaping + for x, y in X.marked: + if x > 0: # Must be a cup + for P in TL: + if P[1] < 0: # P is a cap + continue + if P[1] < x: + if P[0] < 0: # A propogating line to the left + return False + else: # Note that P[1] != x + if 0 < P[0] < x: # A nesting line + return False + elif y < 0: # Must be a cap + for P in TL: + if P[0] > 0: # P is a cup + continue + if P[0] > y: + if P[1] > 0: # A propogating line to the left + return False + else: # Note that P[0] != y + if 0 > P[1] > y: # A nesting line + return False + else: # Must be a propogating line + if any(P[0] < 0 and P[1] > 0 and P[1] < y for P in TL): + return False + return True + + def __iter__(self): + r""" + Iterate over ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD3 = BlobDiagrams(3) + sage: for b in BD3: b + ({}, {{-3, 3}, {-2, -1}, {1, 2}}) + ({{1, 2}}, {{-3, 3}, {-2, -1}}) + ({{-2, -1}}, {{-3, 3}, {1, 2}}) + ({{-2, -1}, {1, 2}}, {{-3, 3}}) + ({{-3, 3}}, {{-2, -1}, {1, 2}}) + ({{-3, 3}, {1, 2}}, {{-2, -1}}) + ({{-3, 3}, {-2, -1}}, {{1, 2}}) + ({{-3, 3}, {-2, -1}, {1, 2}}, {}) + ({}, {{-3, -2}, {-1, 3}, {1, 2}}) + ({{1, 2}}, {{-3, -2}, {-1, 3}}) + ({{-1, 3}}, {{-3, -2}, {1, 2}}) + ({{-1, 3}, {1, 2}}, {{-3, -2}}) + ({}, {{-3, 1}, {-2, -1}, {2, 3}}) + ({{-3, 1}}, {{-2, -1}, {2, 3}}) + ({{-2, -1}}, {{-3, 1}, {2, 3}}) + ({{-3, 1}, {-2, -1}}, {{2, 3}}) + ({}, {{-3, -2}, {-1, 1}, {2, 3}}) + ({{-1, 1}}, {{-3, -2}, {2, 3}}) + ({}, {{-3, 3}, {-2, 2}, {-1, 1}}) + ({{-1, 1}}, {{-3, 3}, {-2, 2}}) + """ + for D in DyckWords(self._n): + markable = set() + unmarked = [] + unpaired = [] + # Determine the pairing and which pairings are markable + for i,d in enumerate(D): + if i >= self._n: + i = -2*self._n + i + else: + i += 1 + if d == 1: + unpaired.append(i) + else: # d == 0 + m = unpaired.pop() + if not unpaired: + markable.add((m, i)) + else: + unmarked.append((m, i)) + for X in powerset(markable): + yield self.element_class(self, X, unmarked + list(markable.difference(X))) + + Element = BlobDiagram + +class BlobAlgebra(CombinatorialFreeModule): + r""" + The blob algebra. + + The *blob algebra* (also known as the Temperley-Lieb algebra of type `B` + in [ILZ2018]_, but is a quotient of the Temperley-Lieb algebra of type `B` + defined in [Graham1985]_) is a diagram-type algebra introduced in + [MS1994]_ whose basis consists of :class:`Temperley-Lieb diagrams + `, noncrossing + perfect matchings, that may contain blobs on strands that can be + deformed so that the blob touches the left side (which we can think of + as a frozen pole). + + The form we give here has 3 parameters, the natural one from the + :class:`Temperley-Lieb algebra `, + one for the idempotent relation, and one for a loop with a blob. + + INPUT: + + - ``k`` -- the order + - ``q1`` -- the loop parameter + - ``q2`` -- the idempotent parameter + - ``q3`` -- the blob loop parameter + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B = list(B4.basis()) + sage: B[2] + B({{-4, -3}}, {{-2, -1}, {1, 2}, {3, 4}}) + sage: B[4] + B({{3, 4}}, {{-4, -3}, {-2, -1}, {1, 2}}) + sage: B[2] * B[4] + q*r*s*B({}, {{-4, -3}, {-2, -1}, {1, 2}, {3, 4}}) + + REFERENCES: + + - [MS1994]_ + - [ILZ2018]_ + """ + @staticmethod + def __classcall_private__(cls, k, q1, q2, q3, base_ring=None, prefix='B'): + r""" + Normalize input to ensure a unique representation. + + TESTS:: + + sage: R. = ZZ[] + sage: B3 = algebras.Blob(3, q, r, s) + sage: Bp = algebras.Blob(3, q, r, s, R, prefix='B') + sage: B3 is Bp + True + """ + if base_ring is None: + base_ring = get_coercion_model().common_parent(q1, q2, q3) + q1 = base_ring(q1) + q2 = base_ring(q2) + q3 = base_ring(q3) + return super(BlobAlgebra, cls).__classcall__(cls, k, q1, q2, q3, base_ring, prefix) + + def __init__(self, k, q1, q2, q3, base_ring, prefix): + r""" + Initialize ``self``. + + TESTS:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: TestSuite(B4).run() + + sage: B3 = algebras.Blob(3, q, r, s) + sage: B = list(B3.basis()) + sage: TestSuite(B3).run(elements=B) # long time + """ + self._q1 = q1 + self._q2 = q2 + self._q3 = q3 + diagrams = BlobDiagrams(k) + cat = Algebras(base_ring.category()).FiniteDimensional().WithBasis() + CombinatorialFreeModule.__init__(self, base_ring, diagrams, category=cat, + prefix=prefix, bracket=False) + + def _ascii_art_term(self, diagram): + r""" + Return an ascii art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B2 = algebras.Blob(2, q, r, s) + sage: x = B2.an_element() + sage: ascii_art(x) # indirect doctest + o o o o o o + 2* `-` + 3* `-` + 2* `0` + .-. .0. .-. + o o o o o o + """ + return TL_diagram_ascii_art(diagram.marked+diagram.unmarked, use_unicode=False, + blobs=diagram.marked) + + def _unicode_art_term(self, diagram): + r""" + Return a unicode art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B2 = algebras.Blob(2, q, r, s) + sage: x = B2.an_element() + sage: unicode_art(x) # indirect doctest + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + 2* ╰─╯ + 3* ╰─╯ + 2* ╰●╯ + ╭─╮ ╭●╮ ╭─╮ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + """ + return TL_diagram_ascii_art(diagram.marked+diagram.unmarked, use_unicode=True, + blobs=diagram.marked) + + def _latex_term(self, diagram): + r""" + Return a latex representation of ``diagram``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B2 = algebras.Blob(2, q, r, s) + sage: latex(B2.an_element()) # indirect doctest + 2\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \end{tikzpicture} + + 3\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \draw[blue,very thick] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. node[midway,circle,fill,scale=0.6] {} (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \end{tikzpicture} + + 2\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \draw[blue,very thick] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. node[midway,circle,fill,scale=0.6] {} (G-2); + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \end{tikzpicture} + """ + def edge_options(P): + if P[1] < P[0]: + P = [P[1], P[0]] + if tuple(P) in diagram.marked: + return 'blue,very thick' + return '' + def edge_additions(P): + if P[1] < P[0]: + P = [P[1], P[0]] + if tuple(P) in diagram.marked: + return 'node[midway,circle,fill,scale=0.6] {} ' + return '' + return diagram_latex(diagram.marked+diagram.unmarked, + edge_options=edge_options, + edge_additions=edge_additions) + + def order(self): + r""" + Return the order of ``self``. + + The order of a partition algebra is defined as half of the number + of nodes in the diagrams. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B4.order() + 4 + """ + return self._indices.order() + + @cached_method + def one_basis(self): + r""" + Return the index of the basis element `1`. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B4.one_basis() + ({}, {{-4, 4}, {-3, 3}, {-2, 2}, {-1, 1}}) + """ + B = self._indices + return B.element_class(B, [], [[i, -i] for i in range(1, self.order()+1)]) + + def product_on_basis(self, top, bot): + r""" + Return the product of the basis elements indexed by ``top`` + and ``bot``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B = B4.basis() + sage: BD = B.keys() + sage: BD[2] + ({{-4, -3}}, {{-2, -1}, {1, 2}, {3, 4}}) + sage: BD[4] + ({{3, 4}}, {{-4, -3}, {-2, -1}, {1, 2}}) + sage: B4.product_on_basis(BD[2], BD[4]) + q*r*s*B({}, {{-4, -3}, {-2, -1}, {1, 2}, {3, 4}}) + sage: all(len((x*y).support()) == 1 for x in B for y in B) + True + """ + ret_lists = [[], []] + coeff = self.base_ring().one() + top_marked = set(top.marked) + top_unmarked = set(top.unmarked) + bot_marked = set(bot.marked) + bot_unmarked = set(bot.unmarked) + + for top_set, is_unmarked in [(top_marked, 0), (top_unmarked, 1)]: + while top_set: + # We are starting a new strand + cur, stop = top_set.pop() # note that cur < stop + unmarked = is_unmarked + #print(top_set, unmarked, cur, stop) + if cur > 0: # Both are anchored to the top + ret_lists[unmarked].append((cur, stop)) + continue + anchored = bool(stop > 0) # Possibly only stop is anchored + + # Follow the path from cur until we either reach stop or + # we break out of the loop because both ends are anchored + while anchored or cur != stop: + #print(anchored, unmarked, cur, stop) + cur = -cur # Move cur to the bottom diagram + for X in bot_marked: + if cur in X: + if unmarked: + unmarked = 0 + else: + coeff *= self._q2 + prev = cur + cur = X[1-X.index(prev)] + bot_marked.remove(X) + break + for X in bot_unmarked: + if cur in X: + prev = cur + cur = X[1-X.index(prev)] + bot_unmarked.remove(X) + break + if cur < 0: # cur is anchored at the bottom + if anchored: + ret_lists[unmarked].append((stop, cur)) + break + else: + anchored = True + stop, cur = cur, stop # stop is now anchored to the bottom + continue + cur = -cur # bring cur back to the top diagram + for X in top_marked: + if cur in X: + if unmarked: + unmarked = 0 + else: + coeff *= self._q2 + prev = cur + cur = X[1-X.index(prev)] + top_marked.remove(X) + break + for X in top_unmarked: + if cur in X: + prev = cur + cur = X[1-X.index(prev)] + top_unmarked.remove(X) + break + if cur > 0: # cur is anchored at the top + if anchored: + ret_lists[unmarked].append((stop, cur)) + break + else: + anchored = True + stop, cur = cur, stop # stop is now anchored to the top + if cur == stop: # We have found a (marked) loop + if unmarked: + coeff *= self._q1 + else: + coeff *= self._q3 + # Everything remaining in the bottom sets are just anchored + # at the bottom, (i.e., are of the form {-i, -j}). + ret_lists[0].extend(bot_marked) + ret_lists[1].extend(bot_unmarked) + + if coeff == 0: + return self.zero() + diagram = self._indices.element_class(self._indices, ret_lists[0], ret_lists[1]) + return self._from_dict({diagram: coeff}, remove_zeros=False) + diff --git a/src/sage/combinat/core.py b/src/sage/combinat/core.py index a4e8370451a..3e699ee4295 100644 --- a/src/sage/combinat/core.py +++ b/src/sage/combinat/core.py @@ -32,7 +32,6 @@ from sage.combinat.partition import Partitions, Partition from sage.combinat.combinat import CombinatorialElement from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets -from sage.functions.other import floor from sage.combinat.combinatorial_map import combinatorial_map @@ -53,7 +52,7 @@ class Core(CombinatorialElement): @staticmethod def __classcall_private__(cls, part, k): r""" - Implements the shortcut ``Core(part, k)`` to ``Cores(k,l)(part)`` + Implement the shortcut ``Core(part, k)`` to ``Cores(k,l)(part)`` where `l` is the length of the core. TESTS:: @@ -74,7 +73,7 @@ def __classcall_private__(cls, part, k): return part part = Partition(part) if not part.is_core(k): - raise ValueError("%s is not a %s-core"%(part, k)) + raise ValueError("%s is not a %s-core" % (part, k)) l = sum(part.k_boundary(k).row_lengths()) return Cores(k, l)(part) @@ -100,11 +99,13 @@ def __init__(self, parent, core): k = parent.k part = Partition(core) if not part.is_core(k): - raise ValueError("%s is not a %s-core"%(part, k)) + raise ValueError("%s is not a %s-core" % (part, k)) CombinatorialElement.__init__(self, parent, core) def __eq__(self, other): """ + Test for equality. + EXAMPLES:: sage: c = Core([4,2,1,1],5) @@ -118,14 +119,33 @@ def __eq__(self, other): False """ if isinstance(other, Core): - return self._list == other._list and self.parent().k == other.parent().k - else: - return False + return (self._list == other._list and + self.parent().k == other.parent().k) + return False + + def __ne__(self, other): + """ + Test for un-equality. + + EXAMPLES:: + + sage: c = Core([4,2,1,1],5) + sage: d = Core([4,2,1,1],5) + sage: e = Core([4,2,1,1],6) + sage: c != [4,2,1,1] + True + sage: c != d + False + sage: c != e + True + """ + return not (self == other) def __hash__(self): """ - Computes the hash of ``self`` by computing the hash of the + Compute the hash of ``self`` by computing the hash of the underlying list and of the additional parameter. + The hash is cached and stored in ``self._hash``. EXAMPLES:: @@ -170,7 +190,7 @@ def _latex_(self): def k(self): r""" - Returns `k` of the `k`-core ``self``. + Return `k` of the `k`-core ``self``. EXAMPLES:: @@ -183,7 +203,7 @@ def k(self): @combinatorial_map(name="to partition") def to_partition(self): r""" - Turns the core ``self`` into the partition identical to ``self``. + Turn the core ``self`` into the partition identical to ``self``. EXAMPLES:: @@ -198,7 +218,7 @@ def to_bounded_partition(self): r""" Bijection between `k`-cores and `(k-1)`-bounded partitions. - Maps the `k`-core ``self`` to the corresponding `(k-1)`-bounded partition. + This maps the `k`-core ``self`` to the corresponding `(k-1)`-bounded partition. This bijection is achieved by deleting all cells in ``self`` of hook length greater than `k`. @@ -213,7 +233,7 @@ def to_bounded_partition(self): def size(self): r""" - Returns the size of ``self`` as a partition. + Return the size of ``self`` as a partition. EXAMPLES:: @@ -226,7 +246,7 @@ def size(self): def length(self): r""" - Returns the length of ``self``. + Return the length of ``self``. The length of a `k`-core is the size of the corresponding `(k-1)`-bounded partition which agrees with the length of the corresponding Grassmannian element, @@ -270,11 +290,12 @@ def to_grassmannian(self): [0 1 0] [0 0 1] """ - return self.to_bounded_partition().from_kbounded_to_grassmannian(self.k()-1) + bp = self.to_bounded_partition() + return bp.from_kbounded_to_grassmannian(self.k() - 1) def affine_symmetric_group_simple_action(self, i): r""" - Returns the action of the simple transposition `s_i` of the affine symmetric group on ``self``. + Return the action of the simple transposition `s_i` of the affine symmetric group on ``self``. This gives the action of the affine symmetric group of type `A_k^{(1)}` on the `k`-core ``self``. If ``self`` has outside (resp. inside) corners of content `i` modulo `k`, then @@ -304,11 +325,13 @@ def affine_symmetric_group_simple_action(self, i): """ mu = self.to_partition() corners = mu.outside_corners() - corners = [ p for p in corners if mu.content(p[0],p[1])%self.k()==i ] - if corners == []: + corners = [p for p in corners + if mu.content(p[0], p[1]) % self.k() == i] + if not corners: corners = mu.corners() - corners = [ p for p in corners if mu.content(p[0],p[1])%self.k()==i ] - if corners == []: + corners = [p for p in corners + if mu.content(p[0], p[1]) % self.k() == i] + if not corners: return self for p in corners: mu = mu.remove_cell(p[0]) @@ -317,7 +340,7 @@ def affine_symmetric_group_simple_action(self, i): mu = mu.add_cell(p[0]) return Core(mu, self.k()) - def affine_symmetric_group_action(self, w, transposition = False): + def affine_symmetric_group_action(self, w, transposition=False): r""" Return the (left) action of the affine symmetric group on ``self``. @@ -384,13 +407,15 @@ def _transposition_to_reduced_word(self, t): [1, 2, 0, 1, 2, 0, 2, 1, 0, 2, 1] """ k = self.k() - if (t[0]-t[1])%k == 0: + if (t[0] - t[1]) % k == 0: raise ValueError("t_0 and t_1 cannot be equal mod k") if t[0] > t[1]: - return self._transposition_to_reduced_word([t[1],t[0]]) + return self._transposition_to_reduced_word([t[1], t[0]]) else: - return [i%k for i in range(t[0],t[1]-floor((t[1]-t[0])/k))] + [(t[1]-floor((t[1]-t[0])/k)-2-i)%(k) for i in - range(t[1]-floor((t[1]-t[0])/k)-t[0]-1)] + resu = [i % k for i in range(t[0], t[1] - (t[1] - t[0]) // k)] + resu += [(t[1] - (t[1] - t[0]) // k - 2 - i) % k + for i in range(t[1] - (t[1] - t[0]) // k - t[0] - 1)] + return resu def weak_le(self, other): r""" @@ -402,7 +427,7 @@ def weak_le(self, other): OUTPUT: a boolean - Returns whether ``self`` <= ``other`` in weak order. + This returns whether ``self`` <= ``other`` in weak order. EXAMPLES:: @@ -434,7 +459,7 @@ def weak_le(self, other): def weak_covers(self): r""" - Returns a list of all elements that cover ``self`` in weak order. + Return a list of all elements that cover ``self`` in weak order. EXAMPLES:: @@ -448,8 +473,8 @@ def weak_covers(self): """ w = self.to_grassmannian() S = w.upper_covers(side='left') - S = [x for x in S if x.is_affine_grassmannian()] - return [ x.affine_grassmannian_to_core() for x in set(S) ] + S = (x for x in S if x.is_affine_grassmannian()) + return [x.affine_grassmannian_to_core() for x in set(S)] def strong_le(self, other): r""" @@ -461,7 +486,7 @@ def strong_le(self, other): OUTPUT: a boolean - Returns whether ``self`` <= ``other`` in Bruhat (or strong) order. + This returns whether ``self`` <= ``other`` in Bruhat (or strong) order. EXAMPLES:: @@ -479,7 +504,7 @@ def strong_le(self, other): ValueError: The two cores do not have the same k """ if type(self) is type(other): - if self.k()!=other.k(): + if self.k() != other.k(): raise ValueError("The two cores do not have the same k") else: other = Core(other, self.k()) @@ -495,8 +520,8 @@ def contains(self, other): OUTPUT: a boolean - Returns ``True`` if the Ferrers diagram of ``self`` contains the - Ferrers diagram of other. + This returns ``True`` if the Ferrers diagram of ``self`` contains the + Ferrers diagram of ``other``. EXAMPLES:: @@ -513,7 +538,7 @@ def contains(self, other): def strong_covers(self): r""" - Returns a list of all elements that cover ``self`` in strong order. + Return a list of all elements that cover ``self`` in strong order. EXAMPLES:: @@ -524,12 +549,12 @@ def strong_covers(self): sage: c.strong_covers() [[5, 3, 1], [4, 2, 1, 1]] """ - S = Cores(self.k(), length=self.length()+1) - return [ ga for ga in S if ga.contains(self) ] + S = Cores(self.k(), length=self.length() + 1) + return [ga for ga in S if ga.contains(self)] def strong_down_list(self): r""" - Returns a list of all elements that are covered by ``self`` in strong order. + Return a list of all elements that are covered by ``self`` in strong order. EXAMPLES:: @@ -540,11 +565,13 @@ def strong_down_list(self): sage: c.strong_down_list() [[4, 2], [3, 1, 1]] """ - if self==[]: + if not self: return [] - return [ga for ga in Cores(self.k(), length=self.length()-1) if self.contains(ga)] + return [ga for ga in Cores(self.k(), length=self.length() - 1) + if self.contains(ga)] + -def Cores(k, length = None, **kwargs): +def Cores(k, length=None, **kwargs): r""" A `k`-core is a partition from which no rim hook of size `k` can be removed. Alternatively, a `k`-core is an integer partition such that the Ferrers @@ -586,12 +613,13 @@ def Cores(k, length = None, **kwargs): [4, 1, 1] """ if length is None and 'size' in kwargs: - return Cores_size(k,kwargs['size']) + return Cores_size(k, kwargs['size']) elif length is not None: - return Cores_length(k,length) + return Cores_length(k, length) else: raise ValueError("You need to either specify the length or size of the cores considered!") + class Cores_length(UniqueRepresentation, Parent): r""" The class of `k`-cores of length `n`. @@ -607,7 +635,7 @@ def __init__(self, k, n): """ self.k = k self.n = n - Parent.__init__(self, category = FiniteEnumeratedSets()) + Parent.__init__(self, category=FiniteEnumeratedSets()) def _repr_(self): """ @@ -616,11 +644,11 @@ def _repr_(self): sage: repr(Cores(4, 3)) #indirect doctest '4-Cores of length 3' """ - return "%s-Cores of length %s"%(self.k,self.n) + return "%s-Cores of length %s" % (self.k, self.n) def list(self): r""" - Returns the list of all `k`-cores of length `n`. + Return the list of all `k`-cores of length `n`. EXAMPLES:: @@ -628,7 +656,8 @@ def list(self): sage: C.list() [[4, 2], [3, 1, 1], [2, 2, 1, 1]] """ - return [la.to_core(self.k-1) for la in Partitions(self.n, max_part=self.k-1)] + return [la.to_core(self.k - 1) + for la in Partitions(self.n, max_part=self.k - 1)] def from_partition(self, part): r""" @@ -671,7 +700,7 @@ def __init__(self, k, n): """ self.k = k self.n = n - Parent.__init__(self, category = FiniteEnumeratedSets()) + Parent.__init__(self, category=FiniteEnumeratedSets()) def _repr_(self): """ @@ -680,11 +709,11 @@ def _repr_(self): sage: repr(Cores(4, size = 3)) #indirect doctest '4-Cores of size 3' """ - return "%s-Cores of size %s"%(self.k,self.n) + return "%s-Cores of size %s" % (self.k, self.n) def list(self): r""" - Returns the list of all `k`-cores of size `n`. + Return the list of all `k`-cores of size `n`. EXAMPLES:: @@ -692,11 +721,12 @@ def list(self): sage: C.list() [[3, 1], [2, 1, 1]] """ - return [ Core(x, self.k) for x in Partitions(self.n) if x.is_core(self.k) ] + return [Core(x, self.k) for x in Partitions(self.n) + if x.is_core(self.k)] def from_partition(self, part): r""" - Converts the partition ``part`` into a core (as the identity map). + Convert the partition ``part`` into a core (as the identity map). This is the inverse method to :meth:`to_partition`. diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index 9e1591fb61a..9e025ffa313 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- r""" Diagram and Partition Algebras @@ -245,7 +246,7 @@ class AbstractPartitionDiagram(AbstractSetPartition): ... ValueError: {{1, 2}, {3, 4}} does not represent two rows of vertices of order 2 """ - def __init__(self, parent, d): + def __init__(self, parent, d, check=True): r""" Initialize ``self``. @@ -256,7 +257,7 @@ def __init__(self, parent, d): sage: pd1 = da.AbstractPartitionDiagram(pd, ((-2,-1),(1,2)) ) """ self._base_diagram = tuple(sorted(tuple(sorted(i)) for i in d)) - super(AbstractPartitionDiagram, self).__init__(parent, self._base_diagram) + super(AbstractPartitionDiagram, self).__init__(parent, self._base_diagram, check=check) def check(self): r""" @@ -401,7 +402,7 @@ def set_partition(self): """ return SetPartitions()(self) - def compose(self, other): + def compose(self, other, check=True): r""" Compose ``self`` with ``other``. @@ -426,7 +427,7 @@ def compose(self, other): ({{-2, -1}, {1, 2}}, 1) """ (composite_diagram, loops_removed) = set_partition_composition(self._base_diagram, other._base_diagram) - return (self.__class__(self.parent(), composite_diagram), loops_removed) + return (self.__class__(self.parent(), composite_diagram, check=check), loops_removed) def propagating_number(self): r""" @@ -1215,7 +1216,7 @@ def __iter__(self): # treat it like an attribute, so we call the underlying # __func__. for i in self._diagram_func.__func__(self.order): - yield self.element_class(self, i) + yield self.element_class(self, i, check=False) def __contains__(self, obj): r""" @@ -1997,8 +1998,8 @@ def _latex_term(self, diagram): \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; - \draw (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); - \draw (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); \end{tikzpicture} sage: latex(P.orbit_basis()([[1,2],[-2,-1]])) # indirect doctest @@ -2008,73 +2009,11 @@ def _latex_term(self, diagram): \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw, fill] {}; \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw, fill] {}; \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw, fill] {}; - \draw (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); - \draw (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); \end{tikzpicture} - """ - # these allow the view command to work (maybe move them - # somewhere more appropriate?) - from sage.misc.latex import latex - latex.add_to_mathjax_avoid_list('tikzpicture') - latex.add_package_to_preamble_if_available('tikz') - if hasattr(self, '_fill'): - filled_str = ", fill" - else: - filled_str = "" - - def sgn(x): - # Define the sign function - if x > 0: - return 1 - if x < 0: - return -1 - return 0 - l1 = [] # list of blocks - l2 = [] # list of nodes - for i in list(diagram): - l1.append(list(i)) - for j in list(i): - l2.append(j) - output = "\\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] \n\\tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] \n" #setup beginning of picture - for i in l2: #add nodes - output = output + "\\node[vertex] (G-{}) at ({}, {}) [shape = circle, draw{}] {{}}; \n".format(i, (abs(i)-1)*1.5, sgn(i), filled_str) - for i in l1: #add edges - if len(i) > 1: - l4 = list(i) - posList = [] - negList = [] - for j in l4: # sort list so rows are grouped together - if j > 0: - posList.append(j) - elif j < 0: - negList.append(j) - posList.sort() - negList.sort() - l4 = posList + negList - l5 = l4[:] #deep copy - for j in range(len(l5)): - l5[j-1] = l4[j] #create a permuted list - if len(l4) == 2: - l4.pop() - l5.pop() #pops to prevent duplicating edges - for j in zip(l4, l5): - xdiff = abs(j[1])-abs(j[0]) - y1 = sgn(j[0]) - y2 = sgn(j[1]) - if y2-y1 == 0 and abs(xdiff) < 5: #if nodes are close to each other on same row - diffCo = (0.5+0.1*(abs(xdiff)-1)) #gets bigger as nodes are farther apart; max value of 1; min value of 0.5. - outVec = (sgn(xdiff)*diffCo, -1*diffCo*y1) - inVec = (-1*diffCo*sgn(xdiff), -1*diffCo*y2) - elif y2-y1 != 0 and abs(xdiff) == 1: #if nodes are close enough curviness looks bad. - outVec = (sgn(xdiff)*0.75, -1*y1) - inVec = (-1*sgn(xdiff)*0.75, -1*y2) - else: - outVec = (sgn(xdiff)*1, -1*y1) - inVec = (-1*sgn(xdiff), -1*y2) - output = output + "\\draw (G-{}) .. controls +{} and +{} .. (G-{}); \n".format(j[0], outVec, inVec, j[1]) - output = output + "\\end{tikzpicture} \n" #end picture - return output + return diagram_latex(diagram, fill=hasattr(self, '_fill')) # The following subclass provides a few additional methods for # (sub)partition algebra elements. @@ -2164,7 +2103,7 @@ def product_on_basis(self, d1, d2): d1 = self._indices(d1) if not self._indices.is_parent_of(d2): d2 = self._indices(d2) - (composite_diagram, loops_removed) = d1.compose(d2) + (composite_diagram, loops_removed) = d1.compose(d2, check=False) return self.term(composite_diagram, self._q**loops_removed) class PartitionAlgebra(DiagramBasis, UnitDiagramMixin): @@ -3087,7 +3026,7 @@ def matchings(A, B): for sigma in Permutations(Y): yield [x.union(y) for x, y in zip(X, sigma)] + restA + restB - D, removed = d1.compose(d2) + D, removed = d1.compose(d2, check=False) only_top = set([frozenset(part) for part in d1 if all(i > 0 for i in part)]) only_bottom = set([frozenset(part) for part in d2 @@ -3543,6 +3482,41 @@ def _element_constructor_(self, set_partition): set_partition = to_Brauer_partition(set_partition, k=self.order()) return SubPartitionAlgebra._element_constructor_(self, set_partition) + def _ascii_art_term(self, diagram): + r""" + Return an ascii art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = QQ[] + sage: TL = TemperleyLiebAlgebra(4, q, R) + sage: x = TL.an_element() + sage: ascii_art(x) # indirect doctest + o o o o o o o o + o o o o | `-` | | `-` | + 2* `-` `-` + 2* `-----` + 3* `---. | + .-. .-. .-. .-. .-. | | + o o o o o o o o o o o o + """ + return TL_diagram_ascii_art(diagram, use_unicode=False) + + def _unicode_art_term(self, diagram): + r""" + Return a unicode art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = QQ[] + sage: TL = TemperleyLiebAlgebra(4, q, R) + sage: x = TL.an_element() + sage: unicode_art(x) # indirect doctest + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + ⚬ ⚬ ⚬ ⚬ │ ╰─╯ │ │ ╰─╯ │ + 2* ╰─╯ ╰─╯ + 2* ╰─────╯ + 3* ╰───╮ │ + ╭─╮ ╭─╮ ╭─╮ ╭─╮ ╭─╮ │ │ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + """ + return TL_diagram_ascii_art(diagram, use_unicode=True) class PlanarAlgebra(SubPartitionAlgebra, UnitDiagramMixin): r""" @@ -3766,6 +3740,290 @@ def __pow__(self, n): raise ValueError("can only take positive integer powers") return generic_power(self, n) +def TL_diagram_ascii_art(diagram, use_unicode=False, blobs=[]): + r""" + Return ascii art for a Temperley-Lieb diagram ``diagram``. + + INPUT: + + - ``diagram`` -- a list of pairs of matchings of the set + `\{-1, \ldots, -n, 1, \ldots, n\}` + - ``use_unicode`` -- (default: ``False``): whether or not + to use unicode art instead of ascii art + - ``blobs`` -- (optional) a list of matchings with blobs on them + + EXAMPLES:: + + sage: from sage.combinat.diagram_algebras import TL_diagram_ascii_art + sage: TL = [(-15,-12), (-14,-13), (-11,15), (-10,14), (-9,-6), + ....: (-8,-7), (-5,-4), (-3,1), (-2,-1), (2,3), (4,5), + ....: (6,11), (7, 8), (9,10), (12,13)] + sage: TL_diagram_ascii_art(TL, use_unicode=False) + o o o o o o o o o o o o o o o + | `-` `-` | `-` `-` | `-` | | + | `---------` | | + | .-------` | + `---. | .-------` + | .-----. | | .-----. + .-. | .-. | .-. | | | | .-. | + o o o o o o o o o o o o o o o + sage: TL_diagram_ascii_art(TL, use_unicode=True) + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + │ ╰─╯ ╰─╯ │ ╰─╯ ╰─╯ │ ╰─╯ │ │ + │ ╰─────────╯ │ │ + │ ╭───────╯ │ + ╰───╮ │ ╭───────╯ + │ ╭─────╮ │ │ ╭─────╮ + ╭─╮ │ ╭─╮ │ ╭─╮ │ │ │ │ ╭─╮ │ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + + sage: TL = [(-20,-9), (-19,-10), (-18,-11), (-17,-16), (-15,-12), (2,3), + ....: (-14,-13), (-8,16), (-7,7), (-6,6), (-5,1), (-4,-3), (-2,-1), + ....: (4,5), (8,15), (9,10), (11,14), (12,13), (17,20), (18,19)] + sage: TL_diagram_ascii_art(TL, use_unicode=False, blobs=[(-2,-1), (-5,1)]) + o o o o o o o o o o o o o o o o o o o o + | `-` `-` | | | `-` | `-` | | | | `-` | + | | | | `-----` | | `-----` + | | | `-------------` | + `---0---. | | .---------------` + | | | | .---------------------. + | | | | | .-----------------. | + | | | | | | .-------------. | | + | | | | | | | .-----. | | | + .0. .-. | | | | | | | | .-. | .-. | | | + o o o o o o o o o o o o o o o o o o o o + sage: TL_diagram_ascii_art(TL, use_unicode=True, blobs=[(-2,-1), (-5,1)]) + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + │ ╰─╯ ╰─╯ │ │ │ ╰─╯ │ ╰─╯ │ │ │ │ ╰─╯ │ + │ │ │ │ ╰─────╯ │ │ ╰─────╯ + │ │ │ ╰─────────────╯ │ + ╰───●───╮ │ │ ╭───────────────╯ + │ │ │ │ ╭─────────────────────╮ + │ │ │ │ │ ╭─────────────────╮ │ + │ │ │ │ │ │ ╭─────────────╮ │ │ + │ │ │ │ │ │ │ ╭─────╮ │ │ │ + ╭●╮ ╭─╮ │ │ │ │ │ │ │ │ ╭─╮ │ ╭─╮ │ │ │ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + """ + def insert_pairing(cur, intervals): + """ + Helper function to insert a possibly nested interval + and push the others up, assuming inserting points from + right-to-left. + """ + for level in intervals: + for j, I in enumerate(level): + # Singleton intervals are vertical lines, + # so we don't need to worry about them + if len(I) > 1 and I[0] < cur[0]: + cur, level[j] = level[j], cur + level.append([cur[0]]) + level.append([cur[1]]) + break + else: + level.append(cur) + return # We have stopped + else: + intervals.append([cur]) + # Build a set of intervals that defines where to draw the diagram + intervals = [[]] + propogating = [] + vertical = [] + top_intervals = [[]] + num_left = 0 + num_right = 0 + def key_func(P): + if P[1] < 0: # cap + return (0, P[0], P[1]) + elif P[0] > 0: # cup + return (3, -P[1], -P[0]) + else: + bot, top = -P[0], P[1] + if top < bot: # left moving + return (1, top, bot) + elif top > bot: # right moving + return (2, -bot, -top) + else: # vertical line + return (1, top, bot) + diagram = sorted(diagram, key=key_func) + # Since diagram is sorted in lex order, we will first do the matchings + # from right-to-left on the bottom, then the propogating lines, and + # then the matchings on the top from right-to-left. + # Note that we need the top to go from right-to-left so the + # insert_pairing() function's assumptions are satisfied. + for P in diagram: + if P[1] < 0: # Bottom matching + insert_pairing([-P[1], -P[0], False, False], intervals) + elif P[0] > 0: # Top matching + insert_pairing([P[0], P[1], True, True], top_intervals) + else: # Propogating line + if -P[0] == P[1]: + vertical.append(P[1]) + else: + if -P[0] < P[1]: + num_right += 1 + else: + num_left += 1 + propogating.append(P) + + # Now piece together the intervals together + total_prop = max(num_left, num_right) + prop_intervals = [[] for _ in range(total_prop)] + count_left = 0 + # Recall that the left-moving propogating lines come before the right-moving + for i, P in enumerate(propogating): + bot, top = P + bot = -bot # This makes it equal to its x-coordinate + for level in intervals: + level.append([bot]) + for level in top_intervals: + level.append([top]) + left_moving = count_left < num_left + if not left_moving: + i -= num_left + else: + count_left += 1 + for j in range(i): + prop_intervals[j].append([bot]) + for j in range(i+1,total_prop): + prop_intervals[j].append([top]) + if not left_moving: + top, bot = bot, top + prop_intervals[i].append([top, bot, left_moving, not left_moving]) + intervals += prop_intervals + intervals += reversed(top_intervals) + for level in intervals: + level.extend([i] for i in vertical) + + n = max(max(P) for P in diagram) + + # Finally, convert to a picture + if use_unicode: + from sage.typeset.unicode_art import UnicodeArt + d = ["╭", "╮", "╰", "╯", "─", "│"] + #db = ["┏", "┓", "┗", "┛", "━", "┃"] + blob = '●' + ret = [" ⚬" * n] + char_art = UnicodeArt + else: + from sage.typeset.ascii_art import AsciiArt + d = [".", ".", "`", "`", "-", "|"] + #db = [".", ".", "`", "`", "=", "|"] + blob = '0' + ret = [" o" * n] + char_art = AsciiArt + def signed(val, pos): + return val if pos else -val + for level in reversed(intervals): + cur = "" + for I in sorted(level): + cur += ' '*(2*I[0]-1 - len(cur)) + if len(I) == 1: + cur += d[5] + ' ' + else: + cur += d[2] if I[2] else d[0] + if tuple(sorted([signed(I[0], I[2]), signed(I[1], I[3])])) in blobs: + cur += d[4] * (I[1]-I[0]-1) + cur += blob + cur += d[4] * (I[1]-I[0]-1) + else: + cur += d[4] * (2*(I[1]-I[0])-1) + cur += d[3] if I[3] else d[1] + ret.append(cur) + # Note that the top row and bottom row will be the same + ret.append(ret[0]) + return char_art(ret, baseline=len(ret)//2) + +def diagram_latex(diagram, fill=False, edge_options=None, edge_additions=None): + r""" + Return latex code for the diagram ``diagram`` using tikz. + + EXAMPLES:: + + sage: from sage.combinat.diagram_algebras import PartitionDiagrams, diagram_latex + sage: P = PartitionDiagrams(2) + sage: D = P([[1,2],[-2,-1]]) + sage: print(diagram_latex(D)) # indirect doctest + \begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \end{tikzpicture} + """ + # these allow the view command to work (maybe move them + # somewhere more appropriate?) + from sage.misc.latex import latex + latex.add_to_mathjax_avoid_list('tikzpicture') + latex.add_package_to_preamble_if_available('tikz') + + if fill: + filled_str = ", fill" + else: + filled_str = "" + + if edge_options is None: + edge_options = lambda P: '' + if edge_additions is None: + edge_additions = lambda P: '' + + def sgn(x): + # Define the sign function + if x > 0: + return 1 + if x < 0: + return -1 + return 0 + l1 = [] # list of blocks + l2 = [] # list of nodes + for i in list(diagram): + l1.append(list(i)) + for j in list(i): + l2.append(j) + output = "\\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] \n\\tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] \n" #setup beginning of picture + for i in l2: #add nodes + output = output + "\\node[vertex] (G-{}) at ({}, {}) [shape = circle, draw{}] {{}}; \n".format(i, (abs(i)-1)*1.5, sgn(i), filled_str) + for i in l1: #add edges + if len(i) > 1: + l4 = list(i) + posList = [] + negList = [] + for j in l4: # sort list so rows are grouped together + if j > 0: + posList.append(j) + elif j < 0: + negList.append(j) + posList.sort() + negList.sort() + l4 = posList + negList + l5 = l4[:] #deep copy + for j in range(len(l5)): + l5[j-1] = l4[j] #create a permuted list + if len(l4) == 2: + l4.pop() + l5.pop() #pops to prevent duplicating edges + for j in zip(l4, l5): + xdiff = abs(j[1])-abs(j[0]) + y1 = sgn(j[0]) + y2 = sgn(j[1]) + if y2-y1 == 0 and abs(xdiff) < 5: #if nodes are close to each other on same row + diffCo = (0.5+0.1*(abs(xdiff)-1)) #gets bigger as nodes are farther apart; max value of 1; min value of 0.5. + outVec = (sgn(xdiff)*diffCo, -1*diffCo*y1) + inVec = (-1*diffCo*sgn(xdiff), -1*diffCo*y2) + elif y2-y1 != 0 and abs(xdiff) == 1: #if nodes are close enough curviness looks bad. + outVec = (sgn(xdiff)*0.75, -1*y1) + inVec = (-1*sgn(xdiff)*0.75, -1*y2) + else: + outVec = (sgn(xdiff)*1, -1*y1) + inVec = (-1*sgn(xdiff), -1*y2) + output = output + "\\draw[{}] (G-{}) .. controls +{} and +{} .. {}(G-{}); \n".format( + edge_options(j), j[0], outVec, inVec, edge_additions(j), j[1]) + output = output + "\\end{tikzpicture}" #end picture + return output + ######################################################################### # START BORROWED CODE ######################################################################### diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index a5d5421b070..369f8abf039 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -945,6 +945,7 @@ from sage.misc.misc import verbose from sage.misc.sageinspect import sage_getargspec from sage.rings.qqbar import QQbar +from sage.rings.integer_ring import ZZ from sage.rings.real_mpfr import RR from sage.structure.sage_object import SageObject @@ -1061,13 +1062,13 @@ def equal(iterator): return True -def startswith(list, prefix): +def startswith(list_, prefix): """ Determine whether list starts with the given prefix. INPUT: - - ``list`` -- list + - ``list_`` -- list - ``prefix`` -- list representing the prefix OUTPUT: @@ -1086,10 +1087,11 @@ def startswith(list, prefix): sage: startswith([1, 3, 2], [1, 2]) False """ + if len(prefix) > len(list_): + return False + return list_[:len(prefix)] == prefix - return list[:len(prefix)] == prefix - -#***************************************************************************** +# **************************************************************************** FSMEmptyWordSymbol = '-' @@ -1103,7 +1105,7 @@ def startswith(list, prefix): def FSMLetterSymbol(letter): """ - Returns a string associated to the input letter. + Return a string associated to the input letter. INPUT: @@ -1129,7 +1131,7 @@ def FSMLetterSymbol(letter): def FSMWordSymbol(word): """ - Returns a string of ``word``. It may returns the symbol of the + Return a string of ``word``. It may returns the symbol of the empty word ``FSMEmptyWordSymbol``. INPUT: @@ -1148,15 +1150,12 @@ def FSMWordSymbol(word): """ if not isinstance(word, list): return FSMLetterSymbol(word) - if len(word) == 0: + if not word: return FSMEmptyWordSymbol - s = '' - for letter in word: - s += (',' if len(s) > 0 else '') + FSMLetterSymbol(letter) - return s + return ','.join(FSMLetterSymbol(letter) for letter in word) -#***************************************************************************** +# **************************************************************************** def is_FSMState(S): @@ -1219,7 +1218,7 @@ class FSMState(SageObject): OUTPUT: - Returns a state of a finite state machine. + A state of a finite state machine. EXAMPLES:: @@ -1428,8 +1427,7 @@ def __init__(self, label, word_out=None, def __lt__(self, other): """ - Returns True if label of ``self`` is less than label of - ``other``. + Return ``True`` if label of ``self`` is less than label of ``other``. INPUT: @@ -1437,7 +1435,7 @@ def __lt__(self, other): OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -1447,7 +1445,6 @@ def __lt__(self, other): """ return self.label() < other.label() - @property def final_word_out(self): """ @@ -1640,10 +1637,9 @@ def is_final(self, is_final): "can have a final output word. " % (self.label(),)) - def label(self): """ - Returns the label of the state. + Return the label of the state. INPUT: @@ -1662,10 +1658,9 @@ def label(self): """ return self._label_ - def __copy__(self): """ - Returns a (shallow) copy of the state. + Return a (shallow) copy of the state. INPUT: @@ -1709,13 +1704,11 @@ def __copy__(self): new.hook = self.hook return new - copy = __copy__ - def __deepcopy__(self, memo): """ - Returns a deep copy of the state. + Return a deep copy of the state. INPUT: @@ -1745,10 +1738,9 @@ def __deepcopy__(self, memo): new.initial_probability = deepcopy(self.initial_probability, memo) return new - def deepcopy(self, memo=None): """ - Returns a deep copy of the state. + Return a deep copy of the state. INPUT: @@ -1793,7 +1785,7 @@ def deepcopy(self, memo=None): def relabeled(self, label, memo=None): """ - Returns a deep copy of the state with a new label. + Return a deep copy of the state with a new label. INPUT: @@ -1867,11 +1859,7 @@ def __getstate__(self): def __hash__(self): """ - Returns a hash value for the object. - - INPUT: - - Nothing. + Return a hash value for the object. OUTPUT: @@ -1907,20 +1895,20 @@ def _repr_(self): """ return pretty(self.label()) - def __eq__(left, right): + def __eq__(self, other): """ - Returns True if two states are the same, i.e., if they have + Return ``True`` if two states are the same, i.e., if they have the same labels. INPUT: - - ``left`` -- a state. + - ``self`` -- a state. - - ``right`` -- a state. + - ``other`` -- a state. OUTPUT: - True or False. + ``True`` or ``False``. Note that the hooks and whether the states are initial or final are not checked. To fully compare two states (including @@ -1940,24 +1928,23 @@ def __eq__(left, right): sage: A == B True """ - if not is_FSMState(right): + if not is_FSMState(other): return False - return left.label() == right.label() - + return self.label() == other.label() - def __ne__(left, right): + def __ne__(self, other): """ Tests for inequality, complement of __eq__. INPUT: - - ``left`` -- a state. + - ``self`` -- a state. - - ``right`` -- a state. + - ``other`` -- a state. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -1967,19 +1954,18 @@ def __ne__(left, right): sage: A != B False """ - return (not (left == right)) + return not (self == other) - - def fully_equal(left, right, compare_color=True): + def fully_equal(self, other, compare_color=True): """ - Checks whether two states are fully equal, i.e., including all + Check whether two states are fully equal, i.e., including all attributes except ``hook``. INPUT: - - ``left`` -- a state. + - ``self`` -- a state. - - ``right`` -- a state. + - ``other`` -- a state. - ``compare_color`` -- If ``True`` (default) colors are compared as well, otherwise not. @@ -2005,27 +1991,18 @@ def fully_equal(left, right, compare_color=True): sage: A.fully_equal(B, compare_color=False) True """ - color = not compare_color or left.color == right.color - return (left == right and - left.is_initial == right.is_initial and - left.is_final == right.is_final and - left.final_word_out == right.final_word_out and - left.word_out == right.word_out and + color = not compare_color or self.color == other.color + return (self == other and + self.is_initial == other.is_initial and + self.is_final == other.is_final and + self.final_word_out == other.final_word_out and + self.word_out == other.word_out and color and - left.initial_probability == right.initial_probability) - + self.initial_probability == other.initial_probability) def __bool__(self): """ - Returns True. - - INPUT: - - Nothing. - - OUTPUT: - - True or False. + Return ``True``. TESTS:: @@ -2035,13 +2012,11 @@ def __bool__(self): """ return True # A state cannot be zero (see __init__) - __nonzero__ = __bool__ - def _epsilon_successors_(self, fsm=None): """ - Returns the dictionary with states reachable from ``self`` + Return the dictionary with states reachable from ``self`` without reading anything from an input tape as keys. The values are lists of outputs. @@ -2107,10 +2082,9 @@ def _epsilon_successors_(self, fsm=None): itertools.groupby(sorted(outputs))] return _epsilon_successors_dict_ - def _in_epsilon_cycle_(self, fsm=None): """ - Returns whether ``self`` is in an epsilon-cycle or not. + Return whether ``self`` is in an epsilon-cycle or not. INPUT: @@ -2137,10 +2111,9 @@ def _in_epsilon_cycle_(self, fsm=None): """ return self in self._epsilon_successors_(fsm) - def _epsilon_cycle_output_empty_(self, fsm=None): """ - Returns whether all epsilon-cycles in which ``self`` is + Return whether all epsilon-cycles in which ``self`` is contained have an empty output (i.e., do not write any output word). @@ -2151,7 +2124,7 @@ def _epsilon_cycle_output_empty_(self, fsm=None): OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` A ``ValueError`` is raised when ``self`` is not in an epsilon cycle. @@ -2200,7 +2173,7 @@ def _epsilon_cycle_output_empty_(self, fsm=None): raise ValueError("State %s is not in an epsilon cycle." % (self,)) -#***************************************************************************** +# **************************************************************************** def is_FSMTransition(T): @@ -2308,16 +2281,16 @@ def __init__(self, from_state, to_state, def __lt__(self, other): """ - Returns True if ``self`` is less than ``other`` with respect to the + Return True if ``self`` is less than ``other`` with respect to the key ``(self.from_state, self.word_in, self.to_state, self.word_out)``. INPUT: - - `other` -- a transition. + - ``other`` -- a transition. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -2328,14 +2301,9 @@ def __lt__(self, other): return (self.from_state, self.word_in, self.to_state, self.word_out) < \ (other.from_state, other.word_in, other.to_state, other.word_out) - def __copy__(self): """ - Returns a (shallow) copy of the transition. - - INPUT: - - Nothing. + Return a (shallow) copy of the transition. OUTPUT: @@ -2354,13 +2322,11 @@ def __copy__(self): new.hook = self.hook return new - copy = __copy__ - def __deepcopy__(self, memo): """ - Returns a deep copy of the transition. + Return a deep copy of the transition. INPUT: @@ -2385,10 +2351,9 @@ def __deepcopy__(self, memo): new.hook = deepcopy(self.hook, memo) return new - def deepcopy(self, memo=None): """ - Returns a deep copy of the transition. + Return a deep copy of the transition. INPUT: @@ -2434,11 +2399,9 @@ def _repr_(self): repr(self.to_state), self._in_out_label_()) - def _in_out_label_(self): """ - Returns the input and output of a transition as - "word_in|word_out". + Return the input and output of a transition as "word_in|word_out". INPUT: @@ -2457,10 +2420,9 @@ def _in_out_label_(self): return "%s|%s" % (FSMWordSymbol(self.word_in), FSMWordSymbol(self.word_out)) - - def __eq__(left, right): + def __eq__(self, other): """ - Returns True if the two transitions are the same, i.e., if the + Return ``True`` if the two transitions are the same, i.e., if the both go from the same states to the same states and read and write the same words. @@ -2468,13 +2430,13 @@ def __eq__(left, right): INPUT: - - ``left`` -- a transition. + - ``self`` -- a transition. - - ``right`` -- a transition. + - ``other`` -- a transition. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -2485,28 +2447,26 @@ def __eq__(left, right): sage: t1 == t2 True """ - if not is_FSMTransition(right): - raise TypeError('Only instances of FSMTransition ' \ - 'can be compared.') - return left.from_state == right.from_state \ - and left.to_state == right.to_state \ - and left.word_in == right.word_in \ - and left.word_out == right.word_out - + if not is_FSMTransition(other): + return False + return self.from_state == other.from_state \ + and self.to_state == other.to_state \ + and self.word_in == other.word_in \ + and self.word_out == other.word_out - def __ne__(left, right): + def __ne__(self, other): """ + Test for inequality, complement of __eq__. INPUT: - - ``left`` -- a transition. + - ``self`` -- a transition. - - ``right`` -- a transition. + - ``other`` -- a transition. OUTPUT: - True or False. - Tests for inequality, complement of __eq__. + ``True`` or ``False`` EXAMPLES:: @@ -2517,20 +2477,11 @@ def __ne__(left, right): sage: t1 != t2 False """ - return (not (left == right)) - + return not (self == other) def __bool__(self): """ - Returns True. - - INPUT: - - Nothing. - - OUTPUT: - - True or False. + Return ``True``. EXAMPLES:: @@ -2543,7 +2494,7 @@ def __bool__(self): __nonzero__ = __bool__ -#***************************************************************************** +# **************************************************************************** def is_FiniteStateMachine(FSM): @@ -3123,9 +3074,9 @@ class FiniteStateMachine(SageObject): :attr:`input_alphabet`. """ - #************************************************************************* + # ************************************************************************ # init - #************************************************************************* + # ************************************************************************ def __init__(self, @@ -3144,9 +3095,10 @@ def __init__(self, sage: FiniteStateMachine() Empty finite state machine """ - self._states_ = [] # List of states in the finite state - # machine. Each state stores a list of - # outgoing transitions. + self._states_ = [] + # List of states in the finite state + # machine. Each state stores a list of + # outgoing transitions. if store_states_dict: self._states_dict_ = {} @@ -3188,16 +3140,16 @@ def __init__(self, if initial_states is not None: if not hasattr(initial_states, '__iter__'): - raise TypeError('Initial states must be iterable ' \ - '(e.g. a list of states).') + raise TypeError('Initial states must be iterable ' + '(e.g. a list of states).') for s in initial_states: state = self.add_state(s) state.is_initial = True if final_states is not None: if not hasattr(final_states, '__iter__'): - raise TypeError('Final states must be iterable ' \ - '(e.g. a list of states).') + raise TypeError('Final states must be iterable ' + '(e.g. a list of states).') for s in final_states: state = self.add_state(s) state.is_final = True @@ -3208,7 +3160,7 @@ def __init__(self, if on_duplicate_transition is None: on_duplicate_transition = duplicate_transition_ignore if hasattr(on_duplicate_transition, '__call__'): - self.on_duplicate_transition=on_duplicate_transition + self.on_duplicate_transition = on_duplicate_transition else: raise TypeError('on_duplicate_transition must be callable') @@ -3271,18 +3223,13 @@ def __init__(self, self.construct_final_word_out(with_final_word_out) - #************************************************************************* + # ************************************************************************ # copy and hash - #************************************************************************* - + # ************************************************************************ def __copy__(self): """ - Returns a (shallow) copy of the finite state machine. - - INPUT: - - Nothing. + Return a (shallow) copy of the finite state machine. OUTPUT: @@ -3297,13 +3244,11 @@ def __copy__(self): """ raise NotImplementedError - copy = __copy__ - def empty_copy(self, memo=None, new_class=None): """ - Returns an empty deep copy of the finite state machine, i.e., + Return an empty deep copy of the finite state machine, i.e., ``input_alphabet``, ``output_alphabet``, ``on_duplicate_transition`` are preserved, but states and transitions are not. @@ -3349,10 +3294,9 @@ def empty_copy(self, memo=None, new_class=None): new._copy_from_other_(self, memo=memo, empty=True) return new - def __deepcopy__(self, memo): """ - Returns a deep copy of the finite state machine. + Return a deep copy of the finite state machine. INPUT: @@ -3372,10 +3316,9 @@ def __deepcopy__(self, memo): new._copy_from_other_(self) return new - def deepcopy(self, memo=None): """ - Returns a deep copy of the finite state machine. + Return a deep copy of the finite state machine. INPUT: @@ -3460,10 +3403,6 @@ def __getstate__(self): """ Return state for pickling excluding outgoing transitions. - INPUT: - - None - OUTPUT: A dictionary. @@ -3478,10 +3417,8 @@ def __getstate__(self): sage: loads(dumps(A)) == A True """ - odict = self.__dict__.copy() # copy the dict since we change it - odict.update({ - 'transitions': self.transitions() - }) + odict = self.__dict__.copy() # copy the dict since we change it + odict.update({'transitions': self.transitions()}) return odict def __setstate__(self, d): @@ -3509,13 +3446,13 @@ def __setstate__(self, d): transitions = d.pop('transitions') self.__dict__.update(d) for state in self.iter_states(): - state.transitions = [] # clean outgoing transitions + state.transitions = [] # clean outgoing transitions for transition in transitions: self.add_transition(transition) def relabeled(self, memo=None, labels=None): """ - Returns a deep copy of the finite state machine, but the + Return a deep copy of the finite state machine, but the states are relabeled. INPUT: @@ -3560,10 +3497,9 @@ def relabeled(self, memo=None, labels=None): del self._deepcopy_labels_ return new - def induced_sub_finite_state_machine(self, states): """ - Returns a sub-finite-state-machine of the finite state machine + Return a sub-finite-state-machine of the finite state machine induced by the given states. INPUT: @@ -3641,13 +3577,13 @@ def __hash__(self): """ if getattr(self, "_immutable", False): return hash((tuple(self.states()), tuple(self.transitions()))) - raise TypeError("Finite state machines are mutable, " \ - "and thus not hashable.") + raise TypeError("Finite state machines are mutable, " + "and thus not hashable.") - #************************************************************************* + # ************************************************************************ # operators - #************************************************************************* + # ************************************************************************ def __or__(self, other): @@ -3698,10 +3634,9 @@ def __iadd__(self, other): """ raise NotImplementedError - def __and__(self, other): """ - Returns the intersection of ``self`` with ``other``. + Return the intersection of ``self`` with ``other``. TESTS:: @@ -3713,7 +3648,6 @@ def __and__(self, other): if is_FiniteStateMachine(other): return self.intersection(other) - def __imul__(self, other): """ TESTS:: @@ -3959,41 +3893,34 @@ def __call__(self, *args, **kwargs): ....: automatic_output_type=True)) <... 'tuple'> """ - if len(args) == 0: + if not args: raise TypeError("Called with too few arguments.") if is_FiniteStateMachine(args[0]): return self.composition(*args, **kwargs) if hasattr(args[0], '__iter__'): - if not 'full_output' in kwargs: + if 'full_output' not in kwargs: kwargs['full_output'] = False - if not 'list_of_outputs' in kwargs: + if 'list_of_outputs' not in kwargs: kwargs['list_of_outputs'] = False - if not 'automatic_output_type' in kwargs: - kwargs['automatic_output_type'] = not 'format_output' in kwargs + if 'automatic_output_type' not in kwargs: + kwargs['automatic_output_type'] = 'format_output' not in kwargs input_tape = args[0] - if hasattr(input_tape, 'is_finite') and \ - not input_tape.is_finite(): - if not 'iterator_type' in kwargs: + if hasattr(input_tape, 'is_finite') and not input_tape.is_finite(): + if 'iterator_type' not in kwargs: kwargs['iterator_type'] = 'simple' return self.iter_process(*args, **kwargs) return self.process(*args, **kwargs) raise TypeError("Do not know what to do with that arguments.") - - #************************************************************************* + # ************************************************************************ # tests - #************************************************************************* - + # ************************************************************************ def __bool__(self): """ - Returns True if the finite state machine consists of at least + Return True if the finite state machine consists of at least one state. - INPUT: - - Nothing. - OUTPUT: True or False. @@ -4007,16 +3934,16 @@ def __bool__(self): __nonzero__ = __bool__ - def __eq__(left, right): + def __eq__(self, other): """ - Returns ``True`` if the two finite state machines are equal, + Return ``True`` if the two finite state machines are equal, i.e., if they have the same states and the same transitions. INPUT: - - ``left`` -- a finite state machine. + - ``self`` -- a finite state machine. - - ``right`` -- a finite state machine. + - ``other`` -- a finite state machine. OUTPUT: @@ -4060,53 +3987,49 @@ def __eq__(left, right): sage: F == G True """ - if not is_FiniteStateMachine(right): - raise TypeError('Only instances of FiniteStateMachine ' - 'can be compared.') - if len(left._states_) != len(right._states_): + if not is_FiniteStateMachine(other): + return False + if len(self._states_) != len(other._states_): return False colors_equal = True - for state in left.iter_states(): + for state in self.iter_states(): try: - right_state = right.state(state.label()) + other_state = other.state(state.label()) except LookupError: return False # we handle colors separately - if not state.fully_equal(right_state, compare_color=False): + if not state.fully_equal(other_state, compare_color=False): return False - if state.color != right_state.color: + if state.color != other_state.color: colors_equal = False - left_transitions = state.transitions - right_transitions = right.state(state).transitions - if len(left_transitions) != len(right_transitions): + self_transitions = state.transitions + other_transitions = other.state(state).transitions + if len(self_transitions) != len(other_transitions): return False - for t in left_transitions: - if t not in right_transitions: + for t in self_transitions: + if t not in other_transitions: return False # handle colors if colors_equal: return True - if left.is_monochromatic() and right.is_monochromatic(): - return True - return False - + return self.is_monochromatic() and other.is_monochromatic() - def __ne__(left, right): + def __ne__(self, other): """ Tests for inequality, complement of :meth:`.__eq__`. INPUT: - - ``left`` -- a finite state machine. + - ``self`` -- a finite state machine. - - ``right`` -- a finite state machine. + - ``other`` -- a finite state machine. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -4118,13 +4041,14 @@ def __ne__(left, right): sage: E == G False """ - return (not (left == right)) - + return not (self == other) def __contains__(self, item): """ - Returns true, if the finite state machine contains the - state or transition item. Note that only the labels of the + Return ``True``, if the finite state machine contains the + state or transition item. + + Note that only the labels of the states and the input and output words are tested. INPUT: @@ -4133,7 +4057,7 @@ def __contains__(self, item): OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -4271,9 +4195,9 @@ def default_is_zero(expression): for state in self.iter_states()) - #************************************************************************* + # ************************************************************************ # representations / LaTeX - #************************************************************************* + # ************************************************************************ def _repr_(self): @@ -4346,7 +4270,6 @@ def format_letter_negative(self, letter): \path[->] (v0) edge[loop above] node {$\overline{1}$} (); \end{tikzpicture} """ - from sage.rings.integer_ring import ZZ if letter in ZZ and letter < 0: return r'\overline{%d}' % -letter else: @@ -4852,11 +4775,7 @@ def latex_options(self, def _latex_(self): r""" - Returns a LaTeX code for the graph of the finite state machine. - - INPUT: - - Nothing. + Return a LaTeX code for the graph of the finite state machine. OUTPUT: @@ -4953,7 +4872,7 @@ def label_rotation(angle, both_directions): accepting_show_empty = False result = "\\begin{tikzpicture}[%s]\n" % ", ".join(options) - j = 0; + j = 0 for vertex in self.iter_states(): if not hasattr(vertex, "coordinates"): vertex.coordinates = (3*cos(2*pi*j/len(self.states())), @@ -5015,14 +4934,14 @@ def key_function(s): )) for ((source, target), transitions) in adjacent.items(): - if len(transitions) > 0: + if transitions: labels = [] for transition in transitions: if hasattr(transition, "format_label"): labels.append(transition.format_label()) else: labels.append(self._latex_transition_label_( - transition, self.format_transition_label)) + transition, self.format_transition_label)) label = ", ".join(labels) if source != target: angle = atan2( @@ -5054,17 +4973,16 @@ def key_function(s): result += "\\end{tikzpicture}" return result - def _latex_transition_label_(self, transition, format_function=None): r""" - Returns the proper transition label. + Return the proper transition label. INPUT: - - ``transition`` - a transition + - ``transition`` -- a transition - - ``format_function`` - a function formatting the labels + - ``format_function`` -- a function formatting the labels OUTPUT: @@ -5137,15 +5055,14 @@ def set_coordinates(self, coordinates, default=True): state.coordinates = (3*cos(2*pi*j/n), 3*sin(2*pi*j/n)) - - #************************************************************************* + # ************************************************************************ # other - #************************************************************************* - + # ************************************************************************ def _matrix_(self, R=None): """ - Returns the adjacency matrix of the finite state machine. + Return the adjacency matrix of the finite state machine. + See :meth:`.adjacency_matrix` for more information. EXAMPLES:: @@ -5165,11 +5082,10 @@ def _matrix_(self, R=None): """ return self.adjacency_matrix() - def adjacency_matrix(self, input=None, entry=None): """ - Returns the adjacency matrix of the underlying graph. + Return the adjacency matrix of the underlying graph. INPUT: @@ -5242,7 +5158,6 @@ def adjacency_matrix(self, input=None, [1 1 0] """ - from sage.rings.integer_ring import ZZ def default_function(transitions): x = var('x') @@ -5323,7 +5238,6 @@ def determine_input_alphabet(self, reset=True): ain.add(letter) self.input_alphabet = list(ain) - def determine_output_alphabet(self, reset=True): """ Determine the output alphabet according to the transitions @@ -5377,7 +5291,6 @@ def determine_output_alphabet(self, reset=True): aout.add(letter) self.output_alphabet = list(aout) - def determine_alphabets(self, reset=True): """ Determine the input and output alphabet according to the @@ -5421,19 +5334,13 @@ def determine_alphabets(self, reset=True): self.determine_input_alphabet(reset) self.determine_output_alphabet(reset) - - #************************************************************************* + # ************************************************************************ # get states and transitions - #************************************************************************* - + # ************************************************************************ def states(self): """ - Returns the states of the finite state machine. - - INPUT: - - Nothing. + Return the states of the finite state machine. OUTPUT: @@ -5449,11 +5356,7 @@ def states(self): def iter_states(self): """ - Returns an iterator of the states. - - INPUT: - - Nothing. + Return an iterator of the states. OUTPUT: @@ -5467,10 +5370,9 @@ def iter_states(self): """ return iter(self._states_) - def transitions(self, from_state=None): """ - Returns a list of all transitions. + Return a list of all transitions. INPUT: @@ -5490,10 +5392,9 @@ def transitions(self, from_state=None): """ return list(self.iter_transitions(from_state)) - def iter_transitions(self, from_state=None): """ - Returns an iterator of all transitions. + Return an iterator of all transitions. INPUT: @@ -5522,14 +5423,9 @@ def iter_transitions(self, from_state=None): else: return iter(self.state(from_state).transitions) - def _iter_transitions_all_(self): """ - Returns an iterator over all transitions. - - INPUT: - - Nothing. + Return an iterator over all transitions. OUTPUT: @@ -5546,14 +5442,9 @@ def _iter_transitions_all_(self): for t in state.transitions: yield t - def initial_states(self): """ - Returns a list of all initial states. - - INPUT: - - Nothing. + Return a list of all initial states. OUTPUT: @@ -5570,14 +5461,9 @@ def initial_states(self): """ return list(self.iter_initial_states()) - def iter_initial_states(self): """ - Returns an iterator of the initial states. - - INPUT: - - Nothing. + Return an iterator of the initial states. OUTPUT: @@ -5596,11 +5482,7 @@ def iter_initial_states(self): def final_states(self): """ - Returns a list of all final states. - - INPUT: - - Nothing. + Return a list of all final states. OUTPUT: @@ -5618,14 +5500,9 @@ def final_states(self): """ return list(self.iter_final_states()) - def iter_final_states(self): """ - Returns an iterator of the final states. - - INPUT: - - Nothing. + Return an iterator of the final states. OUTPUT: @@ -5645,7 +5522,7 @@ def iter_final_states(self): def state(self, state): """ - Returns the state of the finite state machine. + Return the state of the finite state machine. INPUT: @@ -5655,8 +5532,7 @@ def state(self, state): OUTPUT: - Returns the state of the finite state machine corresponding to - ``state``. + The state of the finite state machine corresponding to ``state``. If no state is found, then a ``LookupError`` is thrown. @@ -5689,10 +5565,9 @@ def what(s, switch): pass raise LookupError("No state with label %s found." % (what(state, switch),)) - def transition(self, transition): """ - Returns the transition of the finite state machine. + Return the transition of the finite state machine. INPUT: @@ -5702,8 +5577,8 @@ def transition(self, transition): OUTPUT: - Returns the transition of the finite state machine - corresponding to ``transition``. + The transition of the finite state machine corresponding + to ``transition``. If no transition is found, then a ``LookupError`` is thrown. @@ -5724,15 +5599,13 @@ def transition(self, transition): return s raise LookupError("No transition found.") - - #************************************************************************* + # ************************************************************************ # properties (state and transitions) - #************************************************************************* - + # ************************************************************************ def has_state(self, state): """ - Returns whether ``state`` is one of the states of the finite + Return whether ``state`` is one of the states of the finite state machine. INPUT: @@ -5754,10 +5627,9 @@ def has_state(self, state): except LookupError: return False - def has_transition(self, transition): """ - Returns whether ``transition`` is one of the transitions of + Return whether ``transition`` is one of the transitions of the finite state machine. INPUT: @@ -5783,10 +5655,9 @@ def has_transition(self, transition): return transition in self.iter_transitions() raise TypeError("Transition is not an instance of FSMTransition.") - def has_initial_state(self, state): """ - Returns whether ``state`` is one of the initial states of the + Return whether ``state`` is one of the initial states of the finite state machine. INPUT: @@ -5808,14 +5679,9 @@ def has_initial_state(self, state): except LookupError: return False - def has_initial_states(self): """ - Returns whether the finite state machine has an initial state. - - INPUT: - - Nothing. + Return whether the finite state machine has an initial state. OUTPUT: @@ -5826,12 +5692,11 @@ def has_initial_states(self): sage: FiniteStateMachine().has_initial_states() False """ - return len(self.initial_states()) > 0 - + return bool(self.initial_states()) def has_final_state(self, state): """ - Returns whether ``state`` is one of the final states of the + Return whether ``state`` is one of the final states of the finite state machine. INPUT: @@ -5852,14 +5717,9 @@ def has_final_state(self, state): except LookupError: return False - def has_final_states(self): """ - Returns whether the finite state machine has a final state. - - INPUT: - - Nothing. + Return whether the finite state machine has a final state. OUTPUT: @@ -5870,25 +5730,19 @@ def has_final_states(self): sage: FiniteStateMachine().has_final_states() False """ - return len(self.final_states()) > 0 - + return bool(self.final_states()) - #************************************************************************* + # ************************************************************************ # properties - #************************************************************************* - + # ************************************************************************ def is_deterministic(self): """ Return whether the finite finite state machine is deterministic. - INPUT: - - Nothing. - OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` A finite state machine is considered to be deterministic if each transition has input label of length one and for each @@ -5922,7 +5776,7 @@ def is_deterministic(self): sage: Automaton(initial_states=[0, 1]).is_deterministic() False """ - if len(self.initial_states())>1: + if len(self.initial_states()) > 1: return False for state in self.iter_states(): for transition in state.transitions: @@ -5933,23 +5787,18 @@ def is_deterministic(self): state.transitions, key=lambda t: t.word_in) - for key,transition_class in transition_classes_by_word_in: + for key, transition_class in transition_classes_by_word_in: if len(transition_class) > 1: return False return True - def is_complete(self): """ - Returns whether the finite state machine is complete. - - INPUT: - - Nothing. + Return whether the finite state machine is complete. OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` A finite state machine is considered to be complete if each transition has an input label of length one and for each @@ -6017,9 +5866,9 @@ def is_connected(self): raise NotImplementedError - #************************************************************************* + # ************************************************************************ # let the finite state machine work - #************************************************************************* + # ************************************************************************ _process_default_options_ = {'full_output': True, 'list_of_outputs': None, @@ -6027,10 +5876,9 @@ def is_connected(self): 'always_include_output': False, 'automatic_output_type': False} - def process(self, *args, **kwargs): """ - Returns whether the finite state machine accepts the input, the state + Return whether the finite state machine accepts the input, the state where the computation stops and which output is generated. INPUT: @@ -6652,15 +6500,14 @@ def _iter_process_simple_(self, iterator): for o in branch.outputs[0]: yield o - branch.outputs[0] = [] # Reset output so that in the next round - # (of "for current in iterator") only new - # output is returned (by the yield). - + branch.outputs[0] = [] + # Reset output so that in the next round + # (of "for current in iterator") only new + # output is returned (by the yield). - #************************************************************************* + # ************************************************************************ # change finite state machine (add/remove state/transitions) - #************************************************************************* - + # ************************************************************************ def add_state(self, state): """ @@ -6956,9 +6803,9 @@ def add_from_transition_function(self, function, initial_states=None, state.is_initial = True not_done.append(state) else: - raise TypeError('Initial states must be iterable ' \ - '(e.g. a list of states).') - if len(not_done) == 0: + raise TypeError('Initial states must be iterable ' + '(e.g. a list of states).') + if not not_done: raise ValueError("No state is initial.") if explore_existing_states: ignore_done = self.states() @@ -6993,7 +6840,7 @@ def add_from_transition_function(self, function, initial_states=None, for (st_label, word) in return_value: if not self.has_state(st_label): not_done.append(self.add_state(st_label)) - elif len(ignore_done) > 0: + elif ignore_done: u = self.state(st_label) if u in ignore_done: not_done.append(u) @@ -7087,14 +6934,14 @@ def add_transitions_from_function(self, function, labels_as_input=True): transitions = return_value for t in transitions: if not hasattr(t, '__getitem__'): - raise ValueError("The callback function for " - "add_transitions_from_function " - "is expected to return a " - "pair (word_in, word_out) or a " - "list of such pairs. For " - "states %s and %s however, it " - "returned %s, which is not " - "acceptable." % (s_from, s_to, return_value)) + raise ValueError("The callback function for " + "add_transitions_from_function " + "is expected to return a " + "pair (word_in, word_out) or a " + "list of such pairs. For " + "states %s and %s however, it " + "returned %s, which is not " + "acceptable." % (s_from, s_to, return_value)) label_in = t[0] try: label_out = t[1] @@ -7180,10 +7027,9 @@ def remove_epsilon_transitions(self): """ raise NotImplementedError - def epsilon_successors(self, state): """ - Returns the dictionary with states reachable from ``state`` + Return the dictionary with states reachable from ``state`` without reading anything from an input tape as keys. The values are lists of outputs. @@ -7267,29 +7113,27 @@ def accessible_components(self): sage: F.accessible_components() Automaton with 3 states """ - - if len(self.initial_states()) == 0: + if not self.initial_states(): return deepcopy(self) - memo = {} + def accessible(from_state, read): return [(deepcopy(x.to_state, memo), x.word_out) for x in self.iter_transitions(from_state) if x.word_in[0] == read] - new_initial_states=[deepcopy(x, memo) for x in self.initial_states()] + new_initial_states = [deepcopy(x, memo) for x in self.initial_states()] result = self.empty_copy() result.add_from_transition_function(accessible, initial_states=new_initial_states) for final_state in self.iter_final_states(): try: - new_final_state=result.state(final_state.label) - new_final_state.is_final=True + new_final_state = result.state(final_state.label) + new_final_state.is_final = True except LookupError: pass return result - def coaccessible_components(self): r""" Return the sub-machine induced by the coaccessible states of this @@ -7810,7 +7654,7 @@ def product_FiniteStateMachine(self, other, function, final_function=None, new_class=None): r""" - Returns a new finite state machine whose states are + Return a new finite state machine whose states are `d`-tuples of states of the original finite state machines. INPUT: @@ -8077,7 +7921,7 @@ def default_final_function(*args): def composition(self, other, algorithm=None, only_accessible_components=True): """ - Returns a new transducer which is the composition of ``self`` + Return a new transducer which is the composition of ``self`` and ``other``. INPUT: @@ -8375,16 +8219,9 @@ def composition(self, other, algorithm=None, "possible.") if algorithm is None: - if (any(len(t.word_out) > 1 - for t in other.iter_transitions()) + if (any(len(t.word_out) > 1 for t in other.iter_transitions()) or - any(len(t.word_in) != 1 - for t in self.iter_transitions()) - #this might be used for multi-tape mode. - #or - #any(isinstance(t.word_in[0], tuple) and None in t.word_in[0] - # for t in self.iter_transitions()) - ): + any(len(t.word_in) != 1 for t in self.iter_transitions())): algorithm = 'explorative' else: algorithm = 'direct' @@ -8395,7 +8232,6 @@ def composition(self, other, algorithm=None, else: raise ValueError("Unknown algorithm %s." % (algorithm,)) - def _composition_direct_(self, other, only_accessible_components=True): """ See :meth:`.composition` for details. @@ -8541,16 +8377,11 @@ def composition_transition(states, input): F.output_alphabet = second.output_alphabet return F - def input_projection(self): """ - Returns an automaton where the output of each transition of + Return an automaton where the output of each transition of self is deleted. - INPUT: - - Nothing - OUTPUT: An automaton. @@ -8567,16 +8398,11 @@ def input_projection(self): """ return self.projection(what='input') - def output_projection(self): """ - Returns a automaton where the input of each transition of self + Return a automaton where the input of each transition of self is deleted and the new input is the original output. - INPUT: - - Nothing - OUTPUT: An automaton. @@ -8611,10 +8437,9 @@ def output_projection(self): """ return self.projection(what='output') - def projection(self, what='input'): """ - Returns an Automaton which transition labels are the projection + Return an Automaton which transition labels are the projection of the transition labels of the input. INPUT: @@ -8679,10 +8504,9 @@ def projection(self, what='input'): return new - def transposition(self, reverse_output_labels=True): """ - Returns a new finite state machine, where all transitions of the + Return a new finite state machine, where all transitions of the input finite state machine are reversed. INPUT: @@ -8781,17 +8605,12 @@ def transposition(self, reverse_output_labels=True): return transposition - def split_transitions(self): """ - Returns a new transducer, where all transitions in self with input + Return a new transducer, where all transitions in self with input labels consisting of more than one letter are replaced by a path of the corresponding length. - INPUT: - - Nothing. - OUTPUT: A new transducer. @@ -8822,16 +8641,11 @@ def split_transitions(self): transition.word_out)) return new - def final_components(self): """ - Returns the final components of a finite state machine as finite + Return the final components of a finite state machine as finite state machines. - INPUT: - - Nothing. - OUTPUT: A list of finite state machines, each representing a final @@ -9003,7 +8817,6 @@ def completion(self, sink=None): except LookupError: pass else: - from sage.rings.integer_ring import ZZ sink = 1 + max(itertools.chain( [-1], (s.label() for s in result.iter_states() @@ -9202,11 +9015,7 @@ def find_common_output(state): def equivalence_classes(self): r""" - Returns a list of equivalence classes of states. - - INPUT: - - Nothing. + Return a list of equivalence classes of states. OUTPUT: @@ -9280,7 +9089,7 @@ def equivalence_classes(self): state.final_word_out) states_grouped = full_group_by(self.states(), key=key_0) classes_current = [equivalence_class for - (key,equivalence_class) in states_grouped] + (key, equivalence_class) in states_grouped] while len(classes_current) != len(classes_previous): class_of = {} @@ -9300,15 +9109,13 @@ def equivalence_classes(self): for class_previous in classes_previous: states_grouped = full_group_by(class_previous, key=key_current) classes_current.extend([equivalence_class for - (key,equivalence_class) in states_grouped]) + (key, equivalence_class) in states_grouped]) return classes_current - def quotient(self, classes): r""" - Constructs the quotient with respect to the equivalence - classes. + Construct the quotient with respect to the equivalence classes. INPUT: @@ -9401,10 +9208,10 @@ def quotient(self, classes): for t in c[0].transitions]) for transition in self.iter_transitions(c[0]): new.add_transition( - from_state = new_state, - to_state = state_mapping[transition.to_state], - word_in = transition.word_in, - word_out = transition.word_out) + from_state=new_state, + to_state=state_mapping[transition.to_state], + word_in=transition.word_in, + word_out=transition.word_out) # check that all class members have the same information (modulo classes) for state in c: @@ -9474,7 +9281,7 @@ def key(transition): memo = {} for state in self.states(): - new_state = deepcopy(state,memo) + new_state = deepcopy(state, memo) state_dict[state] = new_state new.add_state(new_state) @@ -9883,15 +9690,13 @@ def find_final_word_out(state): state.is_final = True state.final_word_out = final_word_out - # ************************************************************************* # other # ************************************************************************* - def graph(self, edge_labels='words_in_out'): """ - Returns the graph of the finite state machine with labeled + Return the graph of the finite state machine with labeled vertices and labeled edges. INPUT: @@ -9926,7 +9731,7 @@ def graph(self, edge_labels='words_in_out'): :class:`DiGraph` """ if edge_labels == 'words_in_out': - label_fct = lambda t:t._in_out_label_() + label_fct = lambda t: t._in_out_label_() elif hasattr(edge_labels, '__call__'): label_fct = edge_labels else: @@ -9936,7 +9741,7 @@ def graph(self, edge_labels='words_in_out'): isolated_vertices = [] for state in self.iter_states(): transitions = state.transitions - if len(transitions) == 0: + if not transitions: isolated_vertices.append(state.label()) for t in transitions: graph_data.append((t.from_state.label(), t.to_state.label(), @@ -10013,7 +9818,7 @@ def predecessors(self, state, valid_input=None): valid_list.append(input_list) valid_input = valid_list - unhandeled_direct_predecessors = {s:[] for s in self.states() } + unhandeled_direct_predecessors = {s: [] for s in self.states()} for t in self.transitions(): if valid_input is None or t.word_in in valid_input: unhandeled_direct_predecessors[t.to_state].append(t.from_state) @@ -10140,8 +9945,7 @@ def number_of_words(self, variable=var('n'), NotImplementedError: Finite State Machine must be deterministic. """ from sage.modules.free_module_element import vector - from sage.arith.all import falling_factorial - from sage.rings.integer_ring import ZZ + from sage.arith.all import binomial from sage.symbolic.ring import SR if base_ring is None: base_ring = QQbar @@ -10151,7 +9955,7 @@ def jordan_block_power(block, exponent): return matrix(block.nrows(), block.nrows(), lambda i, j: eigenvalue**(exponent-(j-i)) * - falling_factorial(exponent, j-i) / ZZ(j-i).factorial() + binomial(exponent, j - i) if j >= i else 0) if not self.is_deterministic(): @@ -10170,7 +9974,7 @@ def jordan_block_power(block, exponent): def asymptotic_moments(self, variable=var('n')): r""" - Returns the main terms of expectation and variance of the sum + Return the main terms of expectation and variance of the sum of output labels and its covariance with the sum of input labels. @@ -10601,9 +10405,11 @@ def get_matrix(fsm, x, y): y = R.symbol() z = R.symbol() M = get_matrix(self, x, y) + def substitute_one(g): return g.subs({x: 1, y: 1, z: 1}) else: + def substitute_one(g): # the result of the substitution shall live in QQ, # not in the polynomial ring R, so the method @@ -10971,8 +10777,7 @@ def default_is_zero(expression): def entry(transition): word_out = transition.word_out - if len(word_out) == 0 or ( - len(word_out) == 1 and not test(word_out[0])): + if not word_out or (len(word_out) == 1 and not test(word_out[0])): return transition.word_in[0] else: return 0 @@ -10980,7 +10785,6 @@ def entry(transition): relabeled = self.relabeled() n = len(relabeled.states()) assert [s.label() for s in relabeled.states()] == list(range(n)) - from sage.rings.integer_ring import ZZ entry_vector = vector(ZZ(s.is_initial) for s in relabeled.states()) exit_vector = vector([1] * n) @@ -11011,17 +10815,14 @@ def entry(transition): # ring, extend it instead of creating a univariate # polynomial ring over a polynomial ring. This # should improve performance. - R = PolynomialRing( - base_ring.base_ring(), - base_ring.variable_names() - + ('Z_waiting_time',)) + R = PolynomialRing(base_ring.base_ring(), + base_ring.variable_names() + + ('Z_waiting_time',)) else: R = PolynomialRing(base_ring, 'Z_waiting_time') Z = R.gens()[-1] - system_matrix = identity_matrix(n) - Z * \ - transition_matrix - G = entry_vector * system_matrix.solve_right( - exit_vector) + system_matrix = identity_matrix(n) - Z * transition_matrix + G = entry_vector * system_matrix.solve_right(exit_vector) expectation = G.subs({Z: 1}) variance = 2 * G.derivative(Z).subs({Z: 1}) \ + expectation \ @@ -11033,18 +10834,13 @@ def entry(transition): return {'expectation': expectation, 'variance': variance} - def is_monochromatic(self): """ - Checks whether the colors of all states are equal. - - INPUT: - - Nothing. + Check whether the colors of all states are equal. OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` EXAMPLES:: @@ -11059,7 +10855,6 @@ def is_monochromatic(self): """ return equal(s.color for s in self.iter_states()) - def language(self, max_length=None, **kwargs): r""" Return all words that can be written by this transducer. @@ -11154,7 +10949,7 @@ def language(self, max_length=None, **kwargs): it._finished_ = [] -#***************************************************************************** +# **************************************************************************** def is_Automaton(FSM): @@ -11274,13 +11069,13 @@ def _repr_(self): def _latex_transition_label_(self, transition, format_function=None): r""" - Returns the proper transition label. + Return the proper transition label. INPUT: - - ``transition`` - a transition + - ``transition`` -- a transition - - ``format_function`` - a function formatting the labels + - ``format_function`` -- a function formatting the labels OUTPUT: @@ -11307,10 +11102,9 @@ def _latex_transition_label_(self, transition, format_function = latex return format_function(transition.word_in) - def intersection(self, other, only_accessible_components=True): """ - Returns a new automaton which accepts an input if it is + Return a new automaton which accepts an input if it is accepted by both given automata. INPUT: @@ -11405,19 +11199,13 @@ def function(transition1, transition2): function, only_accessible_components=only_accessible_components) - cartesian_product = intersection - def determinisation(self): """ - Returns a deterministic automaton which accepts the same input + Return a deterministic automaton which accepts the same input words as the original one. - INPUT: - - Nothing. - OUTPUT: A new automaton, which is deterministic. @@ -11592,10 +11380,9 @@ def set_transition(states, letter): return result - def minimization(self, algorithm=None): """ - Returns the minimization of the input automaton as a new automaton. + Return the minimization of the input automaton as a new automaton. INPUT: @@ -11668,10 +11455,9 @@ def minimization(self, algorithm=None): else: raise NotImplementedError("Algorithm '%s' is not implemented. Choose 'Moore' or 'Brzozowski'" % algorithm) - def _minimization_Brzozowski_(self): """ - Returns a minimized automaton by using Brzozowski's algorithm. + Return a minimized automaton by using Brzozowski's algorithm. See also :meth:`.minimization`. @@ -11686,10 +11472,9 @@ def _minimization_Brzozowski_(self): """ return self.transposition().determinisation().transposition().determinisation() - def _minimization_Moore_(self): """ - Returns a minimized automaton by using Moore's algorithm. + Return a minimized automaton by using Moore's algorithm. See also :meth:`.minimization`. @@ -11708,10 +11493,9 @@ def _minimization_Moore_(self): if self.is_deterministic(): return self.quotient(self.equivalence_classes()) else: - raise NotImplementedError("Minimization via Moore's Algorithm is only " \ + raise NotImplementedError("Minimization via Moore's Algorithm is only " "implemented for deterministic finite state machines") - def complement(self): r""" Return the complement of this automaton. @@ -12200,7 +11984,6 @@ def shannon_parry_markov_chain(self): raise NotImplementedError("Automaton must be strongly connected.") if not all(s.is_final for s in self.iter_states()): raise NotImplementedError("All states must be final.") - from sage.rings.integer_ring import ZZ M = self.adjacency_matrix().change_ring(ZZ) states = {state: i for i, state in enumerate(self.iter_states())} w_all = sorted(M.eigenvectors_right(), @@ -12378,7 +12161,7 @@ def language(self, max_length=None, **kwargs): return T.language(max_length) -#***************************************************************************** +# **************************************************************************** def is_Transducer(FSM): @@ -12478,13 +12261,13 @@ def _repr_(self): def _latex_transition_label_(self, transition, format_function=None): r""" - Returns the proper transition label. + Return the proper transition label. INPUT: - - ``transition`` - a transition + - ``transition`` -- a transition - - ``format_function`` - a function formatting the labels + - ``format_function`` -- a function formatting the labels OUTPUT: @@ -12512,10 +12295,9 @@ def _latex_transition_label_(self, transition, return (format_function(transition.word_in) + "\\mid " + format_function(transition.word_out)) - def intersection(self, other, only_accessible_components=True): """ - Returns a new transducer which accepts an input if it is accepted by + Return a new transducer which accepts an input if it is accepted by both given finite state machines producing the same output. INPUT: @@ -12817,14 +12599,9 @@ def final_function(*states): final_function=final_function, only_accessible_components=only_accessible_components) - def simplification(self): """ - Returns a simplified transducer. - - INPUT: - - Nothing. + Return a simplified transducer. OUTPUT: @@ -13221,10 +12998,10 @@ class is created and is used during the processing. result = super(Transducer, self).process(*args, **options) if (condensed_output and not result or - not options['full_output'] and result is None): - raise ValueError("Invalid input sequence.") + not options['full_output'] and result is None): + raise ValueError("Invalid input sequence.") if condensed_output and len(result) >= 2: - raise ValueError("Found more than one accepting path.") + raise ValueError("Found more than one accepting path.") if condensed_output: return result[0] @@ -13269,7 +13046,7 @@ def _process_convert_output_(self, output_data, **kwargs): return output -#***************************************************************************** +# **************************************************************************** class _FSMTapeCache_(SageObject): @@ -13367,14 +13144,9 @@ def __init__(self, tape_cache_manager, tape, tape_ended, self.tape_cache_manager.append(self) self.cache = tuple(collections.deque() for _ in self.tape) - def _repr_(self): """ - Returns a string representation of ``self``. - - INPUT: - - Nothing. + Return a string representation of ``self``. OUTPUT: @@ -13431,7 +13203,7 @@ def __deepcopy__(self, memo): def deepcopy(self, memo=None): """ - Returns a deepcopy of ``self``. + Return a deepcopy of ``self``. INPUT: @@ -13515,10 +13287,9 @@ def read(self, track_number): return (True, newval) - def finished(self, track_number=None): r""" - Returns whether the tape (or a particular track) has reached an + Return whether the tape (or a particular track) has reached an end, i.e., there are no more letters in the cache and nothing more to read on the original tape. @@ -13529,7 +13300,7 @@ def finished(self, track_number=None): OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` TESTS:: @@ -13684,7 +13455,7 @@ def preview_word(self, track_number=None, length=1, return_word=False): def compare_to_tape(self, track_number, word): """ - Returns whether it is possible to read ``word`` from the given + Return whether it is possible to read ``word`` from the given track successfully. INPUT: @@ -13695,7 +13466,7 @@ def compare_to_tape(self, track_number, word): OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` TESTS:: @@ -13945,7 +13716,7 @@ def _transition_possible_test_(self, word_in): for track_number, word in enumerate(word_in_transposed)) -#***************************************************************************** +# **************************************************************************** class _FSMTapeCacheDetectEpsilon_(_FSMTapeCache_): @@ -14017,7 +13788,7 @@ def _transition_possible_test_(self, word_in): return self._transition_possible_epsilon_(word_in) -#***************************************************************************** +# **************************************************************************** class _FSMTapeCacheDetectAll_(_FSMTapeCache_): @@ -14076,7 +13847,7 @@ def compare_to_tape(self, track_number, word): return True -#***************************************************************************** +# **************************************************************************** def tupleofwords_to_wordoftuples(tupleofwords): @@ -14129,13 +13900,14 @@ def wordoftuples_to_tupleofwords(wordoftuples): """ if not equal(len(t) for t in wordoftuples): raise ValueError("Not all entries of input have the same length.") + def remove_empty_letters(word): return [letter for letter in word if letter is not None] return tuple(remove_empty_letters(word) for word in zip(*wordoftuples)) -#***************************************************************************** +# **************************************************************************** def is_FSMProcessIterator(PI): @@ -14151,7 +13923,7 @@ def is_FSMProcessIterator(PI): return isinstance(PI, FSMProcessIterator) -#***************************************************************************** +# **************************************************************************** class FSMProcessIterator(SageObject, @@ -14407,11 +14179,7 @@ class Current(dict): """ def __repr__(self): """ - Returns a nice representation of ``self``. - - INPUT: - - Nothing. + Return a nice representation of ``self``. OUTPUT: @@ -14910,13 +14678,11 @@ def step(current_state, input_tape, outputs): return self._current_ - next = __next__ - def result(self, format_output=None): """ - Returns the already finished branches during process. + Return the already finished branches during process. INPUT: @@ -14963,7 +14729,7 @@ def result(self, format_output=None): def preview_word(self, track_number=None, length=1, return_word=False): """ - Reads a word from the input tape. + Read a word from the input tape. INPUT: @@ -15018,7 +14784,7 @@ def preview_word(self, track_number=None, length=1, return_word=False): track_number, length, return_word) -#***************************************************************************** +# **************************************************************************** class _FSMProcessIteratorEpsilon_(FSMProcessIterator): @@ -15465,7 +15231,7 @@ def __init__(self, *args, **kwargs): return super(_FSMProcessIteratorAll_, self).__init__(*args, **kwargs) -#***************************************************************************** +# **************************************************************************** @cached_function @@ -15475,14 +15241,6 @@ def setup_latex_preamble(): to the preamble of Latex so that the finite state machines can be drawn nicely. - INPUT: - - Nothing. - - OUTPUT: - - Nothing. - See the section on :ref:`finite_state_machine_LaTeX_output` in the introductory examples of this module. diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index dd8b1d07e3f..94e9d037fd6 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -507,6 +507,75 @@ def Tokuyama_coefficient(self, name='t'): return R.zero() return (t+1)**(self.number_of_special_entries()) * t**(self.number_of_boxes()) + def bender_knuth_involution(self,i): + r""" + Return the image of ``self`` under the `i`-th Bender-Knuth involution. + + If the triangle ``self`` has size `n` then this is defined for `0 < i < n`. + + The entries of ``self`` can take values in any ordered ring. Usually, + this will be the integers but can also be the rationals or the real numbers. + + This implements the construction of the Bender-Knuth involution using toggling + due to Berenstein-Kirillov. + + This agrees with the Bender-Knuth involution on semistandard tableaux. + + EXAMPLES:: + + sage: G = GelfandTsetlinPattern([[5,3,2,1,0],[4,3,2,0],[4,2,1],[3,2],[3]]) + sage: G.bender_knuth_involution(2) + [[5, 3, 2, 1, 0], [4, 3, 2, 0], [4, 2, 1], [4, 1], [3]] + + sage: G = GelfandTsetlinPattern([[3,2,0],[2.2,0],[2]]) + sage: G.bender_knuth_involution(2) + [[3, 2, 0], [2.80000000000000, 2], [2]] + + TESTS:: + + sage: all(all( G.bender_knuth_involution(i).to_tableau() == G.to_tableau().bender_knuth_involution(i) + ....: for i in range(1,len(G)) ) for G in GelfandTsetlinPatterns(top_row=[3,3,3,0,0])) + True + + sage: G = GelfandTsetlinPattern([[2,1,0],[1,0],[0]]) + sage: G.bender_knuth_involution(0) + Traceback (most recent call last): + ... + ValueError: must have 0 < 0 < 3 + sage: G.bender_knuth_involution(3) + Traceback (most recent call last): + ... + ValueError: must have 0 < 3 < 3 + + """ + #from copy import copy + n = len(self) + + def toggle(i,j): + """ + Return the toggle of entry 'G[i][j]' in a Gelfand-Tsetlin pattern, 'G'. + """ + if i == n-1: + return self[n-2][0]+self[n-2][1]-self[n-1][0] + + if j == 0: + left = self[i-1][0] + else: + left = min(self[i-1][j], self[i+1][j-1]) + if j == n-i-1: + right = self[i-1][j+1] + else: + right = max(self[i-1][j+1], self[i+1][j]) + + return left + right - self[i][j] + + if not 0 < i < n: + raise ValueError(f"must have 0 < {i} < {n}") + r = n-i + P = self.parent() + data = [list(row) for row in self] + data[r] = [toggle(r,s) for s in range(i)] + return P.element_class(P, data) class GelfandTsetlinPatterns(UniqueRepresentation, Parent): """ diff --git a/src/sage/combinat/integer_vectors_mod_permgroup.py b/src/sage/combinat/integer_vectors_mod_permgroup.py index 98f3c656469..684c7508564 100644 --- a/src/sage/combinat/integer_vectors_mod_permgroup.py +++ b/src/sage/combinat/integer_vectors_mod_permgroup.py @@ -1,14 +1,14 @@ r""" Integer vectors modulo the action of a permutation group """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2010-12 Nicolas Borie # # Distributed under the terms of the GNU General Public License (GPL) # # The full text of the GPL is available at: -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from __future__ import print_function from sage.structure.unique_representation import UniqueRepresentation @@ -24,6 +24,7 @@ from sage.combinat.integer_vector import IntegerVectors + class IntegerVectorsModPermutationGroup(UniqueRepresentation): r""" Returns an enumerated set containing integer vectors which are @@ -963,5 +964,5 @@ def check(self): if self.parent()._sum is not None: assert sum(self) == self.parent()._sum, '%s should be a integer vector of sum %s'%(self, self.parent()._sum) if self.parent()._max_part >= 0: - assert max(self) <= self.parent()._max_part, 'Entries of %s must be inferiors to %s'%(self, self.parent()._max_part) + assert max(self) <= self.parent()._max_part, 'Entries of %s must be inferior to %s'%(self, self.parent()._max_part) assert self.parent().is_canonical(self) diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index f6f892ba2d7..88233da3c29 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -1276,7 +1276,7 @@ def __init__(self, k, shape, weight): sage: TestSuite(T).run() """ self.k = k - self._skew = shape[1]!=[] + self._skew = bool(shape[1]) self._outer_shape = shape[0] self._inner_shape = shape[1] self._shape = (self._outer_shape, self._inner_shape) @@ -1742,7 +1742,7 @@ def __init__(self, k, shape, weight): sage: TestSuite(T).run() """ self.k = k - self._skew = shape[1]!=[] + self._skew = bool(shape[1]) self._outer_shape = Partition(shape[0]) self._inner_shape = Partition(shape[1]) self._shape = (self._outer_shape, self._inner_shape) @@ -2163,7 +2163,7 @@ def __init__(self, k, shape, weight): sage: TestSuite(T).run() # long time """ self.k = k - self._skew = shape[1]!=[] + self._skew = bool(shape[1]) self._outer_shape = Core(shape[0], k+1) self._inner_shape = Core(shape[1], k+1) self._shape = (self._outer_shape, self._inner_shape) @@ -4054,7 +4054,7 @@ def shape(self): sage: StrongTableaux( 4, [[2,1], [1]] ).shape() ([2, 1], [1]) """ - if self._inner_shape != []: + if self._inner_shape: return (self._outer_shape, self._inner_shape) return self._outer_shape diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py index 9727c06b6ef..81b65fd422e 100644 --- a/src/sage/combinat/partition.py +++ b/src/sage/combinat/partition.py @@ -258,7 +258,7 @@ sage: Partition(frobenius_coordinates=([6,1],[2,0])) [7, 3, 1] sage: all(mu == Partition(frobenius_coordinates=mu.frobenius_coordinates()) - ....: for n in range(30) for mu in Partitions(n)) + ....: for n in range(12) for mu in Partitions(n)) True We use the lexicographic ordering:: @@ -286,6 +286,7 @@ from sage.libs.all import pari from sage.libs.flint.arith import number_of_partitions as flint_number_of_partitions +from sage.arith.misc import multinomial from sage.structure.global_options import GlobalOptions from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation @@ -323,6 +324,7 @@ from sage.graphs.dot2tex_utils import have_dot2tex from sage.functions.other import binomial + class Partition(CombinatorialElement): r""" A partition `p` of a nonnegative integer `n` is a @@ -2802,12 +2804,14 @@ def top_garnir_tableau(self,e,cell): g=self.garnir_tableau(cell) # start with the Garnir tableau and modify - if e==0: return g # no more dominant tableau of the same residue + if e==0: + return g # no more dominant tableau of the same residue a=e*int((self[row]-col)/e) # number of cells in the e-bricks in row `row` b=e*int((col+1)/e) # number of cells in the e-bricks in row `row+1` - if a==0 or b==0: return g + if a==0 or b==0: + return g t=g.to_list() m=g[row+1][0] # smallest number in 0-Garnir belt @@ -3668,7 +3672,7 @@ def centralizer_size(self, t=0, q=0): sage: Partition([2,2,2]).aut() 48 """ - size = prod(i ** mi * factorial(mi) + size = prod(i**mi * factorial(mi) for i, mi in self.to_exp_dict().items()) if t or q: size *= prod((ZZ.one() - q ** j) / (ZZ.one() - t ** j) @@ -4347,7 +4351,7 @@ def is_core(self, k): :meth:`core`, :class:`Core` """ - return not k in self.hooks() + return k not in self.hooks() def k_interior(self, k): r""" @@ -5107,7 +5111,7 @@ def multinomial_with_partitions(sizes,path_counts): # if we know the total length alloted for each of the paths (sizes), and the number # of paths for each component. A multinomial picks the ordering of the components where # each step is taken. - return prod(path_counts) * factorial(sum(sizes)) / prod([factorial(_) for _ in sizes]) + return prod(path_counts) * multinomial(sizes) sizes = [larger_quotients[i].size()-smaller_quotients[i].size() for i in range(k)] path_counts = [larger_quotients[i].dimension(smaller_quotients[i]) for i in range(k)] @@ -6226,7 +6230,7 @@ def from_core_and_quotient(self, core, quotient): True """ from .partition_tuple import PartitionTuple, PartitionTuples - if not quotient in PartitionTuples(): + if quotient not in PartitionTuples(): raise ValueError('the quotient %s must be a tuple of partitions'%quotient) components = PartitionTuple(quotient).components() length = len(components) diff --git a/src/sage/combinat/partition_tuple.py b/src/sage/combinat/partition_tuple.py index f3b6c05e403..45b75b582e6 100644 --- a/src/sage/combinat/partition_tuple.py +++ b/src/sage/combinat/partition_tuple.py @@ -244,7 +244,7 @@ class of modules for the algebras, which are generalisations of the Specht """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2012 Andrew Mathas # # This program is free software: you can redistribute it and/or modify @@ -252,7 +252,7 @@ class of modules for the algebras, which are generalisations of the Specht # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from __future__ import print_function, absolute_import import itertools @@ -264,7 +264,7 @@ class of modules for the algebras, which are generalisations of the Specht from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets from sage.groups.perm_gps.permgroup import PermutationGroup -from sage.interfaces.all import gp +from sage.libs.pari.all import pari from sage.misc.cachefunc import cached_method from sage.rings.all import NN, ZZ, IntegerModRing from sage.rings.integer import Integer @@ -272,10 +272,11 @@ class of modules for the algebras, which are generalisations of the Specht from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation - -#-------------------------------------------------- +# ------------------------------------------------- # Partition tuple - element class -#-------------------------------------------------- +# ------------------------------------------------- + + class PartitionTuple(CombinatorialElement): r""" A tuple of :class:`Partition`. @@ -554,7 +555,7 @@ def _repr_list(self): sage: PartitionTuple(([2,1],[3,2],[1,1,1]))._repr_list() '([2, 1], [3, 2], [1, 1, 1])' """ - return '('+', '.join(nu._repr_() for nu in self)+')' + return '(' + ', '.join(nu._repr_() for nu in self) + ')' def _repr_exp_low(self): """ @@ -613,12 +614,11 @@ def _repr_compact_high(self): return '%s' % '|'.join(mu._repr_compact_high() for mu in self) # override default string representation which is str(self._list) - __str__=lambda self: self._repr_() - + __str__ = lambda self: self._repr_() def _latex_(self): r""" - Returns a LaTeX version of ``self``. + Return a LaTeX version of ``self``. For more on the latex options, see :meth:`Partitions.option`. @@ -686,7 +686,8 @@ def _latex_young_diagram(self): sage: mu = PartitionTuple([[2, 1],[1,1,1]])._latex_young_diagram() """ from sage.combinat.output import tex_from_array_tuple - return tex_from_array_tuple([ [["\\phantom{x}"]*row for row in mu] for mu in self._list ]) + return tex_from_array_tuple([[["\\phantom{x}"] * row for row in mu] + for mu in self._list]) def _latex_diagram(self): """ @@ -698,7 +699,8 @@ def _latex_diagram(self): """ entry = self.parent().options("latex_diagram_str") from sage.combinat.output import tex_from_array_tuple - return tex_from_array_tuple([ [[entry]*row for row in mu] for mu in self._list ], with_lines=False) + return tex_from_array_tuple([[[entry] * row for row in mu] + for mu in self._list], with_lines=False) def _latex_list(self): """ @@ -718,8 +720,10 @@ def _latex_exp_low(self): sage: mu = PartitionTuple([[2, 1],[1,1,1,1,1,1,1,1,1,1]])._latex_exp_low() """ - return '(%s)' % '|'.join(','.join('%s%s'%(a+1,'' if e==1 else '^{%s}'%e) - for (a,e) in enumerate(mu)) for mu in self.to_exp()) + txt = '|'.join(','.join('%s%s' % (a + 1, '' if e == 1 else '^{%s}' % e) + for a, e in enumerate(mu)) + for mu in self.to_exp()) + return '(' + txt + ')' def _latex_exp_high(self): """ @@ -729,9 +733,10 @@ def _latex_exp_high(self): sage: mu = PartitionTuple([[2, 1],[1,1,1,1,1,1,1,1,1,1]])._latex_exp_high() """ - return '(%s)' % '|'.join(','.join(['%s%s'%(a+1,'' if e==1 else '^{%s}'%e) - for (a,e) in enumerate(mu)][::-1]) for mu in self.to_exp()) - + txt = '|'.join(','.join(['%s%s' % (a + 1, '' if e == 1 else '^{%s}' % e) + for a, e in enumerate(mu)][::-1]) + for mu in self.to_exp()) + return '(' + txt + ')' def components(self): r""" @@ -758,8 +763,7 @@ def components(self): *** ** """ - return [ t for t in self ] - + return [t for t in self] def diagram(self): r""" @@ -784,7 +788,7 @@ def diagram(self): *** ** - * sage: PartitionTuples.options._reset() """ - col_len = [len(mu)>0 and mu[0] or 1 for mu in self] # columns per component + col_len = [mu and mu[0] or 1 for mu in self] # columns per component row_max = max(len(mu) for mu in self) # maximum row length # There should be a fancier list compression for this but I couldn't get # one to work in the cases where a component was the empty partition @@ -807,7 +811,6 @@ def diagram(self): ferrers_diagram = diagram - def pp(self): r""" Pretty prints this partition tuple. See :meth:`diagram`. @@ -822,7 +825,6 @@ def pp(self): """ print(self.diagram()) - def size(self): """ Return the size of a partition tuple. @@ -943,7 +945,7 @@ def cells(self): def content(self, k,r,c, multicharge): r""" - Returns the content of the cell. + Return the content of the cell. Let `m_k =` ``multicharge[k]``, then the content of a cell is `m_k + c - r`. @@ -1002,8 +1004,10 @@ def content_tableau(self,multicharge): 2 """ from sage.combinat.tableau_tuple import TableauTuple - return TableauTuple([[[multicharge[k]-r+c for c in range(self[k][r])] - for r in range(len(self[k]))] for k in range(len(self))]) + return TableauTuple([[[multicharge[k] - r + c + for c in range(self[k][r])] + for r in range(len(self[k]))] + for k in range(len(self))]) def conjugate(self): """ @@ -1016,7 +1020,6 @@ def conjugate(self): sage: PartitionTuple([[2,1],[1],[1,1,1]]).conjugate() ([3], [1], [2, 1]) - """ return PartitionTuple([nu.conjugate() for nu in self[::-1]]) @@ -1054,22 +1057,25 @@ def dominates(self, mu): except ValueError: raise ValueError('%s must be a PartitionTuple' % mu) - if mu==self: return True - level=0 - ssum=0 # sum of successive rows in self - musum=0 # sum of successive rows in self + if mu == self: + return True + level = 0 + ssum = 0 # sum of successive rows in self + musum = 0 # sum of successive rows in self while levelssum: return False + if musum>ssum: + return False row+=1 if rowssum: return False + if musum>ssum: + return False level+=1 return True @@ -1245,12 +1251,14 @@ def top_garnir_tableau(self,e,cell): g=self.garnir_tableau(cell) - if e==0: return # no more dominant tableau of the same residue + if e==0: + return # no more dominant tableau of the same residue a=e*int((self[comp][row]-col)/e) # number of cells in the e-bricks in row `row` b=e*int((col+1)/e) # number of cells in the e-bricks in row `row+1` - if a==0 or b==0: return self.garnir_tableau(cell) + if a==0 or b==0: + return self.garnir_tableau(cell) t=g.to_list() m=t[comp][row+1][0] # smallest number of 0-Garnir belt @@ -1325,7 +1333,7 @@ def leg_length(self, k,r,c): def contains(self, mu): r""" - Returns ``True`` if this partition tuple contains `\mu`. + Return ``True`` if this partition tuple contains `\mu`. If `\lambda=(\lambda^{(1)}, \ldots, \lambda^{(l)})` and `\mu=(\mu^{(1)}, \ldots, \mu^{(m)})` are two partition tuples then @@ -1377,7 +1385,7 @@ def to_exp(self, k=0): def removable_cells(self): """ - Returns a list of the removable cells of this partition tuple. + Return a list of the removable cells of this partition tuple. All indices are of the form ``(k, r, c)``, where ``r`` is the row-index, ``c`` is the column index and ``k`` is the component. @@ -1413,7 +1421,7 @@ def addable_cells(self): outside_corners = addable_cells # for compatibility with partitions - def add_cell(self, k,r,c): + def add_cell(self, k, r, c): r""" Return the partition tuple obtained by adding a cell in row ``r``, column ``c``, and component ``k``. @@ -1424,17 +1432,18 @@ def add_cell(self, k,r,c): sage: PartitionTuple([[1,1],[4,3],[2,1,1]]).add_cell(0,0,1) ([2, 1], [4, 3], [2, 1, 1]) - """ - if (k,r,c) in self.addable_cells(): # an addable cell - mu=self.to_list() - if c==0: mu[k].append(1) - else: mu[k][r]+=1 + if (k, r, c) in self.addable_cells(): # an addable cell + mu = self.to_list() + if c == 0: + mu[k].append(1) + else: + mu[k][r] += 1 return PartitionTuple(mu) else: - raise ValueError("%s is not an addable cell"%((k,r,c),)) + raise ValueError("%s is not an addable cell" % ((k, r, c),)) - def remove_cell(self, k,r,c): + def remove_cell(self, k, r, c): """ Return the partition tuple obtained by removing a cell in row ``r``, column ``c``, and component ``k``. @@ -1445,14 +1454,13 @@ def remove_cell(self, k,r,c): sage: PartitionTuple([[1,1],[4,3],[2,1,1]]).remove_cell(0,1,0) ([1], [4, 3], [2, 1, 1]) - """ - if (k,r,c) in self.removable_cells(): # a removable cell - mu=self.to_list() - mu[k][r]-=1 + if (k, r, c) in self.removable_cells(): # a removable cell + mu = self.to_list() + mu[k][r] -= 1 return PartitionTuple(mu) else: - raise ValueError("%s is not a removable cell"%((k,r,c),)) + raise ValueError("%s is not a removable cell" % ((k, r, c),)) def to_list(self): r""" @@ -1468,7 +1476,7 @@ def to_list(self): sage: all(mu==PartitionTuple(mu.to_list()) for mu in PartitionTuples(4,4)) True """ - return [ mu.to_list() for mu in self] + return [mu.to_list() for mu in self] def young_subgroup(self): """ @@ -1480,14 +1488,14 @@ def young_subgroup(self): sage: PartitionTuple([[2,1],[4,2],[1]]).young_subgroup() Permutation Group with generators [(), (8,9), (6,7), (5,6), (4,5), (1,2)] """ - gens=[] - m=0 + gens = [] + m = 0 for comp in self: for row in comp: - gens.extend([(c,c+1) for c in range(m+1,m+row)]) - m+=row - gens.append(list(range(1,self.size()+1))) # to ensure we get a subgroup of Sym_n - return PermutationGroup( gens ) + gens.extend([(c, c+1) for c in range(m+1, m+row)]) + m += row + gens.append(list(range(1, self.size()+1))) # to ensure we get a subgroup of Sym_n + return PermutationGroup(gens) def young_subgroup_generators(self): """ @@ -1499,12 +1507,12 @@ def young_subgroup_generators(self): sage: PartitionTuple([[2,1],[4,2],[1]]).young_subgroup_generators() [1, 4, 5, 6, 8] """ - gens=[] - m=0 + gens = [] + m = 0 for comp in self: for row in comp: - gens.extend([c for c in range(m+1,m+row)]) - m+=row + gens.extend([c for c in range(m + 1, m + row)]) + m += row return gens @cached_method @@ -1757,9 +1765,11 @@ def defect(self, e, multicharge): return (sum(beta.get(r, 0) for r in multicharge) - sum(beta[r]**2 - beta[r] * beta.get(Ie(r+1), 0) for r in beta)) -#-------------------------------------------------- +# ------------------------------------------------- # Partition tuples - parent classes -#-------------------------------------------------- +# ------------------------------------------------- + + class PartitionTuples(UniqueRepresentation, Parent): """ Class of all partition tuples. @@ -2017,7 +2027,7 @@ def _an_element_(self): sage: PartitionTuples().an_element() ([1, 1, 1, 1], [2, 1, 1], [3, 1], [4]) """ - return PartitionTuple( ([1,1,1,1],[2,1,1],[3,1],[4]) ) + return PartitionTuple(([1, 1, 1, 1], [2, 1, 1], [3, 1], [4])) class PartitionTuples_all(PartitionTuples): @@ -2110,7 +2120,7 @@ def __init__(self, level): Partition tuples of level 6 sage: TestSuite( PartitionTuples(level=4) ).run() """ - if not level in NN: + if level not in NN: raise ValueError('level must be a non-negative integer') super(PartitionTuples_level, self).__init__(category=InfiniteEnumeratedSets()) self._level=level @@ -2193,7 +2203,7 @@ def _an_element_(self): sage: PartitionTuples(level=4).an_element() ([], [1], [2], [3]) """ - return self.element_class(self, tuple([l] for l in range(self.level()) )) + return self.element_class(self, tuple([l] for l in range(self.level()))) class PartitionTuples_size(PartitionTuples): @@ -2202,7 +2212,7 @@ class PartitionTuples_size(PartitionTuples): """ def __init__(self, size): r""" - Initializes this class. + Initialize this class. EXAMPLES:: @@ -2213,7 +2223,7 @@ def __init__(self, size): sage: TestSuite( PartitionTuples(size=6) ).run() """ - if not size in NN: + if size not in NN: raise ValueError('size must be a non-negative integer') super(PartitionTuples_size, self).__init__(category=InfiniteEnumeratedSets()) self._size=size @@ -2298,7 +2308,7 @@ def _an_element_(self): sage: PartitionTuples(size=4).an_element() ([1], [1], [1], [1]) """ - return self.element_class(self, tuple([1] for l in range(self._size) )) + return self.element_class(self, tuple([1] for l in range(self._size))) class PartitionTuples_level_size(PartitionTuples): @@ -2391,7 +2401,6 @@ def __iter__(self): for cp in itertools.product(*[p[i] for i in iv]): yield self._element_constructor_(cp) - def _an_element_(self): """ Return a generic element. @@ -2401,9 +2410,10 @@ def _an_element_(self): sage: PartitionTuples(level=4,size=4).an_element() ([1], [], [], [3]) """ - mu=[[] for l in range(self._level)] + mu = [[] for l in range(self._level)] if self._size > 0: - if self._level == 1: mu=[self._size-1,1] + if self._level == 1: + mu=[self._size-1,1] else: mu[0]=[1] mu[-1]=[self._size-1] @@ -2411,9 +2421,9 @@ def _an_element_(self): def cardinality(self): r""" - Returns the number of ``level``-tuples of partitions of size ``n``. + Return the number of ``level``-tuples of partitions of size ``n``. - Wraps a pari function call. + Wraps a pari function call using :pari:`eta`. EXAMPLES:: @@ -2438,7 +2448,8 @@ def cardinality(self): These answers were checked against Gap4 (the last of which takes an awful long time for gap to compute). """ - return ZZ(gp.eval('polcoeff((1/eta(x+O(x^%s)))^%s, %s, x)'%(self.size()+1,self.level(), self.size()))) + eta = pari(f'Ser(x,x,{self.size()})').eta() + return ZZ((1 / eta**self.level()).polcoef(self.size(), pari('x'))) def __setstate__(self, state): r""" @@ -2461,7 +2472,8 @@ def __setstate__(self, state): super(PartitionTuples, self).__setstate__(state) ############################################################################### -## Regular partition tuples +# Regular partition tuples + class RegularPartitionTuples(PartitionTuples): r""" @@ -2537,6 +2549,7 @@ def _an_element_(self): elt = RegularPartitionTuples_level_size(lvl, size, self._ell).an_element() return self.element_class(self, list(elt)) + class RegularPartitionTuples_all(RegularPartitionTuples): r""" Class of `\ell`-regular partition tuples. @@ -2684,6 +2697,7 @@ def __iter__(self): for mu in RegularPartitionTuples_level_size(self._level, size, self._ell): yield self.element_class(self, list(mu)) + class RegularPartitionTuples_size(RegularPartitionTuples): r""" Class of `\ell`-regular partition tuples with a fixed size. @@ -2741,9 +2755,10 @@ def __contains__(self, mu): sage: [4, 3, 2] in RPT True """ - return ( (mu in RegularPartitions_all(self._ell) and self._size == sum(mu)) - or (RegularPartitionTuples.__contains__(self, mu) and self._size == sum(map(sum,mu))) - ) + return ((mu in RegularPartitions_all(self._ell) + and self._size == sum(mu)) + or (RegularPartitionTuples.__contains__(self, mu) + and self._size == sum(map(sum, mu)))) def __iter__(self): r""" diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index de9c28a785a..082bffcbd3b 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -99,7 +99,7 @@ def linear_extension(self): r""" Return a linear extension - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[1,2],1:[3],2:[3],3:[]}) @@ -113,7 +113,7 @@ def linear_extensions(self): r""" Return an iterator over all linear extensions. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[1,2],1:[3],2:[3],3:[]}) @@ -144,7 +144,7 @@ def greedy_linear_extensions_iterator(self): [0, 1, 2, 3, 4] [0, 2, 3, 1, 4] - TESTS: + TESTS:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: list(HasseDiagram({}).greedy_linear_extensions_iterator()) @@ -244,7 +244,7 @@ def is_linear_extension(self, lin_ext=None): r""" Test if an ordering is a linear extension. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[1,2],1:[3],2:[3],3:[]}) @@ -268,7 +268,7 @@ def cover_relations_iterator(self): r""" Iterate over cover relations. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) @@ -282,7 +282,7 @@ def cover_relations(self): r""" Return the list of cover relations. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) @@ -293,15 +293,15 @@ def cover_relations(self): def is_lequal(self, i, j): """ - Return True if i is less than or equal to j in the poset, and - False otherwise. + Return ``True`` if i is less than or equal to j in the poset, and + ``False`` otherwise. .. note:: If the :meth:`lequal_matrix` has been computed, then this method is redefined to use the cached data (see :meth:`_alternate_is_lequal`). - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2], 1:[2], 2:[3], 3:[4], 4:[]}) @@ -321,10 +321,10 @@ def is_lequal(self, i, j): def is_less_than(self, x, y): r""" - Return True if ``x`` is less than or equal to ``y`` in the - poset, and False otherwise. + Return ``True`` if ``x`` is less than or equal to ``y`` in the + poset, and ``False`` otherwise. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2], 1:[2], 2:[3], 3:[4], 4:[]}) @@ -342,8 +342,7 @@ def is_less_than(self, x, y): """ if x == y: return False - else: - return self.is_lequal(x, y) + return self.is_lequal(x, y) def is_gequal(self, x, y): r""" @@ -443,7 +442,7 @@ def bottom(self): def has_bottom(self): """ - Return True if the poset has a unique minimal element. + Return ``True`` if the poset has a unique minimal element. EXAMPLES:: @@ -492,8 +491,8 @@ def has_top(self): def is_bounded(self): """ - Return True if the poset contains a unique maximal element and a - unique minimal element, and False otherwise. + Return ``True`` if the poset contains a unique maximal element and a + unique minimal element, and ``False`` otherwise. EXAMPLES:: @@ -508,7 +507,7 @@ def is_bounded(self): def is_chain(self): """ - Return True if the poset is totally ordered, and False otherwise. + Return ``True`` if the poset is totally ordered, and ``False`` otherwise. EXAMPLES:: @@ -556,6 +555,10 @@ def dual(self): """ Return a poset that is dual to the given poset. + This means that it has the same elements but opposite order. + The elements are renumbered to ensure that ``range(n)`` + is a linear extension. + EXAMPLES:: sage: P = posets.IntegerPartitions(4) @@ -631,8 +634,9 @@ def _alternate_interval(self, x, y): def interval(self, x, y): r""" Return a list of the elements `z` of ``self`` such that - `x \leq z \leq y`. The order is that induced by the - ordering in ``self.linear_extension``. + `x \leq z \leq y`. + + The order is that induced by the ordering in ``self.linear_extension``. INPUT: @@ -657,9 +661,9 @@ def interval(self, x, y): def open_interval(self, x, y): """ - Return a list of the elements `z` of ``self`` such that - `x < z < y`. The order is that induced by the ordering in - ``self.linear_extension``. + Return a list of the elements `z` of ``self`` such that `x < z < y`. + + The order is that induced by the ordering in ``self.linear_extension``. EXAMPLES:: @@ -828,7 +832,7 @@ def rank(self, element=None): def is_ranked(self): r""" - Return True if the poset is ranked, and False otherwise. + Return ``True`` if the poset is ranked, and ``False`` otherwise. A poset is *ranked* if it admits a rank function. For more information about the rank function, see :meth:`~rank_function` @@ -847,7 +851,7 @@ def is_ranked(self): def covers(self, x, y): """ - Return True if y covers x and False otherwise. + Return ``True`` if y covers x and ``False`` otherwise. EXAMPLES:: @@ -1428,8 +1432,10 @@ def _meet(self): def meet_matrix(self): r""" - Return the matrix of meets of ``self``. The ``(x,y)``-entry of - this matrix is the meet of ``x`` and ``y`` in ``self``. + Return the matrix of meets of ``self``. + + The ``(x,y)``-entry of this matrix is the meet of ``x`` and + ``y`` in ``self``. This algorithm is modelled after the algorithm of Freese-Jezek-Nation (p217). It can also be found on page 140 of [Gec81]_. @@ -2100,7 +2106,7 @@ def are_incomparable(self, i, j): INPUT: - - ``i``, ``j`` -- vertices of this Hasse diagram + - ``i``, ``j`` -- vertices of this Hasse diagram EXAMPLES:: @@ -2140,7 +2146,7 @@ def antichains(self, element_class=list): INPUT: - - ``element_class`` -- (default:list) an iterable type + - ``element_class`` -- (default:list) an iterable type EXAMPLES:: @@ -2160,8 +2166,6 @@ def antichains(self, element_class=list): sage: TestSuite(A).run() - TESTS:: - sage: A = Poset()._hasse_diagram.antichains() sage: list(A) [[]] @@ -2209,7 +2213,7 @@ def chains(self, element_class=list, exclude=None): [[], [0], [0, 1], [0, 2], [1], [2]] The ``element_class`` keyword determines how the chains are - being returned: + being returned:: sage: P = Poset({1: [2, 3], 2: [4]}) sage: list(P._hasse_diagram.chains(element_class=tuple)) @@ -2217,7 +2221,7 @@ def chains(self, element_class=list, exclude=None): sage: list(P._hasse_diagram.chains()) [[], [0], [0, 1], [0, 1, 2], [0, 2], [0, 3], [1], [1, 2], [2], [3]] - (Note that taking the Hasse diagram has renamed the vertices.) + (Note that taking the Hasse diagram has renamed the vertices.) :: sage: list(P._hasse_diagram.chains(element_class=tuple, exclude=[0])) [(), (1,), (1, 2), (2,), (3,)] diff --git a/src/sage/combinat/q_analogues.py b/src/sage/combinat/q_analogues.py index e096fbbaa87..8d9016cc65e 100644 --- a/src/sage/combinat/q_analogues.py +++ b/src/sage/combinat/q_analogues.py @@ -86,8 +86,16 @@ def q_factorial(n, q=None): """ Return the `q`-analogue of the factorial `n!`. - If `q` is unspecified, then it defaults to using the generator `q` for - a univariate polynomial ring over the integers. + This is the product + + .. MATH:: + + [1]_q [2]_q \cdots [n]_q + = 1 \cdot (1+q) \cdot (1+q+q^2) \cdots (1+q+q^2+\cdots+q^{n-1}) . + + If `q` is unspecified, then this function defaults to + using the generator `q` for a univariate polynomial + ring over the integers. EXAMPLES:: diff --git a/src/sage/combinat/root_system/reflection_group_complex.py b/src/sage/combinat/root_system/reflection_group_complex.py index ce474eca551..746cdb8b55a 100644 --- a/src/sage/combinat/root_system/reflection_group_complex.py +++ b/src/sage/combinat/root_system/reflection_group_complex.py @@ -214,10 +214,9 @@ from sage.modules.free_module_element import vector from sage.combinat.root_system.cartan_matrix import CartanMatrix from sage.rings.universal_cyclotomic_field import UniversalCyclotomicField - - from sage.misc.sage_eval import sage_eval + class ComplexReflectionGroup(UniqueRepresentation, PermutationGroup_generic): """ A complex reflection group given as a permutation group. @@ -476,7 +475,7 @@ def distinguished_reflections(self): sage: W = ReflectionGroup((1,1,3),hyperplane_index_set=['a','b','c']) # optional - gap3 sage: W.distinguished_reflections() # optional - gap3 - Finite family {'a': (1,4)(2,3)(5,6), 'c': (1,5)(2,4)(3,6), 'b': (1,3)(2,5)(4,6)} + Finite family {'a': (1,4)(2,3)(5,6), 'b': (1,3)(2,5)(4,6), 'c': (1,5)(2,4)(3,6)} sage: W = ReflectionGroup((3,1,1)) # optional - gap3 sage: W.distinguished_reflections() # optional - gap3 @@ -673,7 +672,7 @@ def reflections(self): sage: W = ReflectionGroup((1,1,3),reflection_index_set=['a','b','c']) # optional - gap3 sage: W.reflections() # optional - gap3 - Finite family {'a': (1,4)(2,3)(5,6), 'c': (1,5)(2,4)(3,6), 'b': (1,3)(2,5)(4,6)} + Finite family {'a': (1,4)(2,3)(5,6), 'b': (1,3)(2,5)(4,6), 'c': (1,5)(2,4)(3,6)} sage: W = ReflectionGroup((3,1,1)) # optional - gap3 sage: W.reflections() # optional - gap3 @@ -965,9 +964,8 @@ def conjugacy_classes_representatives(self): [1, 2, 1, 2, 1, 3, 2, 1, 2, 1, 3, 2, 1, 2, 3]] """ # This can be converted to usual GAP - S = str(gap3('List(ConjugacyClasses(%s),Representative)'%self._gap_group._name)) - exec('_conjugacy_classes_representatives=' + _gap_return(S)) - return _conjugacy_classes_representatives + S = str(gap3('List(ConjugacyClasses(%s),Representative)' % self._gap_group._name)) + return sage_eval(_gap_return(S), {'self': self}) def conjugacy_classes(self): r""" @@ -1316,7 +1314,7 @@ def independent_roots(self): basis = {} for ind in self._index_set: vec = Delta[ind] - if Matrix(basis.values()+[vec]).rank() == len(basis) + 1: + if Matrix(list(basis.values()) + [vec]).rank() == len(basis) + 1: basis[ind] = vec return Family(basis) @@ -1365,7 +1363,7 @@ def roots(self): (0, 0, 0, -E(3), E(3)^2), (0, 0, 0, E(3)^2, -E(3)^2), (0, 0, 0, -E(3)^2, E(3)^2)] """ - roots = [vector(sage_eval(str(root).replace("^","**"))) + roots = [vector(sage_eval(str(root).replace("^", "**"))) for root in self._gap_group.roots] for v in roots: v.set_immutable() @@ -1380,15 +1378,15 @@ def braid_relations(self): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: W.braid_relations() # optional - gap3 - [[[2, 1, 2], [1, 2, 1]]] + [[[1, 2, 1], [2, 1, 2]]] sage: W = ReflectionGroup((2,1,3)) # optional - gap3 sage: W.braid_relations() # optional - gap3 - [[[2, 1, 2, 1], [1, 2, 1, 2]], [[3, 1], [1, 3]], [[3, 2, 3], [2, 3, 2]]] + [[[1, 2, 1, 2], [2, 1, 2, 1]], [[1, 3], [3, 1]], [[2, 3, 2], [3, 2, 3]]] sage: W = ReflectionGroup((2,2,3)) # optional - gap3 sage: W.braid_relations() # optional - gap3 - [[[2, 1, 2], [1, 2, 1]], [[3, 1], [1, 3]], [[3, 2, 3], [2, 3, 2]]] + [[[1, 2, 1], [2, 1, 2]], [[1, 3], [3, 1]], [[2, 3, 2], [3, 2, 3]]] """ if self.is_real(): return super(ComplexReflectionGroup,self).braid_relations() diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index ed552674922..50d63f5855d 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -39,6 +39,40 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): """ An element in a complex reflection group. """ + def __hash__(self): + r""" + Return a hash for this reflection group element. + + This hash stores both the element as a reduced word and the parent group. + + EXAMPLES:: + + sage: W = ReflectionGroup(['A',5]) # optional - gap3 + sage: W_hash = set(hash(w) for w in W) # optional - gap3 + sage: len(W_hash) == W.cardinality() # optional - gap3 + True + + TESTS: + + Check that types B and C are hashed differently, see :trac:`29726`:: + + sage: WB = ReflectionGroup(['B',5]) # optional - gap3 + sage: WC = ReflectionGroup(['C',5]) # optional - gap3 + + sage: WB_hash = set(hash(w) for w in WB) # optional - gap3 + sage: WC_hash = set(hash(w) for w in WC) # optional - gap3 + + sage: len(WB_hash) == WB.cardinality() # optional - gap3 + True + + sage: len(WC_hash) == WC.cardinality() # optional - gap3 + True + + sage: WB_hash.intersection(WC_hash) # optional - gap3 + set() + """ + return hash(self._parent) | hash(tuple(self._reduced_word)) + def reduced_word(self): r""" Return a word in the simple reflections to obtain ``self``. @@ -423,7 +457,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): (1,2,6)(3,4,5) True (1,5)(2,4)(3,6) True """ - return PermutationGroupElement(self) + W = self._parent + return PermutationGroupElement(self, W) #@cached_in_parent_method def fix_space(self): @@ -465,8 +500,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): Basis matrix: [ 1 -1] - sage: W = ReflectionGroup(23) # optional - gap3 - sage: W.an_element().fix_space() # optional - gap3 + sage: W = ReflectionGroup(23) # optional - gap3 + sage: W.gen(0).fix_space() # optional - gap3 Vector space of degree 3 and dimension 2 over Universal Cyclotomic Field Basis matrix: [0 1 0] @@ -1175,4 +1210,3 @@ def _gap_return(S, coerce_obj='self'): S = S.replace(' ','').replace('\n','') S = S.replace(',(','\',check=False),%s(\'('%coerce_obj).replace('[','[%s(\''%coerce_obj).replace(']','\',check=False)]') return S - diff --git a/src/sage/combinat/root_system/reflection_group_real.py b/src/sage/combinat/root_system/reflection_group_real.py index 339278dc360..395bdb52cab 100644 --- a/src/sage/combinat/root_system/reflection_group_real.py +++ b/src/sage/combinat/root_system/reflection_group_real.py @@ -406,10 +406,26 @@ def cartan_type(self): sage: W = ReflectionGroup(['A',3], ['B',3]) # optional - gap3 sage: W.cartan_type() # optional - gap3 A3xB3 relabelled by {1: 3, 2: 2, 3: 1} + + TESTS: + + Check that dihedral types are handled properly:: + + sage: W = ReflectionGroup(['I',3]); W # optional - gap3 + Irreducible real reflection group of rank 2 and type A2 + + sage: W = ReflectionGroup(['I',4]); W # optional - gap3 + Irreducible real reflection group of rank 2 and type C2 + + sage: W = ReflectionGroup(['I',5]); W # optional - gap3 + Irreducible real reflection group of rank 2 and type I2(5) """ if len(self._type) == 1: ct = self._type[0] - C = CartanType([ct['series'], ct['rank']]) + if ct['series'] == "I": + C = CartanType([ct['series'], ct['bond']]) + else: + C = CartanType([ct['series'], ct['rank']]) CG = C.coxeter_diagram() G = self.coxeter_diagram() return C.relabel(CG.is_isomorphic(G, edge_labels=True, certificate=True)[1]) diff --git a/src/sage/combinat/root_system/root_lattice_realizations.py b/src/sage/combinat/root_system/root_lattice_realizations.py index 76e5773d09f..4a1ec72bedc 100644 --- a/src/sage/combinat/root_system/root_lattice_realizations.py +++ b/src/sage/combinat/root_system/root_lattice_realizations.py @@ -3130,8 +3130,8 @@ def plot_crystal(self, crystal, sage: L = RootSystem(['A',2]).ambient_space() sage: C = crystals.Tableaux(['A',2], shape=[2,1]) - sage: L.plot_crystal(C) - Graphics object consisting of 16 graphics primitives + sage: L.plot_crystal(C, plot_labels='multiplicities') + Graphics object consisting of 15 graphics primitives sage: C = crystals.Tableaux(['A',2], shape=[8,4]) sage: p = L.plot_crystal(C, plot_labels='circles') sage: p.show(figsize=15) diff --git a/src/sage/combinat/set_partition_ordered.py b/src/sage/combinat/set_partition_ordered.py index aaeedf7b11d..b47f027614b 100644 --- a/src/sage/combinat/set_partition_ordered.py +++ b/src/sage/combinat/set_partition_ordered.py @@ -10,7 +10,7 @@ - Travis Scrimshaw (2013-02-28): Removed ``CombinatorialClass`` and added entry point through :class:`OrderedSetPartition`. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2007 Mike Hansen , # # Distributed under the terms of the GNU General Public License (GPL) @@ -23,15 +23,13 @@ # The full text of the GPL is available at: # # https://www.gnu.org/licenses/ -#***************************************************************************** - -from sage.arith.all import factorial +# **************************************************************************** +from sage.arith.all import factorial, multinomial from sage.sets.set import Set, Set_generic from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets from sage.sets.finite_enumerated_set import FiniteEnumeratedSet from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass -from sage.misc.all import prod from sage.structure.parent import Parent from sage.structure.element import parent from sage.structure.unique_representation import UniqueRepresentation @@ -184,10 +182,11 @@ def __classcall_private__(cls, parts=None, from_word=None): if from_word: return OrderedSetPartitions().from_finite_word(Words()(from_word)) # if `parts` looks like a sequence of "letters" then treat it like a word. - if parts in Words() or (len(parts) > 0 and (parts[0] in ZZ or isinstance(parts[0], str))): + if parts in Words() or (parts and (parts[0] in ZZ or isinstance(parts[0], str))): return OrderedSetPartitions().from_finite_word(Words()(parts)) else: - P = OrderedSetPartitions( reduce(lambda x,y: x.union(y), map(Set, parts), Set([])) ) + P = OrderedSetPartitions(reduce(lambda x, y: x.union(y), + parts, frozenset())) return P.element_class(P, parts) def __init__(self, parent, s): @@ -200,10 +199,9 @@ def __init__(self, parent, s): sage: s = OS([[1, 3], [2, 4]]) sage: TestSuite(s).run() """ - self._base_set = reduce(lambda x,y: x.union(y), map(Set, s), Set([])) + self._base_set = reduce(lambda x, y: x.union(y), map(Set, s), Set([])) ClonableArray.__init__(self, parent, [Set(_) for _ in s]) - def _repr_(self): """ Return a string representation of ``self``. @@ -368,7 +366,7 @@ def reversed(self): [] """ par = parent(self) - return par(list(reversed(list(self)))) + return par(list(reversed(self))) def complement(self): r""" @@ -478,7 +476,7 @@ def is_finer(self, co2): """ co1 = self if co1.base_set() != co2.base_set(): - raise ValueError("ordered set partitions self (= %s) and co2 (= %s) must be of the same set"%(self, co2)) + raise ValueError("ordered set partitions self (= %s) and co2 (= %s) must be of the same set" % (self, co2)) i1 = 0 for j2 in co2: @@ -664,7 +662,6 @@ def strongly_finer(self): return FiniteEnumeratedSet([par(sum((list(P) for P in C), [])) for C in cartesian_product([[buo(X, comp) for comp in Compositions(len(X))] for X in self])]) - def is_strongly_finer(self, co2): r""" Return ``True`` if the ordered set partition ``self`` is strongly @@ -761,11 +758,12 @@ def strongly_fatter(self): [[{4}, {1, 5}, {3}], [{4}, {1}, {5}, {3}]] """ c = [sorted(X) for X in self] - l = len(c) - g = [-1] + [i for i in range(l-1) if c[i][-1] > c[i+1][0]] + [l-1] + l = len(c) - 1 + g = [-1] + [i for i in range(l) if c[i][-1] > c[i + 1][0]] + [l] # g lists the positions of the blocks that cannot be merged # with their right neighbors. - subcomps = [OrderedSetPartition(c[g[i] + 1 : g[i+1] + 1]) for i in range(len(g)-1)] + subcomps = [OrderedSetPartition(c[g[i] + 1: g[i + 1] + 1]) + for i in range(len(g) - 1)] # Now, self is the concatenation of the entries of subcomps. # We can fatten each of the ordered set partitions setcomps # arbitrarily, and then concatenate the results. @@ -902,7 +900,7 @@ def __classcall_private__(cls, s=None, c=None): if isinstance(c, (int, Integer)): return OrderedSetPartitions_sn(s, c) if c not in Compositions(len(s)): - raise ValueError("c must be a composition of %s"%len(s)) + raise ValueError("c must be a composition of %s" % len(s)) return OrderedSetPartitions_scomp(s, Composition(c)) def __init__(self, s): @@ -928,7 +926,7 @@ def _element_constructor_(self, s): [{1, 3}, {2, 4}] """ if isinstance(s, OrderedSetPartition): - raise ValueError("cannot convert %s into an element of %s"%(s, self)) + raise ValueError("cannot convert %s into an element of %s" % (s, self)) return self.element_class(self, list(s)) Element = OrderedSetPartition @@ -953,21 +951,21 @@ def __contains__(self, x): if not isinstance(x, (OrderedSetPartition, list, tuple)): return False - #The total number of elements in the list - #should be the same as the number is self._set + # The total number of elements in the list + # should be the same as the number is self._set if sum(map(len, x)) != len(self._set): return False - #Check to make sure each element of the list - #is a nonempty set + # Check to make sure each element of the list + # is a nonempty set u = Set([]) for s in x: if not s or not isinstance(s, (set, frozenset, Set_generic)): return False u = u.union(s) - #Make sure that the union of all the - #sets is the original set + # Make sure that the union of all the + # sets is the original set if u != Set(self._set): return False @@ -1056,6 +1054,7 @@ def __iter__(self): for z in OrderedSetPartitions(self._set, x): yield self.element_class(self, z) + class OrderedSetPartitions_sn(OrderedSetPartitions): def __init__(self, s, n): """ @@ -1129,7 +1128,7 @@ def __iter__(self): [{3}, {1, 2, 4}], [{4}, {1, 2, 3}]] """ - for x in Compositions(len(self._set),length=self.n): + for x in Compositions(len(self._set), length=self.n): for z in OrderedSetPartitions_scomp(self._set, x): yield self.element_class(self, z) @@ -1193,7 +1192,7 @@ def cardinality(self): sage: OrderedSetPartitions(5, [2,0,3]).cardinality() 10 """ - return factorial(len(self._set)) / prod([factorial(i) for i in self.c]) + return multinomial(self.c) def __iter__(self): """ @@ -1251,6 +1250,7 @@ def __iter__(self): yield self.element_class(self, [Set(res[dcomp[i]+1:dcomp[i+1]+1]) for i in range(l)]) + class OrderedSetPartitions_all(OrderedSetPartitions): r""" Ordered set partitions of `\{1, \ldots, n\}` for all @@ -1297,9 +1297,9 @@ def _element_constructor_(self, s): """ if isinstance(s, OrderedSetPartition): gset = s.parent()._set - if gset == frozenset(range(1,len(gset)+1)): + if gset == frozenset(range(1, len(gset) + 1)): return self.element_class(self, list(s)) - raise ValueError("cannot convert %s into an element of %s"%(s, self)) + raise ValueError("cannot convert %s into an element of %s" % (s, self)) return self.element_class(self, list(s)) def __contains__(self, x): @@ -1405,7 +1405,8 @@ def __setstate__(self, state): self.__class__ = OrderedSetPartitions_scomp n = state['_n'] k = state['_k'] - OrderedSetPartitions_scomp.__init__(self, range(state['_n']), (k,n-k)) + OrderedSetPartitions_scomp.__init__(self, range(state['_n']), (k, n-k)) + from sage.misc.persist import register_unpickle_override register_unpickle_override("sage.combinat.split_nk", "SplitNK_nk", SplitNK) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index f65ea34ed69..678e065d96b 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -20,7 +20,9 @@ #***************************************************************************** from . import multiplicative, classical from sage.combinat.partition import Partition - +from sage.misc.all import prod +from sage.functions.other import factorial, binomial +from sage.rings.all import infinity ################################### # # @@ -305,6 +307,220 @@ def expand(self, n, alphabet='x'): condition = lambda part: max(part) > n return self._expand(condition, n, alphabet) + + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. + + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + (using Gaussian binomial coefficients `\binom{u}{v}_q`): + + .. MATH:: + + ps_{n,q}(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} \binom{n}{\lambda_i}_q, + + ps_{n,1}(e_\lambda) = \prod_i \binom{n}{\lambda_i}, + + ps_q(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} / \prod_{j=1}^{\lambda_i} (1-q^j). + + EXAMPLES:: + + sage: e = SymmetricFunctions(QQ).e() + sage: x = e[3,1] + sage: x.principal_specialization(3) + q^5 + q^4 + q^3 + sage: x = 5*e[1,1,1] + 3*e[2,1] + 1 + sage: x.principal_specialization(3) + 5*q^6 + 18*q^5 + 36*q^4 + 44*q^3 + 36*q^2 + 18*q + 6 + + By default, we return a rational functions in `q`. Sometimes + it is better to obtain an element of the symbolic ring:: + + sage: x.principal_specialization(q=var("q")) + -3*q/((q^2 - 1)*(q - 1)^2) - 5/(q - 1)^3 + 1 + + TESTS:: + + sage: e.zero().principal_specialization(3) + 0 + + """ + from sage.combinat.q_analogues import q_binomial + + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), "q") + + if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") + f = lambda partition: prod(binomial(n, part) for part in partition) + elif n == infinity: + f = lambda partition: prod(q**binomial(part, 2)/prod((1-q**i) + for i in range(1,part+1)) + for part in partition) + else: + f = lambda partition: prod(q**binomial(part, 2)*q_binomial(n, part, q=q) + for part in partition) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + + def exponential_specialization(self, t=None, q=1): + r""" + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). + + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps_q(f), + + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) + + The limit of `ex_q` as `q \to 1` is `ex`. + + INPUT: + + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. + + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. + + EXAMPLES:: + + sage: e = SymmetricFunctions(QQ).e() + sage: x = e[3,2] + sage: x.exponential_specialization() + 1/12*t^5 + sage: x = 5*e[2] + 3*e[1] + 1 + sage: x.exponential_specialization(t=var("t"), q=var("q")) + 5*q*t^2/(q + 1) + 3*t + 1 + + TESTS:: + + sage: e.zero().exponential_specialization() + 0 + + """ + from sage.combinat.q_analogues import q_factorial + + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q == 1: + if t is None: + t = get_variable(self.base_ring(), 't') + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= factorial(part) + return t**n/m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') + elif q is None: + q = get_variable(t.parent(), 'q') + elif t is None: + t = get_variable(q.parent(), 't') + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= q**binomial(part, 2)/q_factorial(part, q=q) + + return t**n * m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.elementary', 'SymmetricFunctionAlgebraElement_elementary', SymmetricFunctionAlgebra_elementary.Element) diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 3e5462d1742..497e30bf709 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -28,6 +28,9 @@ #################################### from . import multiplicative, classical from sage.combinat.partition import Partition +from sage.rings.all import infinity +from sage.misc.all import prod +from sage.functions.other import factorial, binomial class SymmetricFunctionAlgebra_homogeneous(multiplicative.SymmetricFunctionAlgebra_multiplicative): def __init__(self, Sym): @@ -223,6 +226,219 @@ def expand(self, n, alphabet='x'): condition = lambda part: False return self._expand(condition, n, alphabet) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. + + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + (using Gaussian binomial coefficients `\binom{u}{v}_q`): + + .. MATH:: + + ps_{n,q}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i}_q, + + ps_{n,1}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i}, + + ps_q(h_\lambda) = 1 / \prod_i \prod_{j=1}^{\lambda_i} (1-q^j). + + EXAMPLES:: + + sage: h = SymmetricFunctions(QQ).h() + sage: x = h[2,1] + sage: x.principal_specialization(3) + q^6 + 2*q^5 + 4*q^4 + 4*q^3 + 4*q^2 + 2*q + 1 + sage: x = 3*h[2] + 2*h[1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 2*(q^3 - 1)/(q - 1) + 3*(q^4 - 1)*(q^3 - 1)/((q^2 - 1)*(q - 1)) + 1 + + TESTS:: + + sage: x = h.zero() + sage: s = x.principal_specialization(3); s + 0 + + """ + from sage.combinat.q_analogues import q_binomial + + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), 'q') + + if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") + f = lambda partition: prod(binomial(n+part-1, part) for part in partition) + elif n == infinity: + f = lambda partition: prod(1/prod((1-q**i) for i in range(1, part+1)) for part in partition) + else: + f = lambda partition: prod(q_binomial(n+part-1, part, q=q) for part in partition) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + + def exponential_specialization(self, t=None, q=1): + r""" + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). + + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps_q(f), + + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) + + The limit of `ex_q` as `q \to 1` is `ex`. + + INPUT: + + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. + + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. + + EXAMPLES:: + + sage: h = SymmetricFunctions(QQ).h() + sage: x = h[5,3] + sage: x.exponential_specialization() + 1/720*t^8 + sage: factorial(5)*factorial(3) + 720 + + sage: x = 5*h[1,1,1] + 3*h[2,1] + 1 + sage: x.exponential_specialization() + 13/2*t^3 + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(h[3].exponential_specialization(q=var("q"), t=var("t"))) + t^3/((q^2 + q + 1)*(q + 1)) + + TESTS:: + + sage: x = h.zero() + sage: s = x.exponential_specialization(); s + 0 + + """ + from sage.combinat.q_analogues import q_factorial + + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q == 1: + if t is None: + t = get_variable(self.base_ring(), 't') + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= factorial(part) + return t**n/m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') + elif q is None: + q = get_variable(t.parent(), 'q') + elif t is None: + t = get_variable(q.parent(), 't') + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= q_factorial(part, q=q) + return t**n/m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.homogeneous', 'SymmetricFunctionAlgebraElement_homogeneous', SymmetricFunctionAlgebra_homogeneous.Element) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index d40d31ef49f..60c05831742 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -22,7 +22,10 @@ from . import classical import sage.libs.symmetrica.all as symmetrica from sage.rings.integer import Integer +from sage.rings.infinity import infinity from sage.combinat.partition import Partition, _Partitions +from sage.functions.other import factorial, binomial +from sage.arith.misc import multinomial class SymmetricFunctionAlgebra_monomial(classical.SymmetricFunctionAlgebra_classical): def __init__(self, Sym): @@ -306,6 +309,184 @@ def condition(part): return len(part) > n return self._expand(condition, n, alphabet) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. + + For ``q=1`` and finite ``n`` we use the formula from + Proposition 7.8.3 of [EnumComb2]_: + + .. MATH:: + + ps_{n,1}(m_\lambda) = \binom{n}{\ell(\lambda)} + \binom{\ell(\lambda)}{m_1(\lambda), m_2(\lambda),\dots}, + + where `\ell(\lambda)` denotes the length of `\lambda`. + + In all other cases, we convert to complete homogeneous + symmetric functions. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: x = m[3,1] + sage: x.principal_specialization(3) + q^7 + q^6 + q^5 + q^3 + q^2 + q + + sage: x = 5*m[2] + 3*m[1] + 1 + sage: x.principal_specialization(3, q=var("q")) + -10*(q^3 - 1)*q/(q - 1) + 5*(q^3 - 1)^2/(q - 1)^2 + 3*(q^3 - 1)/(q - 1) + 1 + + TESTS:: + + sage: m.zero().principal_specialization(3) + 0 + + """ + if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") + f = lambda partition: binomial(n, len(partition))*multinomial(partition.to_exp()) + return self.parent()._apply_module_morphism(self, f, q.parent()) + + # heuristically, it seems fastest to fall back to the + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis + return self.parent().realization_of().elementary()(self).principal_specialization(n=n, q=q) + + def exponential_specialization(self, t=None, q=1): + r""" + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). + + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps_q(f), + + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) + + The limit of `ex_q` as `q \to 1` is `ex`. + + INPUT: + + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. + + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: (m[3]+m[2,1]+m[1,1,1]).exponential_specialization() + 1/6*t^3 + + sage: x = 5*m[1,1,1] + 3*m[2,1] + 1 + sage: x.exponential_specialization() + 5/6*t^3 + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(m[3].exponential_specialization(q=var("q"), t=var("t"))) + (q - 1)^2*t^3/(q^2 + q + 1) + + TESTS:: + + sage: m.zero().exponential_specialization() + 0 + + """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q == 1: + if t is None: + t = get_variable(self.base_ring(), 't') + def f(partition): + n = 0 + for part in partition: + if part != 1: + return 0 + n += 1 + return t**n/factorial(n) + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + # heuristically, it seems fastest to fall back to the + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis + return self.parent().realization_of().elementary()(self).exponential_specialization(t=t, q=q) # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 80d820ace7a..63cd8165d76 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -21,6 +21,9 @@ from . import sfa, multiplicative, classical from sage.combinat.partition import Partition from sage.arith.all import divisors +from sage.rings.all import infinity +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.misc.all import prod class SymmetricFunctionAlgebra_power(multiplicative.SymmetricFunctionAlgebra_multiplicative): def __init__(self, Sym): @@ -704,6 +707,234 @@ def eval_at_permutation_roots(self, rho): p.eval_at_permutation_roots_on_generators(k, rho) for k in lam) return p._apply_module_morphism(self, on_basis, R) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. + + We use the formulas from Proposition 7.8.3 of [EnumComb2]_: + + .. MATH:: + + ps_{n,q}(p_\lambda) = \prod_i (1-q^{n\lambda_i}) / (1-q^{\lambda_i}), + + ps_{n,1}(p_\lambda) = n^{\ell(\lambda)}, + + ps_q(p_\lambda) = 1 / \prod_i (1-q^{\lambda_i}), + + where `\ell(\lambda)` denotes the length of `\lambda`, + and where the products range from `i=1` to `i=\ell(\lambda)`. + + EXAMPLES:: + + sage: p = SymmetricFunctions(QQ).p() + sage: x = p[8,7,3,1] + sage: x.principal_specialization(3, q=var("q")) + (q^24 - 1)*(q^21 - 1)*(q^9 - 1)/((q^8 - 1)*(q^7 - 1)*(q - 1)) + + sage: x = 5*p[1,1,1] + 3*p[2,1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 5*(q^3 - 1)^3/(q - 1)^3 + 3*(q^6 - 1)*(q^3 - 1)/((q^2 - 1)*(q - 1)) + 1 + + By default, we return a rational function in `q`:: + + sage: x.principal_specialization(3) + 8*q^6 + 18*q^5 + 36*q^4 + 38*q^3 + 36*q^2 + 18*q + 9 + + If ``n`` is not given we return the stable principal specialization:: + + sage: x.principal_specialization(q=var("q")) + 3/((q^2 - 1)*(q - 1)) - 5/(q - 1)^3 + 1 + + TESTS:: + + sage: p.zero().principal_specialization(3) + 0 + + """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), 'q') + + if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") + f = lambda partition: n**len(partition) + elif n == infinity: + f = lambda partition: prod(1/(1-q**part) for part in partition) + else: + from sage.rings.integer_ring import ZZ + ZZq = PolynomialRing(ZZ, "q") + q_lim = ZZq.gen() + def f(partition): + denom = prod((1-q**part) for part in partition) + try: + ~denom + rational = prod((1-q**(n*part)) for part in partition)/denom + return q.parent()(rational) + except (ZeroDivisionError, NotImplementedError, TypeError): + # If denom is not invertible, we need to do the + # computation with universal coefficients instead: + quotient = ZZq(prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition)) + return quotient.subs({q_lim: q}) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + def exponential_specialization(self, t=None, q=1): + r""" + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). + + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps_q(f), + + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) + + The limit of `ex_q` as `q \to 1` is `ex`. + + INPUT: + + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. + + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. + + EXAMPLES:: + + sage: p = SymmetricFunctions(QQ).p() + sage: x = p[8,7,3,1] + sage: x.exponential_specialization() + 0 + sage: x = p[3] + 5*p[1,1] + 2*p[1] + 1 + sage: x.exponential_specialization(t=var("t")) + 5*t^2 + 2*t + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(p[3].exponential_specialization(q=var("q"), t=var("t"))) + (q - 1)^2*t^3/(q^2 + q + 1) + + TESTS:: + + sage: p.zero().exponential_specialization() + 0 + + """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q == 1: + if t is None: + t = get_variable(self.base_ring(), 't') + + def f(partition): + n = 0 + for part in partition: + if part != 1: + return 0 + n += 1 + return t**n + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') + elif q is None: + q = get_variable(t.parent(), 'q') + elif t is None: + t = get_variable(q.parent(), 't') + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= 1-q**part + return (1-q)**n * t**n / m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.powersum', 'SymmetricFunctionAlgebraElement_power', SymmetricFunctionAlgebra_power.Element) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index b945e6e2991..eb079c6f0ff 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -20,7 +20,11 @@ from . import classical import sage.libs.lrcalc.lrcalc as lrcalc - +from sage.misc.all import prod +from sage.rings.infinity import infinity +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.functions.other import factorial +from sage.combinat.tableau import StandardTableaux class SymmetricFunctionAlgebra_schur(classical.SymmetricFunctionAlgebra_classical): def __init__(self, Sym): @@ -570,6 +574,260 @@ def expand(self, n, alphabet='x'): condition = lambda part: len(part) > n return self._expand(condition, n, alphabet) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. + + For `q=1` we use the formula from Corollary 7.21.4 of [EnumComb2]_: + + .. MATH:: + + ps_{n,1}(s_\lambda) = \prod_{u\in\lambda} (n+c(u)) / h(u), + + where `h(u)` is the hook length of a cell `u` in `\lambda`, + and where `c(u)` is the content of a cell `u` in `\lambda`. + + For `n=infinity` we use the formula from Corollary 7.21.3 of [EnumComb2]_ + + .. MATH:: + + ps_q(s_\lambda) = q^{\sum_i (i-1)\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}). + + Otherwise, we use the formula from Theorem 7.21.2 of [EnumComb2]_, + + .. MATH:: + + ps_{n,q}(s_\lambda) = q^{\sum_i (i-1)\lambda_i} + \prod_{u\in\lambda} (1-q^{n+c(u)})/(1-q^{h(u)}). + + EXAMPLES:: + + sage: s = SymmetricFunctions(QQ).s() + sage: x = s[2] + sage: x.principal_specialization(3) + q^4 + q^3 + 2*q^2 + q + 1 + + sage: x = 3*s[2,2] + 2*s[1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 3*(q^4 - 1)*(q^3 - 1)*q^2/((q^2 - 1)*(q - 1)) + 2*(q^3 - 1)/(q - 1) + 1 + + sage: x.principal_specialization(q=var("q")) + -2/(q - 1) + 3*q^2/((q^3 - 1)*(q^2 - 1)^2*(q - 1)) + 1 + + TESTS:: + + sage: s.zero().principal_specialization(3) + 0 + + """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), 'q') + if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") + f = lambda partition: (prod(n+j-i for (i, j) in partition.cells()) + // prod(h for h in partition.hooks())) + elif n == infinity: + f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) + / prod(1-q**h for h in partition.hooks())) + else: + from sage.rings.integer_ring import ZZ + ZZq = PolynomialRing(ZZ, "q") + q_lim = ZZq.gen() + def f(partition): + if n < len(partition): + return 0 + power = q**sum(i*part for i, part in enumerate(partition)) + denom = prod(1-q**h for h in partition.hooks()) + try: + ~denom + rational = (power + * prod(1-q**(n+j-i) + for (i, j) in partition.cells()) + / denom) + return q.parent()(rational) + except (ZeroDivisionError, NotImplementedError, TypeError): + # If denom is not invertible, we need to do the + # computation with universal coefficients instead: + quotient = ZZq((prod(1-q_lim**(n+j-i) + for (i, j) in partition.cells())) + / prod(1-q_lim**h for h in partition.hooks())) + return (power * quotient.subs({q_lim: q})) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + + def exponential_specialization(self, t=None, q=1): + r""" + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). + + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps_q(f), + + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) + + The limit of `ex_q` as `q \to 1` is `ex`. + + INPUT: + + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. + + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. + + We use the formula in the proof of Corollary 7.21.6 of + [EnumComb2]_ + + .. MATH:: + + ex_{q}(s_\lambda) = t^{|\lambda|} q^{\sum_i (i-1)\lambda_i} + / \prod_{u\in\lambda} (1 + q + q^2 + \dots + q^{h(u)-1}) + + where `h(u)` is the hook length of a cell `u` in `\lambda`. + + As a limit case, we obtain a formula for `q=1` + + .. MATH:: + + ex_{1}(s_\lambda) = f^\lambda t^{|\lambda|} / |\lambda|! + + where `f^\lambda` is the number of standard Young + tableaux of shape `\lambda`. + + EXAMPLES:: + + sage: s = SymmetricFunctions(QQ).s() + sage: x = s[5,3] + sage: x.exponential_specialization() + 1/1440*t^8 + + sage: x = 5*s[1,1,1] + 3*s[2,1] + 1 + sage: x.exponential_specialization() + 11/6*t^3 + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(s[3].exponential_specialization(q=var("q"), t=var("t"))) + t^3/((q^2 + q + 1)*(q + 1)) + + TESTS:: + + sage: s.zero().exponential_specialization() + 0 + + """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q == 1: + if t is None: + t = get_variable(self.base_ring(), 't') + + def f(partition): + n = partition.size() + return (StandardTableaux(partition).cardinality() + * t**n / factorial(n)) + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') + elif q is None: + q = get_variable(t.parent(), 'q') + elif t is None: + t = get_variable(q.parent(), 't') + + f = lambda partition: (t**partition.size() + * q**sum(i*part for i, part in enumerate(partition)) + / prod(sum(q**i for i in range(h)) for h in partition.hooks())) + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.schur', 'SymmetricFunctionAlgebraElement_schur', SymmetricFunctionAlgebra_schur.Element) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index df738714bb5..82bc94ba73b 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -213,7 +213,7 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from sage.misc.cachefunc import cached_method -from sage.rings.all import Integer, PolynomialRing, QQ, ZZ +from sage.rings.all import Integer, PolynomialRing, QQ, ZZ, infinity from sage.rings.polynomial.polynomial_element import is_Polynomial from sage.rings.polynomial.multi_polynomial import is_MPolynomial from sage.combinat.partition import _Partitions, Partitions, Partitions_n, Partition @@ -780,8 +780,9 @@ def gessel_reutenauer(self, lam): Let `\lambda` be a partition. The *Gessel-Reutenauer symmetric function* `\mathbf{GR}_\lambda` corresponding to `\lambda` is the symmetric function denoted `L_\lambda` in - [GR1993]_ and in Exercise 7.89 of [STA]_. It can be defined - in several ways: + [GR1993]_ and in Exercise 7.89 of [STA]_ and denoted + `\mathbf{GR}_\lambda` in Definition 6.6.34 of [GriRei18]_. + It can be defined in several ways: - It is the sum of the monomials `\mathbf{x}_w` over all words `w` over the alphabet @@ -798,15 +799,15 @@ def gessel_reutenauer(self, lam): - It is the sum of the fundamental quasisymmetric functions `F_{\operatorname{Des} \sigma}` over all - permutations `\sigma` which have cycle type `\lambda`. See + permutations `\sigma` that have cycle type `\lambda`. See :class:`sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Fundamental` for the definition of fundamental quasisymmetric functions, and :meth:`~sage.combinat.permutation.Permutation.cycle_type` for that of cycle type. For a permutation `\sigma`, we use `\operatorname{Des} \sigma` to denote the descent composition (:meth:`~sage.combinat.permutation.Permutation.descents_composition`) - of `\sigma`. Again, this definition makes the symmetry - of `\mathbf{GR}_\lambda` far from obvious. + of `\sigma`. Again, this definition does not make the + symmetry of `\mathbf{GR}_\lambda` obvious. - For every positive integer `n`, we have @@ -832,7 +833,9 @@ def gessel_reutenauer(self, lam): `\mathbf{GR}_\lambda` obvious. The equivalences of these three definitions are proven in - [GR1993]_ Sections 2-3. + [GR1993]_ Sections 2-3. (See also [GriRei18]_ Subsection + 6.6.2 for the equivalence of the first two definitions and + further formulas.) INPUT: @@ -853,6 +856,8 @@ def gessel_reutenauer(self, lam): Journal of Combinatorial Theory, Series A, 64 (1993), pp. 189--215. + .. [GriRei18]_ + EXAMPLES: The first few values of `\mathbf{GR}_{(n)} = L_n`:: @@ -5437,6 +5442,395 @@ def character_to_frobenius_image(self, n): return self.parent()(p.sum(self.eval_at_permutation_roots(rho) \ *p(rho)/rho.centralizer_size() for rho in Partitions(n))) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: x = m[1,1] + sage: x.principal_specialization(3) + q^3 + q^2 + q + + By default we return a rational function in ``q``. Sometimes + it is better to obtain an element of the symbolic ring:: + + sage: h = SymmetricFunctions(QQ).h() + sage: (h[3]+h[2]).principal_specialization(q=var("q")) + 1/((q^2 - 1)*(q - 1)) - 1/((q^3 - 1)*(q^2 - 1)*(q - 1)) + + In case ``q`` is in the base ring, it must be passed explicitly:: + + sage: R = QQ['q,t'] + sage: Ht = SymmetricFunctions(R).macdonald().Ht() + sage: Ht[2].principal_specialization() + Traceback (most recent call last): + ... + ValueError: the variable q is in the base ring, pass it explicitly + + sage: Ht[2].principal_specialization(q=R("q")) + (q^2 + 1)/(q^3 - q^2 - q + 1) + + Note that the principal specialization can be obtained as a plethysm:: + + sage: R = QQ['q'].fraction_field() + sage: s = SymmetricFunctions(R).s() + sage: one = s.one() + sage: q = R("q") + sage: f = s[3,2,2] + sage: f.principal_specialization(q=q) == f(one/(1-q)).coefficient([]) + True + sage: f.principal_specialization(n=4, q=q) == f(one*(1-q^4)/(1-q)).coefficient([]) + True + + TESTS:: + + sage: m = SymmetricFunctions(QQ).m() + sage: m.zero().principal_specialization(3) + 0 + + sage: x = 5*m[1,1,1] + 3*m[2,1] + 1 + sage: x.principal_specialization(3) + 3*q^5 + 6*q^4 + 5*q^3 + 6*q^2 + 3*q + 1 + + Check that the principal specializations in different bases + are all the same. When specific implementations for further + bases are added, this test should be adapted:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[2,1] + sage: len(set([b(x).principal_specialization(n=3) for b in B])) + 1 + sage: len(set([b(x).principal_specialization() for b in B])) + 1 + sage: len(set([b(x).principal_specialization(n=4, q=1) for b in B])) + 1 + sage: len(set([b(x).principal_specialization(n=4, q=2) for b in B])) + 1 + + Check that the stable principal specialization at `q = 1` + raises a ``ValueError``: + + sage: def test_error(x): + ....: message = "the stable principal specialization of %s at q=1 should raise a ValueError" + ....: try: + ....: x.principal_specialization(q=1) + ....: except ValueError as e: + ....: return(e) + ....: except StandardError as e: + ....: raise ValueError((message + ", but raised '%s' instead") % (x, e)) + ....: raise ValueError((message + ", but didn't") % x) + + sage: set([str(test_error(b(x))) for b in B]) + {'the stable principal specialization at q=1 is not defined'} + + Check that specifying `q` which is a removable singularity works:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[2,2,1] + sage: set([b(x).principal_specialization(n=4, q=QQbar.zeta(3)) for b in B]) + {-3} + + sage: S = SymmetricFunctions(GF(3)) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[3,2,1] + sage: set([b(x).principal_specialization(n=4, q=GF(3)(2)) for b in B]) + {1} + + sage: S = SymmetricFunctions(Zmod(4)) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[3,2,1] + sage: set([b(x).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) + {0} + sage: y = m[3,1] + sage: set([b(y).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) + {2} + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: z = m[1,1] + sage: set([b(z).principal_specialization(n=4) for b in B]) + {q^5 + q^4 + 2*q^3 + q^2 + q} + + Check that parents are correct over `\mathbb{F}_3`:: + + sage: S = SymmetricFunctions(GF(3)) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].principal_specialization(n=2, q=GF(3)(0)).parent() for b in B for lam in lams) + {Finite Field of size 3} + sage: set(b[lam].principal_specialization(n=2, q=GF(3)(1)).parent() for b in B for lam in lams) + {Finite Field of size 3} + sage: set(b[lam].principal_specialization(n=2, q=GF(3)(2)).parent() for b in B for lam in lams) + {Finite Field of size 3} + sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Finite Field of size 3} + sage: set(b[lam].principal_specialization().parent() for b in B for lam in lams) + {Fraction Field of Univariate Polynomial Ring in q over Finite Field of size 3, + Univariate Polynomial Ring in q over Finite Field of size 3} + + sage: a = S.e()[2,1].principal_specialization(n=2, q=GF(3)(2)); a + 0 + sage: a = S.e()[1,1,1].principal_specialization(n=2); a + q^3 + 1 + + sage: set(b.one().principal_specialization(n=2, q=GF(3)(2)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2, q=GF(3)(1)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2) for b in B) + {1} + sage: set(b.one().principal_specialization() for b in B) + {1} + + Check that parents are correct over the integer ring:: + + sage: S = SymmetricFunctions(ZZ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].principal_specialization(n=2, q=0).parent() for b in B for lam in lams) + {Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=1).parent() for b in B for lam in lams) + {Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=2).parent() for b in B for lam in lams) + {Integer Ring} + sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: sorted(set(b[lam].principal_specialization().parent() for b in B for lam in lams), key=str) + [Fraction Field of Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Rational Field] + + Check that parents are correct over a polynomial ring:: + + sage: P = PolynomialRing(ZZ, "q") + sage: q = P.gen() + sage: S = SymmetricFunctions(P) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].principal_specialization(n=2, q=P(0)).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=P(1)).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=P(2)).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=q).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: sorted(set(b[lam].principal_specialization(q=q).parent() for b in B for lam in lams), key=str) + [Fraction Field of Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Rational Field] + + sage: a = S.e()[2,1].principal_specialization(n=2, q=2); a + 6 + sage: a = S.e()[2,1].principal_specialization(n=2, q=q); a + q^2 + q + + sage: set(b.one().principal_specialization(n=2, q=P(2)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2, q=P(1)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2, q=q) for b in B) + {1} + sage: set(b.one().principal_specialization(q=q) for b in B) + {1} + + """ + # heuristically, it seems fastest to fall back to the + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis + e = self.parent().realization_of().elementary() + return e(self).principal_specialization(n, q=q) + + def exponential_specialization(self, t=None, q=1): + r""" + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). + + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps_q(f), + + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) + + The limit of `ex_q` as `q \to 1` is `ex`. + + INPUT: + + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. + + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: (m[2,1]+m[1,1]).exponential_specialization() + 1/2*t^2 + sage: (m[2,1]+m[1,1]).exponential_specialization(q=1) + 1/2*t^2 + sage: m[1,1].exponential_specialization(q=None) + (q/(q + 1))*t^2 + sage: Qq = PolynomialRing(QQ, "q"); q = Qq.gen() + sage: m[1,1].exponential_specialization(q=q) + (q/(q + 1))*t^2 + sage: Qt = PolynomialRing(QQ, "t"); t = Qt.gen() + sage: m[1,1].exponential_specialization(t=t) + 1/2*t^2 + sage: Qqt = PolynomialRing(QQ, ["q", "t"]); q, t = Qqt.gens() + sage: m[1,1].exponential_specialization(q=q, t=t) + q*t^2/(q + 1) + + sage: x = m[3]+m[2,1]+m[1,1,1] + sage: d = x.homogeneous_degree() + sage: var("q t") + (q, t) + sage: factor((x.principal_specialization()*(1-q)^d*t^d)) + t^3/((q^2 + q + 1)*(q + 1)) + sage: factor(x.exponential_specialization(q=q, t=t)) + t^3/((q^2 + q + 1)*(q + 1)) + + TESTS:: + + sage: m = SymmetricFunctions(QQ).m() + sage: m.zero().exponential_specialization() + 0 + + Check that the exponential specializations in different bases + are all the same. When specific implementations for further + bases are added, this test should be adapted:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[3]+m[2,1]+m[1,1,1] + sage: len(set([b(x).exponential_specialization(q=None, t=None) for b in B])) + 1 + sage: len(set([b(x).exponential_specialization(q=1) for b in B])) + 1 + sage: len(set([b(x).exponential_specialization(q=2) for b in B])) + 1 + sage: len(set([b(x).exponential_specialization(t=2) for b in B])) + 1 + + Check that parents are correct over `\mathbb{F}_3`:: + + sage: S = SymmetricFunctions(GF(3)) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: sorted(set(b[lam].exponential_specialization(q=None).parent() for b in B for lam in lams), key=str) + [Univariate Polynomial Ring in t over Fraction Field + of Univariate Polynomial Ring in q over Finite Field of size 3, + Univariate Polynomial Ring in t over Univariate Polynomial Ring + in q over Finite Field of size 3] + sage: P2 = PolynomialRing(GF(3), ["q", "t"]) + sage: q2, t2 = P2.gens() + sage: sorted(set(b[lam].exponential_specialization(q=q2, t=t2).parent() for b in B for lam in lams), key=str) + [Fraction Field of Multivariate Polynomial Ring in q, t over Finite Field of size 3, + Multivariate Polynomial Ring in q, t over Finite Field of size 3] + + Check that parents are correct over `\QQ` for `q = 1`:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].exponential_specialization(q=1).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in t over Rational Field} + sage: set(b[lam].exponential_specialization(q=1, t=1).parent() for b in B for lam in lams) + {Rational Field} + sage: P2 = PolynomialRing(QQ, ["q", "t"]) + sage: q2, t2 = P2.gens() + sage: set(b[lam].exponential_specialization(q=1, t=t2).parent() for b in B for lam in lams) + {Multivariate Polynomial Ring in q, t over Rational Field} + + Check that parents are correct over a polynomial ring:: + + sage: P = PolynomialRing(QQ, "q") + sage: q = P.gen() + sage: S = SymmetricFunctions(P) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: sorted(set(b[lam].exponential_specialization(q=q).parent() for b in B for lam in lams), key=str) + [Univariate Polynomial Ring in t over + Fraction Field of Univariate Polynomial Ring in q over Rational Field, + Univariate Polynomial Ring in t over Univariate Polynomial Ring + in q over Rational Field] + sage: sorted(set(b[lam].exponential_specialization(q=q, t=1).parent() for b in B for lam in lams), key=str) + [Fraction Field of Univariate Polynomial Ring in q over Rational Field, + Univariate Polynomial Ring in q over Rational Field] + """ + # heuristically, it seems fastest to fall back to the + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis + e = self.parent().realization_of().elementary() + return e(self).exponential_specialization(t=t, q=q) + SymmetricFunctionAlgebra_generic.Element = SymmetricFunctionAlgebra_generic_Element diff --git a/src/sage/combinat/words/lyndon_word.py b/src/sage/combinat/words/lyndon_word.py index aaa16322e7a..a0539d49685 100644 --- a/src/sage/combinat/words/lyndon_word.py +++ b/src/sage/combinat/words/lyndon_word.py @@ -18,8 +18,7 @@ from sage.combinat.composition import Composition, Compositions from sage.rings.all import Integer -from sage.arith.all import factorial, divisors, gcd, moebius -from sage.misc.all import prod +from sage.arith.all import divisors, gcd, moebius, multinomial from sage.combinat.necklace import _sfc from sage.combinat.words.words import FiniteWords @@ -28,24 +27,26 @@ def LyndonWords(e=None, k=None): """ - Returns the combinatorial class of Lyndon words. + Return the combinatorial class of Lyndon words. A Lyndon word `w` is a word that is lexicographically less than all of its rotations. Equivalently, whenever `w` is split into two non-empty substrings, `w` is lexicographically less than the right substring. + See :wikipedia:`Lyndon_word` + INPUT: - no input at all or - - ``e`` - integer, size of alphabet - - ``k`` - integer, length of the words + - ``e`` -- integer, size of alphabet + - ``k`` -- integer, length of the words or - - ``e`` - a composition + - ``e`` -- a composition OUTPUT: @@ -94,15 +95,16 @@ def LyndonWords(e=None, k=None): raise TypeError("e must be a positive integer or a composition") + def LyndonWord(data, check=True): r""" Construction of a Lyndon word. INPUT: - - ``data`` - list - - ``check`` - bool (optional, default: True) if True, a - verification that the input data represent a Lyndon word. + - ``data`` -- list + - ``check`` -- bool (optional, default: ``True``) if ``True``, + check that the input data represents a Lyndon word. OUTPUT: @@ -119,13 +121,14 @@ def LyndonWord(data, check=True): ... ValueError: not a Lyndon word - If check is False, then no verification is done:: + If ``check`` is ``False``, then no verification is done:: sage: LyndonWord([2,1,2,3], check=False) word: 2123 """ return LyndonWords()(data, check=check) + class LyndonWords_class(UniqueRepresentation, Parent): r""" The set of all Lyndon words. @@ -185,6 +188,7 @@ def __contains__(self, w): w = self._words(w) return w.is_lyndon() + class LyndonWords_evaluation(UniqueRepresentation, Parent): r""" The set of Lyndon words on a fixed multiset of letters. @@ -222,7 +226,7 @@ def __repr__(self): sage: repr(LyndonWords([2,1,1])) 'Lyndon words with evaluation [2, 1, 1]' """ - return "Lyndon words with evaluation %s"%self._e + return "Lyndon words with evaluation %s" % self._e def __call__(self, *args, **kwds): r""" @@ -264,7 +268,7 @@ def __contains__(self, x): def cardinality(self): """ - Returns the number of Lyndon words with the evaluation e. + Return the number of Lyndon words with the evaluation e. EXAMPLES:: @@ -276,9 +280,7 @@ def cardinality(self): 30 Check to make sure that the count matches up with the number of - Lyndon words generated. - - :: + Lyndon words generated:: sage: comps = [[],[2,2],[3,2,7],[4,2]] + Compositions(4).list() sage: lws = [LyndonWords(comp) for comp in comps] @@ -287,12 +289,11 @@ def cardinality(self): """ evaluation = self._e le = list(evaluation) - if len(evaluation) == 0: - return 0 - + if not evaluation: + return Integer(0) n = sum(evaluation) - - return sum([moebius(j)*factorial(n/j) / prod([factorial(ni/j) for ni in evaluation]) for j in divisors(gcd(le))])/n + return sum(moebius(j) * multinomial([ni // j for ni in evaluation]) + for j in divisors(gcd(le))) // n def __iter__(self): """ @@ -330,19 +331,16 @@ def __iter__(self): """ if not self._e: return - k = 0 while self._e[k] == 0: k += 1 - for z in _sfc(self._e[k:], equality=True): - yield self._words([i+k+1 for i in z], check=False) + yield self._words([i + k + 1 for i in z], check=False) class LyndonWords_nk(UniqueRepresentation, Parent): r""" - Lyndon words of fixed length `k` over the alphabet - `\{1, 2, \ldots, n\}`. + Lyndon words of fixed length `k` over the alphabet `\{1, 2, \ldots, n\}`. INPUT: @@ -391,7 +389,7 @@ def __repr__(self): sage: repr(LyndonWords(2, 3)) 'Lyndon words from an alphabet of size 2 of length 3' """ - return "Lyndon words from an alphabet of size %s of length %s"%(self._n, self._k) + return "Lyndon words from an alphabet of size %s of length %s" % (self._n, self._k) def __call__(self, *args, **kwds): r""" @@ -444,8 +442,8 @@ def cardinality(self): else: s = Integer(0) for d in divisors(self._k): - s += moebius(d)*(self._n**(self._k/d)) - return s/self._k + s += moebius(d) * self._n**(self._k // d) + return s // self._k def __iter__(self): """ @@ -468,14 +466,17 @@ def __iter__(self): """ W = self._words._element_classes['list'] for lw in lyndon_word_iterator(self._n, self._k): - yield W(self._words, [i+1 for i in lw]) + yield W(self._words, [i + 1 for i in lw]) + def StandardBracketedLyndonWords(n, k): """ - Returns the combinatorial class of standard bracketed Lyndon words - from [1, ..., n] of length k. These are in one to one - correspondence with the Lyndon words and form a basis for the - subspace of degree k of the free Lie algebra of rank n. + Return the combinatorial class of standard bracketed Lyndon words + from [1, ..., n] of length k. + + These are in one to one correspondence with the Lyndon words and + form a basis for the subspace of degree k of the free Lie algebra + of rank n. EXAMPLES:: @@ -580,4 +581,3 @@ def standard_bracketing(lw): for i in range(1, len(lw)): if lw[i:] in LyndonWords(): return [standard_bracketing(lw[:i]), standard_bracketing(lw[i:])] - diff --git a/src/sage/cpython/getattr.pyx b/src/sage/cpython/getattr.pyx index 0e4f9a49698..94d1d7fabfb 100644 --- a/src/sage/cpython/getattr.pyx +++ b/src/sage/cpython/getattr.pyx @@ -411,7 +411,7 @@ cpdef getattr_from_other_class(self, cls, name): raise AttributeError(dummy_error_message) -def dir_with_other_class(self, cls): +def dir_with_other_class(self, *cls): r""" Emulates ``dir(self)``, as if self was also an instance ``cls``, right after ``caller_class`` in the method resolution order @@ -432,6 +432,10 @@ def dir_with_other_class(self, cls): sage: from sage.cpython.getattr import dir_with_other_class sage: dir_with_other_class(x, B) [..., 'a', 'b', 'c', 'd', 'e'] + sage: class C(object): + ....: f = 6 + sage: dir_with_other_class(x, B, C) + [..., 'a', 'b', 'c', 'd', 'e', 'f'] Check that objects without dicts are well handled:: @@ -459,6 +463,7 @@ def dir_with_other_class(self, cls): ret.update(dir(self.__class__)) if hasattr(self, "__dict__"): ret.update(list(self.__dict__)) - if not isinstance(self, cls): - ret.update(dir(cls)) + for c in cls: + if not isinstance(self, c): + ret.update(dir(c)) return sorted(ret) diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index b8fa05dfb12..370a444652f 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -105,7 +105,7 @@ ... -What does the Taylor expansion of the `e^(e^x-1)`` function have to do with +What does the Taylor expansion of the `e^{e^x-1}` function have to do with primes ? :: @@ -168,9 +168,12 @@ from sage.misc.misc import verbose from sage.misc.cachefunc import cached_method from sage.misc.flatten import flatten +from sage.misc.temporary_file import tmp_filename from sage.misc.unknown import Unknown from sage.misc.misc import embedded from sage.misc.html import HtmlFragment +from sage.repl.preparse import preparse + from collections import defaultdict import re @@ -183,7 +186,7 @@ def _fetch(url): INPUT: - - ``url`` - a string corresponding to the URL to be fetched. + - ``url`` -- a string corresponding to the URL to be fetched. OUTPUT: @@ -214,7 +217,7 @@ def _urls(html_string): INPUT: - - ``html_string`` - a string representing some HTML code. + - ``html_string`` -- a string representing some HTML code. OUTPUT: @@ -399,10 +402,10 @@ def find_by_id(self, ident, fetch=False): INPUT: - - ``ident`` - a string representing the A-number of the sequence + - ``ident`` -- a string representing the A-number of the sequence or an integer representing its number. - - ``fetch`` - (bool, default: ``False``) whether to force fetching the + - ``fetch`` -- (bool, default: ``False``) whether to force fetching the content of the sequence on the internet. OUTPUT: @@ -427,7 +430,7 @@ def find_by_entry(self, entry): INPUT: - - ``entry`` - a string corresponding to an entry in the internal format + - ``entry`` -- a string corresponding to an entry in the internal format of the OEIS. OUTPUT: @@ -452,13 +455,13 @@ def find_by_description(self, description, max_results=3, first_result=0): INPUT: - - ``description`` - (string) the description the searched sequences. + - ``description`` -- (string) the description the searched sequences. - - ``max_results`` - (integer, default: 3) the maximum number of results + - ``max_results`` -- (integer, default: 3) the maximum number of results we want. In any case, the on-line encyclopedia will not return more than 100 results. - - ``first_result`` - (integer, default: 0) allow to skip the + - ``first_result`` -- (integer, default: 0) allow to skip the ``first_result`` first results in the search, to go further. This is useful if you are looking for a sequence that may appear after the 100 first found sequences. @@ -506,11 +509,11 @@ def find_by_subsequence(self, subsequence, max_results=3, first_result=0): INPUT: - - ``subsequence`` - a list of integers. + - ``subsequence`` -- a list of integers. - - ``max_results`` - (integer, default: 3), the maximum of results requested. + - ``max_results`` -- (integer, default: 3), the maximum of results requested. - - ``first_result`` - (integer, default: 0) allow to skip the + - ``first_result`` -- (integer, default: 0) allow to skip the ``first_result`` first results in the search, to go further. This is useful if you are looking for a sequence that may appear after the 100 first found sequences. @@ -551,9 +554,9 @@ def _imaginary_entry(self, ident='A999999', keywords=''): INPUT: - - ``ident`` - a string representing the A-number of the sequence. + - ``ident`` -- a string representing the A-number of the sequence. - - ``keywords`` - a string corresponding to the keyword field of the + - ``keywords`` -- a string corresponding to the keyword field of the sequence. OUTPUT: @@ -595,7 +598,7 @@ def _imaginary_entry(self, ident='A999999', keywords=''): '%o ' + ident + ' def ' + ident + '(n):\n' '%o ' + ident + ' assert(isinstance(n, (int, Integer))), "n must be an integer."\n' '%o ' + ident + ' if n < 38:\n' - '%o ' + ident + ' raise ValueError("The value %s is not accepted." %str(n)))\n' + '%o ' + ident + ' raise ValueError("The value %s is not accepted." %str(n))\n' '%o ' + ident + ' elif n == 42:\n' '%o ' + ident + ' return 2\n' '%o ' + ident + ' else:\n' @@ -611,9 +614,9 @@ def _imaginary_sequence(self, ident='A999999', keywords='sign,easy'): INPUT: - - ``ident`` - a string representing the A-number of the sequence. + - ``ident`` -- a string representing the A-number of the sequence. - - ``keywords`` - string (default: 'sign,easy'), a list of words + - ``keywords`` -- string (default: 'sign,easy'), a list of words separated by commas. OUTPUT: @@ -632,6 +635,7 @@ def _imaginary_sequence(self, ident='A999999', keywords='sign,easy'): """ return self.find_by_entry(entry=self._imaginary_entry(ident=ident, keywords=keywords)) + class OEISSequence(SageObject, UniqueRepresentation): r""" The class of OEIS sequences. @@ -688,7 +692,7 @@ def __init__(self, ident): INPUT: - - ``ident`` - a string representing the A-number of the sequence or an + - ``ident`` -- a string representing the A-number of the sequence or an integer representing its number. TESTS:: @@ -749,7 +753,7 @@ def id(self, format='A'): INPUT: - - ``format`` - (string, default: 'A'). + - ``format`` -- (string, default: 'A'). OUTPUT: @@ -1076,7 +1080,7 @@ def natural_object(self): sage: s.natural_object().universe() Integer Ring """ - if 'cofr' in self.keywords() and not 'frac' in self.keywords(): + if 'cofr' in self.keywords() and 'frac' not in self.keywords(): from sage.rings.continued_fraction import continued_fraction return continued_fraction(self.first_terms()) elif 'cons' in self.keywords(): @@ -1099,7 +1103,7 @@ def is_dead(self, warn_only=False): INPUT: - - warn_only - (bool, default: ``False``), whether to warn when the + - warn_only -- (bool, default: ``False``), whether to warn when the sequence is dead instead of returning a boolean. EXAMPLES: @@ -1240,7 +1244,7 @@ def first_terms(self, number=None): INPUT: - - ``number`` - (integer or ``None``, default: ``None``) the number of + - ``number`` -- (integer or ``None``, default: ``None``) the number of terms returned (if less than the number of available terms). When set to None, returns all the known terms. @@ -1303,7 +1307,7 @@ def __call__(self, k): INPUT: - - ``k`` - integer. + - ``k`` -- integer. OUTPUT: @@ -1367,7 +1371,7 @@ def __getitem__(self, i): INPUT: - - ``i`` - integer. + - ``i`` -- integer. OUTPUT: @@ -1510,10 +1514,10 @@ def links(self, browse=None, format='guess'): INPUT: - - ``browse`` - an integer, a list of integers, or the word 'all' + - ``browse`` -- an integer, a list of integers, or the word 'all' (default: ``None``) : which links to open in a web browser. - - ``format`` - string (default: 'guess') : how to display the links. + - ``format`` -- string (default: 'guess') : how to display the links. OUTPUT: @@ -1612,7 +1616,7 @@ def cross_references(self, fetch=False): INPUT: - - ``fetch`` - boolean (default: ``False``). + - ``fetch`` -- boolean (default: ``False``). OUTPUT: @@ -1832,55 +1836,185 @@ def show(self): print(re.sub('_', ' ', s).upper()) print(str(result) + '\n') - def programs(self, language='other'): + def programs(self, language='all', preparsing=True, keep_comments=False): r""" - Return programs implementing the sequence ``self`` in the given ``language``. + Return programs for the sequence ``self`` in the given ``language``. INPUT: - - ``language`` - string (default: 'other') - the language of the - program. Current values are: 'maple', 'mathematica' and 'other'. + - ``language`` -- string (default: 'all'), the chosen language. + Possible values are 'all' for the full list, or + any language name, for example 'sage', 'maple', 'mathematica', etc. + + Some further optional input is specific to sage code treatment: + + - ``preparsing`` -- boolean (default: ``True``) whether to preparse + sage code + - ``keep_comments`` -- boolean (default: ``False``) whether to keep + comments in sage code OUTPUT: - - tuple of strings (with fancy formatting). + If ``language`` is ``'all'``, this returns a sorted list of pairs + (language, code), where every language can appear several times. - .. TODO:: ask OEIS to add a "Sage program" field in the database ;) + Otherwise, this returns a list of programs in the ``language``, + each program being a tuple of strings (with fancy formatting). EXAMPLES:: sage: ee = oeis('A001113') ; ee # optional -- internet A001113: Decimal expansion of e. - sage: ee.programs()[0] # optional -- internet - '(PARI) default(realprecision, 50080); x=exp(1); for (n=1, 50000, d=floor(x); x=(x-d)*10; write("b001113.txt", n, " ", d)); \\\\ _Harry J. Smith_, Apr 15 2009' + sage: ee.programs('pari')[0] # optional -- internet + 0: default(realprecision, 50080); x=exp(1); for (n=1, 50000, d=floor(x); x=(x-d)*10; write("b001113.txt", n, " ", d)); \\ _Harry J. Smith_, Apr 15 2009 + + sage: G = oeis.find_by_id('A27642') # optional -- internet + sage: G.programs('all') # optional -- internet + [('haskell', ...), + ('magma', ...), + ... + ('python', ...), + ('sage', ...)] TESTS:: sage: s = oeis._imaginary_sequence() sage: s.programs() - 0: (Python) - 1: def A999999(n): - 2: assert(isinstance(n, (int, Integer))), "n must be an integer." - 3: if n < 38: - 4: raise ValueError("The value %s is not accepted." %str(n))) - 5: elif n == 42: - 6: return 2 - 7: else: - 8: return 1 - - sage: s.programs('maple') + [('maple', ...), + ('mathematica', ...), + ('python', + 0: def A999999(n): + 1: assert(isinstance(n, (int, Integer))), "n must be an integer." + 2: if n < 38: + 3: raise ValueError("The value %s is not accepted." %str(n)) + 4: elif n == 42: + 5: return 2 + 6: else: + 7: return 1)] + + sage: s.programs('maple')[0] 0: Do not even try, Maple is not able to produce such a sequence. - sage: s.programs('mathematica') + sage: s.programs('mathematica')[0] 0: Mathematica neither. """ + language = language.lower() if language == "maple": - return FancyTuple(self._field('p')) + return [FancyTuple(self._field('p'))] elif language == "mathematica": - return FancyTuple(self._field('t')) + return [FancyTuple(self._field('t'))] + if language == 'sagemath': + language = 'sage' + if language == 'all': + table = [('maple', FancyTuple(self._field('p'))), + ('mathematica', FancyTuple(self._field('t')))] else: - return FancyTuple(self._field('o')) + table = [] + + def is_starting_line(line): + """ + Help to split the big OEIS code block into blocks by language. + + This returns ``None`` if ``line`` is not a starting line. + """ + if not line.startswith('('): + return None + if ')' not in line: + return None + end = line.index(')') + language = line[1:end].lower() # to handle (Sage) versus (sage) + if '(' in language: + return None + if language == 'sagemath': + language = 'sage' + if language == 'c#' or language == 'c++': + language = 'c' + if language.replace(' ', '').isalnum() or language.startswith('scheme'): + # to cope with many wrong (Scheme xxx) separators in the OEIS + return (language, end) + return None + + def filter_sage(lines): + """ + Remove comments and preparse if required, only for sage code. + + This is an iterator. + """ + for line in lines: + if keep_comments or not line.strip().startswith('#'): + if preparsing: + yield preparse(line) + else: + yield line + + def flush_to_table(language, code_lines): + """ + Put a list of code lines into the appropriate box of the table. + + With special treatment for sage code blocks. + """ + if language == 'sage': + table.append((language, FancyTuple(filter_sage(code_lines)))) + elif language is not None: + table.append((language, FancyTuple(code_lines))) + + programs = FancyTuple(self._field('o')) + code_lines = [] + old_language = None + for line in programs: + new_language = is_starting_line(line) + if new_language is not None: + # flush the stock of code lines if any + flush_to_table(old_language, code_lines) + # start new stock of code lines + old_language, end = new_language + rest = line[end + 1:].strip() + code_lines = [rest] if rest else [] + else: + code_lines.append(line) + flush_to_table(old_language, code_lines) + + if language == 'all': + return sorted(table) + return sorted(prog for la, prog in table if la == language) + + def test_compile_sage_code(self): + """ + Try to compile the extracted sage code, if there is any. + + If there are several sage code fields, they are all considered. + + Dead sequences are considered to compile correctly by default. + + This returns ``True`` if the code compiles, and raises an error + otherwise. + + EXAMPLES: + + One correct sequence:: + + sage: s = oeis.find_by_id('A027642') # optional -- internet + sage: s.test_compile_sage_code() # optional -- internet + True + + One dead sequence:: + + sage: s = oeis.find_by_id('A000154') # optional -- internet + sage: s.test_compile_sage_code() # optional -- internet + doctest:warning + ... + RuntimeWarning: This sequence is dead: ... + True + """ + if self.is_dead(): + return True + filt = self.programs(language='sage') + if filt: + for v in filt: + tp = tmp_filename(ext='.sage') + _ = compile('\n'.join(v), tp, 'exec') + return True class FancyTuple(tuple): diff --git a/src/sage/docs/conf.py b/src/sage/docs/conf.py index a5c8d96acdf..7a4c0002050 100644 --- a/src/sage/docs/conf.py +++ b/src/sage/docs/conf.py @@ -455,6 +455,13 @@ def set_intersphinx_mappings(app): \DeclareUnicodeCharacter{23AE}{\ensuremath{\|}} % integral extenison \DeclareUnicodeCharacter{2571}{/} % Box drawings light diagonal upper right to lower left + + \DeclareUnicodeCharacter{25CF}{\ensuremath{\bullet}} % medium black circle + \DeclareUnicodeCharacter{26AC}{\ensuremath{\circ}} % medium small white circle + \DeclareUnicodeCharacter{256D}{+} + \DeclareUnicodeCharacter{256E}{+} + \DeclareUnicodeCharacter{256F}{+} + \DeclareUnicodeCharacter{2570}{+} \fi \let\textLaTeX\LaTeX diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index 8073a2373fe..a90b45981bb 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -7,8 +7,7 @@ - David Roe (2012-03-27) -- initial version, based on Robert Bradshaw's code. """ - -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2012 David Roe # Robert Bradshaw # William Stein @@ -18,11 +17,17 @@ # 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. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from __future__ import absolute_import, division, print_function -import random, os, sys, time, json, re, types +import random +import os +import sys +import time +import json +import re +import types import sage.misc.flatten from sage.structure.sage_object import SageObject from sage.env import DOT_SAGE, SAGE_LIB, SAGE_SRC, SAGE_LOCAL, SAGE_EXTCODE @@ -626,7 +631,6 @@ def test_safe_directory(self, dir=None): ... RuntimeError: refusing to run doctests... """ - import os import stat is_world_writeable = bool(os.stat(dir or os.getcwd()).st_mode & stat.S_IWOTH) if is_world_writeable: @@ -1122,7 +1126,8 @@ def run_val_gdb(self, testing=False): os.putenv('CYSIGNALS_CRASH_LOGS', tmp_dir("crash_logs_")) init_cysignals() - import signal, subprocess + import signal + import subprocess p = subprocess.Popen(cmd, shell=True) if opt.timeout > 0: signal.alarm(opt.timeout) diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py index 245771e3226..878ec1fff89 100644 --- a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py @@ -4871,7 +4871,7 @@ def reduced_form(self, **kwds): ) """ if self.domain().ambient_space().dimension_relative() != 1: - return NotImplementedError('only implmeneted for dimension 1') + return NotImplementedError('only implemented for dimension 1') return_conjugation = kwds.get('return_conjugation', True) emb = kwds.get('emb', None) prec = kwds.get('prec', 300) @@ -4880,7 +4880,7 @@ def reduced_form(self, **kwds): dynatomic = algorithm = kwds.get('dynatomic', True) smallest_coeffs = kwds.get('smallest_coeffs', True) if smallest_coeffs: - if self.base_ring() not in [ZZ,QQ]: + if self.base_ring() not in [ZZ, QQ]: raise NotImplementedError("smallest coeff only over ZZ or QQ") check_min = kwds.get('check_minimal', True) from sage.dynamics.arithmetic_dynamics.endPN_minimal_model import smallest_dynamical diff --git a/src/sage/ext/fast_callable.pyx b/src/sage/ext/fast_callable.pyx index 94e2928525b..86033d983be 100644 --- a/src/sage/ext/fast_callable.pyx +++ b/src/sage/ext/fast_callable.pyx @@ -311,7 +311,6 @@ from sage.structure.element cimport parent def fast_callable(x, domain=None, vars=None, - _autocompute_vars_for_backward_compatibility_with_deprecated_fast_float_functionality=False, expect_one_var=False): r""" Given an expression x, compile it into a form that can be quickly @@ -481,11 +480,7 @@ def fast_callable(x, domain=None, vars=None, if len(vars) == 0: vars = ['EXTRA_VAR0'] else: - if _autocompute_vars_for_backward_compatibility_with_deprecated_fast_float_functionality: - from sage.misc.superseded import deprecation - deprecation(5413, "Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...)") - else: - raise ValueError("List of variables must be specified for symbolic expressions") + raise ValueError("List of variables must be specified for symbolic expressions") from sage.rings.polynomial.polynomial_ring import is_PolynomialRing from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing if is_PolynomialRing(x.parent()) or is_MPolynomialRing(x.parent()): diff --git a/src/sage/ext/fast_eval.pyx b/src/sage/ext/fast_eval.pyx index 0743f3052ca..1d2c1bf4470 100644 --- a/src/sage/ext/fast_eval.pyx +++ b/src/sage/ext/fast_eval.pyx @@ -1399,7 +1399,8 @@ def fast_float(f, *vars, old=None, expect_one_var=False): if old: return f._fast_float_(*vars) else: - return fast_callable(f, vars=vars, domain=float, _autocompute_vars_for_backward_compatibility_with_deprecated_fast_float_functionality=True, expect_one_var=expect_one_var) + return fast_callable(f, vars=vars, domain=float, + expect_one_var=expect_one_var) except AttributeError: pass diff --git a/src/sage/ext_data/threejs/threejs_template.html b/src/sage/ext_data/threejs/threejs_template.html index 5f5715276ab..a17e8db6132 100644 --- a/src/sage/ext_data/threejs/threejs_template.html +++ b/src/sage/ext_data/threejs/threejs_template.html @@ -133,7 +133,7 @@ var sprite = new THREE.Sprite( new THREE.SpriteMaterial( { map: texture } ) ); sprite.position.set( x, y, z ); - // Set the initial scale based on plot size to accomodate orthographic projection. + // Set the initial scale based on plot size to accommodate orthographic projection. // For other projections, the scale will get reset each frame based on camera distance. var scale = midToCorner/2; sprite.scale.set( scale, scale*.25, 1 ); // ratio of canvas width to height @@ -360,7 +360,7 @@ renderer.render( scene, camera ); // Resize text based on distance from camera. - // Not neccessary for orthographic due to the nature of the projection (preserves sizes). + // Not necessary for orthographic due to the nature of the projection (preserves sizes). if ( !camera.isOrthographicCamera ) { for ( var i=0 ; i < scene.children.length ; i++ ) { if ( scene.children[i].type === 'Sprite' ) { diff --git a/src/sage/features/kenzo.py b/src/sage/features/kenzo.py new file mode 100644 index 00000000000..c3c68ede71b --- /dev/null +++ b/src/sage/features/kenzo.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +r""" +Check for Kenzo +""" + +from sage.libs.ecl import ecl_eval +from . import Feature, FeatureTestResult + +class Kenzo(Feature): + r""" + A :class:`sage.features.Feature` describing the presence of ``Kenzo``. + + EXAMPLES:: + + sage: from sage.features.kenzo import Kenzo + sage: Kenzo().is_present() # optional - kenzo + FeatureTestResult('Kenzo', True) + """ + def __init__(self): + r""" + TESTS:: + + sage: from sage.features.kenzo import Kenzo + sage: isinstance(Kenzo(), Kenzo) + True + """ + Feature.__init__(self, name="Kenzo", spkg="kenzo", + url="https://github.com/miguelmarco/kenzo/") + + def _is_present(self): + r""" + Check whether Kenzo is installed and works. + + EXAMPLES:: + + sage: from sage.features.kenzo import Kenzo + sage: Kenzo()._is_present() # optional - kenzo + FeatureTestResult('Kenzo', True) + """ + # Redirection of ECL and Maxima stdout to /dev/null + # This is also done in the Maxima library, but we + # also do it here for redundancy. + ecl_eval(r"""(defparameter *dev-null* (make-two-way-stream + (make-concatenated-stream) (make-broadcast-stream)))""") + ecl_eval("(setf original-standard-output *standard-output*)") + ecl_eval("(setf *standard-output* *dev-null*)") + + try: + ecl_eval("(require :kenzo)") + except RuntimeError: + return FeatureTestResult(self, False, reason="Unable to make ECL require kenzo") + return FeatureTestResult(self, True) + diff --git a/src/sage/functions/log.py b/src/sage/functions/log.py index bc11823e394..e54c7f1b1b3 100644 --- a/src/sage/functions/log.py +++ b/src/sage/functions/log.py @@ -8,7 +8,6 @@ - Tomas Kalvoda (2015-04-01): Add :meth:`exp_polar()` (:trac:`18085`) """ - from sage.symbolic.function import GinacFunction, BuiltinFunction from sage.symbolic.constants import e as const_e from sage.symbolic.constants import pi as const_pi @@ -444,6 +443,7 @@ def log(*args, **kwds): except (AttributeError, TypeError): return logb(args[0], args[1]) + class Function_polylog(GinacFunction): def __init__(self): r""" @@ -537,14 +537,21 @@ def __init__(self): [1.644934066848226 +/- ...] sage: parent(_) Complex ball field with 53 bits of precision + + sage: polylog(1,-1) # known bug + -log(2) """ - GinacFunction.__init__(self, "polylog", nargs=2) + GinacFunction.__init__(self, "polylog", nargs=2, + conversions=dict(mathematica='PolyLog', + magma='Polylog', + matlab='polylog', + sympy='polylog')) def _maxima_init_evaled_(self, *args): """ EXAMPLES: - These are indirect doctests for this function.:: + These are indirect doctests for this function:: sage: polylog(2, x)._maxima_() li[2](_SAGE_VAR_x) @@ -561,14 +568,15 @@ def _maxima_init_evaled_(self, *args): args_maxima.append(str(a)) n, x = args_maxima - if int(n) in [1,2,3]: - return 'li[%s](%s)'%(n, x) + if int(n) in [1, 2, 3]: + return 'li[%s](%s)' % (n, x) else: - return 'polylog(%s, %s)'%(n, x) + return 'polylog(%s, %s)' % (n, x) polylog = Function_polylog() + class Function_dilog(GinacFunction): def __init__(self): r""" @@ -656,8 +664,27 @@ def __init__(self): """ GinacFunction.__init__(self, 'dilog', conversions=dict(maxima='li[2]', + magma='Dilog', fricas='(x+->dilog(1-x))')) + def _sympy_(self, z): + r""" + Special case for sympy, where there is no dilog function. + + EXAMPLES:: + + sage: w = dilog(x)._sympy_(); w + polylog(2, x) + sage: w.diff() + polylog(1, x)/x + sage: w._sage_() + dilog(x) + """ + import sympy + from sympy import polylog as sympy_polylog + return sympy_polylog(2, sympy.sympify(z, evaluate=False)) + + dilog = Function_dilog() @@ -673,9 +700,9 @@ class Function_lambert_w(BuiltinFunction): INPUT: - - ``n`` - an integer. `n=0` corresponds to the principal branch. + - ``n`` -- an integer. `n=0` corresponds to the principal branch. - - ``z`` - a complex number + - ``z`` -- a complex number If called with a single argument, that argument is ``z`` and the branch ``n`` is assumed to be 0 (the principal branch). @@ -1019,7 +1046,7 @@ def __init__(self): INPUT: - - ``z`` - a complex number `z = a + ib`. + - ``z`` -- a complex number `z = a + ib`. OUTPUT: @@ -1388,6 +1415,7 @@ def _swap_harmonic(a,b): return harmonic_number(b,a) register_symbol(_swap_harmonic,{'maxima':'gen_harmonic_number'}) register_symbol(_swap_harmonic,{'maple':'harmonic'}) + class Function_harmonic_number(BuiltinFunction): r""" Harmonic number function, defined by: diff --git a/src/sage/functions/prime_pi.pyx b/src/sage/functions/prime_pi.pyx index a29dce47bff..60ddf604af1 100644 --- a/src/sage/functions/prime_pi.pyx +++ b/src/sage/functions/prime_pi.pyx @@ -18,15 +18,15 @@ EXAMPLES:: True """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2009,2011 R. Andrew Ohana # Copyright (C) 2009 William Stein # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from cypari2.paridecl cimport * from cysignals.signals cimport * @@ -274,7 +274,7 @@ cdef class PrimePi(BuiltinFunction): cdef uint32_t _cached_count(self, uint32_t p): r""" For p < 65536, returns the value stored in ``self.__smallPi[p]``. For - p <= ``self.__maxSieve``, uses a binary seach on ``self.__primes`` to + p <= ``self.__maxSieve``, uses a binary search on ``self.__primes`` to compute pi(p). """ # inspired by Yann Laigle-Chapuy's suggestion diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index adafb48182e..8e82e941682 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -2,7 +2,7 @@ Base class for polyhedra """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2008 Marshall Hampton # Copyright (C) 2011 Volker Braun # Copyright (C) 2015 Jean-Philippe Labbe @@ -13,7 +13,7 @@ # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from __future__ import division, print_function, absolute_import @@ -1027,22 +1027,32 @@ def _repr_(self): if self.n_vertices() > 0: desc += ' defined as the convex hull of ' desc += repr(self.n_vertices()) - if self.n_vertices() == 1: desc += ' vertex' - else: desc += ' vertices' + if self.n_vertices() == 1: + desc += ' vertex' + else: + desc += ' vertices' if self.n_rays() > 0: - if self.n_lines() > 0: desc += ", " - else: desc += " and " + if self.n_lines() > 0: + desc += ", " + else: + desc += " and " desc += repr(self.n_rays()) - if self.n_rays() == 1: desc += ' ray' - else: desc += ' rays' + if self.n_rays() == 1: + desc += ' ray' + else: + desc += ' rays' if self.n_lines() > 0: - if self.n_rays() > 0: desc += ", " - else: desc += " and " + if self.n_rays() > 0: + desc += ", " + else: + desc += " and " desc += repr(self.n_lines()) - if self.n_lines() == 1: desc += ' line' - else: desc += ' lines' + if self.n_lines() == 1: + desc += ' line' + else: + desc += ' lines' return desc @@ -1562,7 +1572,7 @@ def Hrepresentation_str(self, separator='\n', latex=False, style='>=', align=Non if align is None: align = separator == "\n" if align: - lengths = [(len(s[0]), len(s[1]), len(s[2])) for s in pretty_hs] + lengths = [(len(s[0]), len(s[1]), len(s[2])) for s in pretty_hs] from operator import itemgetter length_left = max(lengths, key=itemgetter(0))[0] length_middle = max(lengths, key=itemgetter(1))[1] @@ -2078,7 +2088,7 @@ def an_affine_basis(self): # We use in the following that elements in ``chain_indices`` are sorted lists # of V-indices. # Thus for each two faces we can easily find the first vertex that differs. - for dim,face in enumerate(chain_indices): + for dim, face in enumerate(chain_indices): if dim == 0: # Append the vertex. basis_indices.append(face[0]) @@ -2224,10 +2234,13 @@ def bounded_edges(self): """ obj = self.Vrepresentation() for i in range(len(obj)): - if not obj[i].is_vertex(): continue + if not obj[i].is_vertex(): + continue for j in range(i+1, len(obj)): - if not obj[j].is_vertex(): continue - if self.vertex_adjacency_matrix()[i, j] == 0: continue + if not obj[j].is_vertex(): + continue + if self.vertex_adjacency_matrix()[i, j] == 0: + continue yield (obj[i], obj[j]) def Vrepresentation_space(self): @@ -2533,7 +2546,7 @@ def boundary_complex(self): ineq_indices = [inc_mat_cols[i].nonzero_positions() for i in range(self.n_Hrepresentation()) if self.Hrepresentation()[i].is_inequality()] - return SimplicialComplex(ineq_indices,maximality_check=False) + return SimplicialComplex(ineq_indices, maximality_check=False) else: raise NotImplementedError("this function is only implemented for simplicial polytopes") @@ -2664,10 +2677,10 @@ def incidence_matrix(self): incidence_matrix = matrix(ZZ, self.n_Vrepresentation(), self.n_Hrepresentation(), 0) - Vvectors_vertices = tuple((v.vector(),v.index()) + Vvectors_vertices = tuple((v.vector(), v.index()) for v in self.Vrep_generator() if v.is_vertex()) - Vvectors_rays_lines = tuple((v.vector(),v.index()) + Vvectors_rays_lines = tuple((v.vector(), v.index()) for v in self.Vrep_generator() if not v.is_vertex()) @@ -2677,13 +2690,13 @@ def incidence_matrix(self): Hindex = H.index() for Vvec, Vindex in Vvectors_vertices: if self._is_zero(Hvec*Vvec + Hconst): - incidence_matrix[Vindex, Hindex] = 1 + incidence_matrix[Vindex, Hindex] = 1 # A ray or line is considered incident with a hyperplane, # if it is orthogonal to the normal vector of the hyperplane. for Vvec, Vindex in Vvectors_rays_lines: if self._is_zero(Hvec*Vvec): - incidence_matrix[Vindex, Hindex] = 1 + incidence_matrix[Vindex, Hindex] = 1 incidence_matrix.set_immutable() return incidence_matrix @@ -2854,11 +2867,11 @@ def centroid(self, engine='auto', **kwds): pc = triangulation.point_configuration() else: from sage.geometry.triangulation.point_configuration import PointConfiguration - A,b = self.affine_hull_projection(as_affine_map=True, orthogonal=True, orthonormal=True, extend=True) + A, b = self.affine_hull_projection(as_affine_map=True, orthogonal=True, orthonormal=True, extend=True) pc = PointConfiguration((A(v.vector()) for v in self.Vrep_generator())) barycenters = [sum(self.Vrepresentation(i).vector() for i in simplex)/(self.dim() + 1) for simplex in triangulation] - volumes = [pc.volume(simplex) for simplex in triangulation] + volumes = [pc.volume(simplex) for simplex in triangulation] centroid = sum(volumes[i]*barycenters[i] for i in range(len(volumes)))/sum(volumes) if self.ambient_dim() != self.dim(): @@ -3252,14 +3265,14 @@ def is_simple(self): sage: p = Polyhedron([[0,0,0],[4,4,0],[4,0,0],[0,4,0],[2,2,2]]) sage: p.is_simple() False - """ - if not self.is_compact(): return False + if not self.is_compact(): + return False return self.combinatorial_polyhedron().is_simple() def simpliciality(self): r""" - Return the largest interger `k` such that the polytope is `k`-simplicial. + Return the largest integer `k` such that the polytope is `k`-simplicial. A polytope is `k`-simplicial, if every `k`-face is a simplex. If `self` is a simplex, returns its dimension. @@ -3614,7 +3627,7 @@ def is_prism(self, certificate=False): # We have found two candidates for base faces. # Remove from each vertex ``index1`` resp. ``index2``. test_verts = set(frozenset(vert_inc.difference({index1, index2})) - for vert_inc in verts_incidences) + for vert_inc in verts_incidences) if len(test_verts) == n_verts/2: # For each vertex containing `index1` there is # another one contained in `index2` @@ -3701,10 +3714,11 @@ def gale_transform(self): sage: sum(P.gale_transform()).norm() < 1e-15 True """ - if not self.is_compact(): raise ValueError('not a polytope') + if not self.is_compact(): + raise ValueError('not a polytope') A = matrix(self.n_vertices(), - [ [1]+x for x in self.vertex_generator()]) + [[1]+x for x in self.vertex_generator()]) A = A.transpose() A_ker = A.right_kernel_matrix(basis='computed') return tuple(A_ker.columns()) @@ -4383,28 +4397,51 @@ def product(self, other): 'ppl' sage: (P * polytopes.dodecahedron(backend='field')).backend() 'field' + + Check that double description is set up correctly:: + + sage: P = polytopes.permutahedron(4).base_extend(QQ) + sage: P1 = Polyhedron(rays=[[1,0,0,0],[0,1,1,0]], lines=[[0,1,0,1]]) + sage: Q = P.base_extend(QQ, 'field') + sage: Q1 = P1.base_extend(QQ, 'field') + sage: P * P1 == Q * Q1 + True + sage: P.polar(in_affine_span=True) * P1 == Q.polar(in_affine_span=True) * Q1 + True """ try: new_ring = self.parent()._coerce_base_ring(other) except TypeError: - raise TypeError("no common canonical parent for objects with parents: " + str(self.parent()) \ - + " and " + str(other.parent())) + raise TypeError("no common canonical parent for objects with parents: " + str(self.parent()) + + " and " + str(other.parent())) - new_vertices = [ list(x)+list(y) - for x in self.vertex_generator() for y in other.vertex_generator()] - new_rays = [] - new_rays.extend( [ r+[0]*other.ambient_dim() - for r in self.ray_generator() ] ) - new_rays.extend( [ [0]*self.ambient_dim()+r - for r in other.ray_generator() ] ) - new_lines = [] - new_lines.extend( [ l+[0]*other.ambient_dim() - for l in self.line_generator() ] ) - new_lines.extend( [ [0]*self.ambient_dim()+l - for l in other.line_generator() ] ) + from itertools import chain + + new_vertices = (tuple(x) + tuple(y) + for x in self.vertex_generator() for y in other.vertex_generator()) + + self_zero = tuple(0 for _ in range( self.ambient_dim())) + other_zero = tuple(0 for _ in range(other.ambient_dim())) + + rays = chain((tuple(r) + other_zero for r in self.ray_generator()), + (self_zero + tuple(r) for r in other.ray_generator())) + + lines = chain((tuple(l) + other_zero for l in self.line_generator()), + (self_zero + tuple(l) for l in other.line_generator())) + + ieqs = chain((tuple(i) + other_zero for i in self.inequality_generator()), + ((i.b(),) + self_zero + tuple(i.A()) for i in other.inequality_generator())) + + eqns = chain((tuple(e) + other_zero for e in self.equation_generator()), + ((e.b(),) + self_zero + tuple(e.A()) for e in other.equation_generator())) + + pref_rep = 'Vrep' if self.n_vertices() + self.n_rays() + other.n_vertices() + other.n_rays() \ + <= self.n_inequalities() + other.n_inequalities() else 'Hrep' parent = self.parent().change_ring(new_ring, ambient_dim=self.ambient_dim() + other.ambient_dim()) - return parent.element_class(parent, [new_vertices, new_rays, new_lines], None) + return parent.element_class(parent, [new_vertices, rays, lines], + [ieqs, eqns], + Vrep_minimal=True, Hrep_minimal=True, pref_rep=pref_rep) _mul_ = product @@ -4692,8 +4729,8 @@ def dilation(self, scalar): one = parent.base_ring().one() sign = one if scalar > 0 else -one - make_new_Hrep = lambda h : tuple(scalar*sign*x if i == 0 else sign*x - for i,x in enumerate(h._vector)) + make_new_Hrep = lambda h: tuple(scalar*sign*x if i == 0 else sign*x + for i, x in enumerate(h._vector)) new_vertices = (tuple(scalar*x for x in v._vector) for v in self.vertex_generator()) new_rays = (tuple(sign*x for x in r._vector) for r in self.ray_generator()) @@ -5183,8 +5220,8 @@ def face_truncation(self, face, linear_coefficients=None, cut_frac=None): normal_vectors.append(facet.A()) if linear_coefficients is not None: - normal_vector = sum(linear_coefficients[i]*normal_vectors[i] for i - in range(len(normal_vectors))) + normal_vector = sum(linear_coefficients[i]*normal_vectors[i] + for i in range(len(normal_vectors))) else: normal_vector = sum(normal_vectors) @@ -5558,7 +5595,7 @@ def lawrence_extension(self, v): raise ValueError("{} must not be a vertex or outside self".format(v)) lambda_V = [u + [0] for u in V if u != v] + [v+[1]] + [v+[2]] - parent = self.parent().change_ring(self.base_ring(), ambient_dim = self.ambient_dim() + 1) + parent = self.parent().change_ring(self.base_ring(), ambient_dim=self.ambient_dim()+1) return parent.element_class(parent, [lambda_V, [], []], None) def lawrence_polytope(self): @@ -5620,7 +5657,7 @@ def lawrence_polytope(self): n = self.n_vertices() I_n = matrix.identity(n) lambda_V = block_matrix([[V, I_n], [V, 2*I_n]]) - parent = self.parent().change_ring(self.base_ring(), ambient_dim = self.ambient_dim() + n) + parent = self.parent().change_ring(self.base_ring(), ambient_dim=self.ambient_dim()+n) return parent.element_class(parent, [lambda_V, [], []], None) def is_lawrence_polytope(self): @@ -5932,9 +5969,9 @@ def face_constructor(atoms, coatoms): if not atoms: Vindices = () else: - Vindices = tuple(sorted([ atom_to_Vindex[i] for i in atoms ]+lines)) - Hindices = tuple(sorted([ coatom_to_Hindex[i] for i in coatoms ]+equations)) - return PolyhedronFace(self,Vindices, Hindices) + Vindices = tuple(sorted([atom_to_Vindex[i] for i in atoms] + lines)) + Hindices = tuple(sorted([coatom_to_Hindex[i] for i in coatoms] + equations)) + return PolyhedronFace(self, Vindices, Hindices) from sage.geometry.hasse_diagram import lattice_from_incidences return lattice_from_incidences(atoms_incidences, coatoms_incidences, @@ -6996,7 +7033,7 @@ def schlegel_projection(self, projection_dir=None, height=1.1): if projection_dir is None: vertices = self.vertices() facet = self.Hrepresentation(0) - f0 = [ v.index() for v in facet.incident() ] + f0 = [v.index() for v in facet.incident()] projection_dir = [sum([vertices[f0[i]][j]/len(f0) for i in range(len(f0))]) for j in range(self.ambient_dim())] return proj.schlegel(projection_direction=projection_dir, height=height) @@ -7012,11 +7049,11 @@ def _volume_lrs(self, verbose=False): EXAMPLES:: - sage: polytopes.hypercube(3)._volume_lrs() #optional - lrslib + sage: polytopes.hypercube(3)._volume_lrs() # optional - lrslib 8.0 - sage: (polytopes.hypercube(3)*2)._volume_lrs() #optional - lrslib + sage: (polytopes.hypercube(3)*2)._volume_lrs() # optional - lrslib 64.0 - sage: polytopes.twenty_four_cell()._volume_lrs() #optional - lrslib + sage: polytopes.twenty_four_cell()._volume_lrs() # optional - lrslib 2.0 REFERENCES: @@ -7035,7 +7072,8 @@ def _volume_lrs(self, verbose=False): in_file = open(in_filename, 'w') in_file.write(in_str) in_file.close() - if verbose: print(in_str) + if verbose: + print(in_str) lrs_procs = Popen(['lrs', in_filename], stdin=PIPE, stdout=PIPE, stderr=PIPE) @@ -7082,30 +7120,30 @@ def _volume_latte(self, verbose=False, algorithm='triangulate', **kwargs): EXAMPLES:: - sage: polytopes.hypercube(3)._volume_latte() #optional - latte_int + sage: polytopes.hypercube(3)._volume_latte() # optional - latte_int 8 - sage: (polytopes.hypercube(3)*2)._volume_latte() #optional - latte_int + sage: (polytopes.hypercube(3)*2)._volume_latte() # optional - latte_int 64 - sage: polytopes.twenty_four_cell()._volume_latte() #optional - latte_int + sage: polytopes.twenty_four_cell()._volume_latte() # optional - latte_int 2 - sage: polytopes.cuboctahedron()._volume_latte() #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte() # optional - latte_int 20/3 TESTS: Testing triangulate algorithm:: - sage: polytopes.cuboctahedron()._volume_latte(algorithm='triangulate') #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte(algorithm='triangulate') # optional - latte_int 20/3 Testing cone decomposition algorithm:: - sage: polytopes.cuboctahedron()._volume_latte(algorithm='cone-decompose') #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte(algorithm='cone-decompose') # optional - latte_int 20/3 Testing raw output:: - sage: polytopes.cuboctahedron()._volume_latte(raw_output=True) #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte(raw_output=True) # optional - latte_int '20/3' Testing inexact rings:: @@ -7198,10 +7236,10 @@ def volume(self, measure='ambient', engine='auto', **kwds): reasons, Sage casts lrs's exact answer to a float:: sage: I3 = polytopes.hypercube(3) - sage: I3.volume(engine='lrs') #optional - lrslib + sage: I3.volume(engine='lrs') # optional - lrslib 8.0 sage: C24 = polytopes.twenty_four_cell() - sage: C24.volume(engine='lrs') #optional - lrslib + sage: C24.volume(engine='lrs') # optional - lrslib 2.0 If the base ring is exact, the answer is exact:: @@ -8111,7 +8149,7 @@ def bounding_box(self, integral=False, integral_hull=False): if self.n_vertices() == 0: raise ValueError("empty polytope is not allowed") for i in range(self.ambient_dim()): - coords = [ v[i] for v in self.vertex_generator() ] + coords = [v[i] for v in self.vertex_generator()] max_coord = max(coords) min_coord = min(coords) if integral_hull: @@ -8303,7 +8341,7 @@ def integral_points(self, threshold=100000): triangulation = self.triangulate() points = set() for simplex in triangulation: - triang_vertices = [ self.Vrepresentation(i) for i in simplex ] + triang_vertices = [self.Vrepresentation(i) for i in simplex] new_points = simplex_points(triang_vertices) for p in new_points: p.set_immutable() @@ -8835,6 +8873,7 @@ def rational_approximation(c): return c else: c_list = [] + def rational_approximation(c): # Implementation detail: Return unique integer if two # c-values are the same up to machine precision. But diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index 870c733ea14..3b26cf65c2b 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -427,6 +427,12 @@ cdef class CombinatorialPolyhedron(SageObject): self._n_Hrepresentation = data.ncols() self._n_Vrepresentation = data.nrows() + # Store the incidence matrix. + if not data.is_immutable(): + data = data.__copy__() + data.set_immutable() + self.incidence_matrix.set_cache(data) + # Initializing the facets in their Bit-representation. self._bitrep_facets = incidence_matrix_to_bit_rep_of_facets(data) @@ -985,11 +991,22 @@ cdef class CombinatorialPolyhedron(SageObject): [0 0 0 1 1 1] [0 1 0 1 1 0] [0 1 1 1 0 0] - sage: P.incidence_matrix() == C.incidence_matrix() + + In this case the incidence matrix is only computed once:: + + sage: P.incidence_matrix() is C.incidence_matrix() + True + sage: C.incidence_matrix.clear_cache() + sage: C.incidence_matrix() is P.incidence_matrix() + False + sage: C.incidence_matrix() == P.incidence_matrix() True + :: + sage: P = polytopes.permutahedron(5) sage: C = P.combinatorial_polyhedron() + sage: C.incidence_matrix.clear_cache() sage: C.incidence_matrix() == P.incidence_matrix() True @@ -999,6 +1016,8 @@ cdef class CombinatorialPolyhedron(SageObject): sage: P = Polyhedron([[0,0]]) sage: P.incidence_matrix() [1 1] + sage: C = P.combinatorial_polyhedron() + sage: C.incidence_matrix.clear_cache() sage: P.combinatorial_polyhedron().incidence_matrix() [1 1] @@ -1007,9 +1026,11 @@ cdef class CombinatorialPolyhedron(SageObject): Check that :trac:`29455` is fixed:: sage: C = Polyhedron([[0]]).combinatorial_polyhedron() + sage: C.incidence_matrix.clear_cache() sage: C.incidence_matrix() [1] sage: C = CombinatorialPolyhedron(-1) + sage: C.incidence_matrix.clear_cache() sage: C.incidence_matrix() [] """ @@ -1472,13 +1493,13 @@ cdef class CombinatorialPolyhedron(SageObject): else: facet_names = self.facet_names() if facet_names is None: - # No names where provided at initializiation. - facet_names = [("H",i) for i in range(n_facets)] + # No names were provided at initialisation. + facet_names = [("H", i) for i in range(n_facets)] Vrep = self.Vrep() if Vrep is None: - # No names where provided at initializiation. - Vrep = [("V",i) for i in range(n_Vrep)] + # No names were provided at initialisation. + Vrep = [("V", i) for i in range(n_Vrep)] vertices = Vrep + facet_names edges = tuple((Vrep[j], facet_names[n_facets - 1 - i]) for i,facet in enumerate(facet_iter) for j in facet.ambient_V_indices()) diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd b/src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd deleted file mode 100644 index ad4e8dd129d..00000000000 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd +++ /dev/null @@ -1,63 +0,0 @@ -# distutils: language = c++ - -cimport cython -from libc.stdint cimport uint64_t - -cdef extern from "bit_vector_operations.cc": - # Any Bit-representation is assumed to be `chunksize`-Bit aligned. - cdef const size_t chunksize - cdef void intersection(uint64_t *A, uint64_t *B, uint64_t *C, - size_t face_length) -# Return ``A & ~B == 0``. -# A is not subset of B, iff there is a vertex in A, which is not in B. -# ``face_length`` is the length of A and B in terms of uint64_t. - - cdef size_t get_next_level( - uint64_t **faces, const size_t n_faces, uint64_t **nextfaces, - uint64_t **nextfaces2, uint64_t **visited_all, - size_t n_visited_all, size_t face_length) -# Set ``newfaces`` to be the facets of ``faces[n_faces -1]`` -# that are not contained in a face of ``visited_all``. - -# INPUT: - -# - ``maybe_newfaces`` -- quasi of type ``uint64_t[n_faces -1][face_length]``, -# needs to be ``chunksize``-Bit aligned -# - ``newfaces`` -- quasi of type ``*uint64_t[n_faces -1] -# - ``visited_all`` -- quasi of type ``*uint64_t[n_visited_all] -# - ``face_length`` -- length of the faces - -# OUTPUT: - -# - return number of ``newfaces`` -# - set ``newfaces`` to point to the new faces - -# ALGORITHM: - -# To get all facets of ``faces[n_faces-1]``, we would have to: -# - Intersect the first ``n_faces-1`` faces of ``faces`` with the last face. -# - Add all the intersection of ``visited_all`` with the last face -# - Out of both the inclusion-maximal ones are of codimension 1, i.e. facets. - -# As we have visited all faces of ``visited_all``, we alter the algorithm -# to not revisit: -# Step 1: Intersect the first ``n_faces-1`` faces of ``faces`` with the last face. -# Step 2: Out of thosse the inclusion-maximal ones are some of the facets. -# At least we obtain all of those, that we have not already visited. -# Maybe, we get some more. -# Step 3: Only keep those that we have not already visited. -# We obtain exactly the facets of ``faces[n_faces-1]`` that we have -# not visited yet. - - cdef size_t count_atoms(uint64_t *A, size_t face_length) -# Return the number of atoms/vertices in A. -# This is the number of set bits in A. -# ``face_length`` is the length of A in terms of uint64_t. - - cdef size_t bit_rep_to_coatom_rep( - uint64_t *face, uint64_t **coatoms, size_t n_coatoms, - size_t face_length, size_t *output) -# Write the coatom-representation of face in output. Return length. -# ``face_length`` is the length of ``face`` and ``coatoms[i]`` -# in terms of uint64_t. -# ``n_coatoms`` length of ``coatoms``. diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx index 920f297a89a..2db092697a2 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx @@ -347,7 +347,7 @@ cdef class ListOfFaces: return count_atoms(faces[0], face_length) # ``maybe_newfaces`` are all intersection of ``faces[n_faces -1]`` with previous faces. - # It needs to be allcoated to store those faces. + # It needs to be allocated to store those faces. cdef ListOfFaces maybe_newfaces_mem = ListOfFaces(n_faces, face_length*64) cdef uint64_t **maybe_newfaces = maybe_newfaces_mem.data diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx index f7af68746e5..26fb1da4257 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx @@ -72,9 +72,8 @@ from .face_iterator cimport FaceIterator cdef extern from "bit_vector_operations.cc": cdef void intersection(uint64_t *A, uint64_t *B, uint64_t *C, size_t face_length) -# Return ``A & ~B == 0``. -# A is not subset of B, iff there is a vertex in A, which is not in B. -# ``face_length`` is the length of A and B in terms of uint64_t. +# Set ``C = A & B``, i.e. C is the intersection of A and B. +# ``face_length`` is the length of A, B and C in terms of uint64_t. cdef size_t bit_rep_to_coatom_rep( uint64_t *face, uint64_t **coatoms, size_t n_coatoms, diff --git a/src/sage/graphs/base/boost_graph.pyx b/src/sage/graphs/base/boost_graph.pyx index 6ba0a44c9af..216688c733b 100644 --- a/src/sage/graphs/base/boost_graph.pyx +++ b/src/sage/graphs/base/boost_graph.pyx @@ -977,19 +977,22 @@ cpdef shortest_paths(g, start, weight_function=None, algorithm=None): raise ValueError("the graph contains a negative cycle") elif algorithm in ['Dijkstra', 'Dijkstra_Boost']: - if g.is_directed(): - boost_weighted_graph_from_sage_graph(&g_boost_dir, g, v_to_int, weight_function) - vi = v_to_int[start] - sig_on() - result = g_boost_dir.dijkstra_shortest_paths(vi) - sig_off() - else: - boost_weighted_graph_from_sage_graph(&g_boost_und, g, v_to_int, weight_function) - vi = v_to_int[start] - sig_on() - result = g_boost_und.dijkstra_shortest_paths(vi) - sig_off() - if not result.distances.size(): + try: + if g.is_directed(): + boost_weighted_graph_from_sage_graph(&g_boost_dir, g, v_to_int, weight_function) + vi = v_to_int[start] + sig_on() + result = g_boost_dir.dijkstra_shortest_paths(vi) + sig_off() + else: + boost_weighted_graph_from_sage_graph(&g_boost_und, g, v_to_int, weight_function) + vi = v_to_int[start] + sig_on() + result = g_boost_und.dijkstra_shortest_paths(vi) + sig_off() + if not result.distances.size(): + raise RuntimeError("Dijkstra algorithm does not work with negative weights, use Bellman-Ford instead") + except RuntimeError: raise RuntimeError("Dijkstra algorithm does not work with negative weights, use Bellman-Ford instead") else: diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 8779f53b5aa..a038bda1534 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -16416,7 +16416,6 @@ def weight_function(e): return networkx.single_source_dijkstra_path_length(G, u) elif algorithm in ['Dijkstra_Boost', 'Bellman-Ford_Boost', None]: - self.weighted(True) from sage.graphs.base.boost_graph import shortest_paths return shortest_paths(self, u, weight_function, algorithm)[0] diff --git a/src/sage/graphs/graph_decompositions/clique_separators.pyx b/src/sage/graphs/graph_decompositions/clique_separators.pyx index 3df6224d839..3c4e1b06723 100644 --- a/src/sage/graphs/graph_decompositions/clique_separators.pyx +++ b/src/sage/graphs/graph_decompositions/clique_separators.pyx @@ -157,6 +157,7 @@ cdef inline bint is_clique(short_digraph sd, vector[int] Hx): return False return True + def atoms_and_clique_separators(G, tree=False, rooted_tree=False, separators=False): r""" Return the atoms of the decomposition of `G` by clique minimal separators. @@ -200,7 +201,7 @@ def atoms_and_clique_separators(G, tree=False, rooted_tree=False, separators=Fal OUTPUT: - By default, return a tuple `(A, S_c)`, where `A` is the list of atoms of - the graph in the order of dicovery, and `S_c` is the list of clique + the graph in the order of discovery, and `S_c` is the list of clique separators, with possible repetitions, in the order the separator has been considered. If furthermore ``separators`` is ``True``, return a tuple `(A, S_h, S_c)`, where `S_c` is the list of considered separators of the graph diff --git a/src/sage/graphs/spanning_tree.pyx b/src/sage/graphs/spanning_tree.pyx index 1572f35bac4..ec05b0a4040 100644 --- a/src/sage/graphs/spanning_tree.pyx +++ b/src/sage/graphs/spanning_tree.pyx @@ -286,6 +286,7 @@ def kruskal_iterator(G, wfunction=None, bint check=False): weighted=G.weighted(), weight_function=wfunction) + def kruskal_iterator_from_edges(edges, union_find, weighted=False, weight_function=None): """ Return an iterator implementation of Kruskal algorithm on list of edges. @@ -342,6 +343,7 @@ def kruskal_iterator_from_edges(edges, union_find, weighted=False, weight_functi if union_find.number_of_subsets() == 1: return + def filter_kruskal(G, threshold=10000, weight_function=None, bint check=False): """ Minimum spanning tree using Filter Kruskal algorithm. @@ -418,6 +420,7 @@ def filter_kruskal(G, threshold=10000, weight_function=None, bint check=False): """ return list(filter_kruskal_iterator(G, threshold=threshold, weight_function=weight_function, check=check)) + def filter_kruskal_iterator(G, threshold=10000, weight_function=None, bint check=False): r""" Return an iterator implementation of Filter Kruskal's algorithm. @@ -436,7 +439,7 @@ def filter_kruskal_iterator(G, threshold=10000, weight_function=None, bint check EXAMPLES: The edges of a minimum spanning tree of ``G``, if one exists, otherwise - returns the empty list. + returns the empty list. :: sage: from sage.graphs.spanning_tree import filter_kruskal_iterator sage: G = Graph({1:{2:28, 6:10}, 2:{3:16, 7:14}, 3:{4:12}, 4:{5:22, 7:18}, 5:{6:25, 7:24}}) @@ -791,6 +794,7 @@ cpdef boruvka(G, wfunction=None, bint check=False, bint by_weight=True): return T + @cython.binding(True) def random_spanning_tree(self, output_as_graph=False): r""" diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index d4ad92b6be4..d06bebe881b 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -253,6 +253,14 @@ class ParentLibGAP(SageObject): sage: G.subgroup(subgroup_gens) Subgroup with 8 generators of Matrix group over Rational Field with 48 generators + TESTS: + + Check that :trac:`19010` is fixed:: + + sage: G = WeylGroup(['B',3]) + sage: H = G.subgroup([G[14], G[17]]) + sage: all(g*h in G and h*g in G for g in G for h in H) + True """ generators = [ g if isinstance(g, GapElement) else self(g).gap() for g in generators ] diff --git a/src/sage/groups/raag.py b/src/sage/groups/raag.py index 4cfe5bee2f4..0ce579b07e6 100644 --- a/src/sage/groups/raag.py +++ b/src/sage/groups/raag.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- r""" Right-Angled Artin Groups @@ -36,6 +37,13 @@ from sage.combinat.root_system.coxeter_matrix import CoxeterMatrix from sage.combinat.root_system.coxeter_group import CoxeterGroup +from sage.combinat.free_module import CombinatorialFreeModule +from sage.categories.fields import Fields +from sage.categories.algebras_with_basis import AlgebrasWithBasis +from sage.algebras.clifford_algebra import CliffordAlgebraElement +from sage.typeset.ascii_art import ascii_art +from sage.typeset.unicode_art import unicode_art + class RightAngledArtinGroup(ArtinGroup): r""" The right-angled Artin group defined by a graph `G`. @@ -368,6 +376,23 @@ def _normal_form(self, word): pos += len(comm_set) return tuple(w) + def cohomology(self, F=None): + """ + Return the cohomology ring of ``self`` over the field ``F``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: A.cohomology() + Cohomology ring of Right-angled Artin group of Cycle graph + with coefficients in Rational Field + """ + if F is None: + from sage.rings.rational_field import QQ + F = QQ + return CohomologyRAAG(F, self) + class Element(ArtinGroupElement): """ An element of a right-angled Artin group (RAAG). @@ -603,3 +628,281 @@ def _richcmp_(self, other, op): """ return richcmp(self._data, other._data, op) +class CohomologyRAAG(CombinatorialFreeModule): + r""" + The cohomology ring of a right-angled Artin group. + + The cohomology ring of a right-angled Artin group `A`, defined by + the graph `G`, with coefficients in a field `F` is isomorphic to + the exterior algebra of `F^N`, where `N` is the number of vertices + in `G`, modulo the quadratic relations `e_i \wedge e_j = 0` if and + only if `(i, j)` is an edge in `G`. This algebra is sometimes also + known as the Cartier-Foata algebra. + + REFERENCES: + + - [CQ2019]_ + """ + def __init__(self, R, A): + """ + Initialize ``self``. + + TESTS:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: TestSuite(H).run() + """ + if R not in Fields(): + raise NotImplementedError("only implemented with coefficients in a field") + self._group = A + + names = tuple(['e' + name[1:] for name in A.variable_names()]) + from sage.graphs.independent_sets import IndependentSets + from sage.sets.finite_enumerated_set import FiniteEnumeratedSet + indices = [tuple(ind_set) for ind_set in IndependentSets(A._graph)] + indices = FiniteEnumeratedSet(indices) + cat = AlgebrasWithBasis(R.category()).Super().Graded().FiniteDimensional() + CombinatorialFreeModule.__init__(self, R, indices, category=cat, prefix='H') + self._assign_names(names) + + def _repr_(self): + """ + Return a string representation of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: A.cohomology() + Cohomology ring of Right-angled Artin group of Cycle graph + with coefficients in Rational Field + """ + return "Cohomology ring of {} with coefficients in {}".format(self._group, self.base_ring()) + + def _repr_term(self, m): + """ + Return a string representation of the basis element indexed by + ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._repr_term((0,1,3)) + 'e0*e1*e3' + sage: w,x,y,z = H.algebra_generators() + sage: y*w + x*z + -e0*e2 + e1*e3 + """ + if not m: + return '1' + return '*'.join('e' + str(i) for i in m) + + def _ascii_art_term(self, m): + r""" + Return ascii art for the basis element indexed by ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._ascii_art_term((0,1,3)) + e0/\e1/\e3 + sage: w,x,y,z = H.algebra_generators() + sage: ascii_art(y*w + 2*x*z) + -e0/\e2 + 2*e1/\e3 + """ + if not m: + return ascii_art('1') + wedge = '/\\' + return ascii_art(*['e' + str(i) for i in m], sep=wedge) + + def _unicode_art_term(self, m): + """ + Return unicode art for the basis element indexed by ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._unicode_art_term((0,1,3)) + e0∧e1∧e3 + sage: w,x,y,z = H.algebra_generators() + sage: unicode_art(y*w + x*z) + -e0∧e2 + e1∧e3 + """ + if not m: + return unicode_art('1') + import unicodedata + wedge = unicodedata.lookup('LOGICAL AND') + return unicode_art(*['e' + str(i) for i in m], sep=wedge) + + def _latex_term(self, m): + r""" + Return a `\LaTeX` representation of the basis element indexed + by ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._latex_term((0,1,3)) + 'e_{0} \\wedge e_{1} \\wedge e_{3}' + """ + if not m: + return '1' + from sage.misc.latex import latex + return " \\wedge ".join('e_{{{}}}'.format(latex(i)) for i in m) + + def gen(self, i): + """ + Return the ``i``-th standard generator of the algebra ``self``. + + This corresponds to the ``i``-th vertex in the graph + (under a fixed ordering of the vertices). + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.gen(0) + e0 + sage: H.gen(1) + e1 + """ + return self._from_dict({(i,): self.base_ring().one()}, remove_zeros=False) + + @cached_method + def one_basis(self): + """ + Return the basis element indexing `1` of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.one_basis() + () + """ + return () + + @cached_method + def algebra_generators(self): + """ + Return the algebra generators of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.algebra_generators() + Finite family {0: e0, 1: e1, 2: e2, 3: e3} + """ + V = self._group._graph.vertices() + d = {x: self.gen(i) for i,x in enumerate(V)} + from sage.sets.family import Family + return Family(V, lambda x: d[x]) + + def gens(self): + r""" + Return the generators of ``self`` (as an algebra). + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.gens() + (e0, e1, e2, e3) + """ + return tuple(self.algebra_generators()) + + def ngens(self): + """ + Return the number of algebra generators of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.ngens() + 4 + """ + return self._group._graph.num_verts() + + def degree_on_basis(self, I): + """ + Return the degree on the basis element ``clique``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: sorted([H.degree_on_basis(I) for I in H.basis().keys()]) + [0, 1, 1, 1, 1, 2, 2] + """ + return len(I) + + class Element(CliffordAlgebraElement): + """ + An element in the cohomology ring of a right-angled Artin group. + """ + def _mul_(self, other): + """ + Return ``self`` multiplied by ``other``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: b = sum(H.basis()) + sage: b * b + 2*e0*e2 + 2*e1*e3 + 2*e0 + 2*e1 + 2*e2 + 2*e3 + 1 + """ + zero = self.parent().base_ring().zero() + I = self.parent()._indices + d = {} + + for ml,cl in self: + for mr,cr in other: + # Create the next term + t = list(mr) + for i in reversed(ml): + pos = 0 + for j in t: + if i == j: + pos = None + break + if i < j: + break + pos += 1 + cr = -cr + if pos is None: + t = None + break + t.insert(pos, i) + + if t is None: # The next term is 0, move along + continue + + t = tuple(t) + if t not in I: # not an independent set, so this term is also 0 + continue + d[t] = d.get(t, zero) + cl * cr + if d[t] == zero: + del d[t] + + return self.__class__(self.parent(), d) + diff --git a/src/sage/interacts/test_jupyter.rst b/src/sage/interacts/test_jupyter.rst index ed2bcb59a5d..3f307d2c97c 100644 --- a/src/sage/interacts/test_jupyter.rst +++ b/src/sage/interacts/test_jupyter.rst @@ -281,9 +281,7 @@ Test all interacts from the Sage interact library:: Interactive function with 2 widgets n: IntSlider(value=1000, description=u'Number of Tosses', max=10000, min=2, step=100) interval: IntRangeSlider(value=(0, 0), description=u'Plotting range (y)', max=1) - doctest:...: UserWarning: Attempting to set identical bottom==top results - in singular transformations; automatically expanding. - bottom=0.0, top=0.0 + doctest:...: UserWarning: Attempting to set identical bottom == top == 0.0 results in singular transformations; automatically expanding. Test matrix control (see :trac:`27735`):: diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 976983a06f8..43142421140 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -29,40 +29,91 @@ from sage.structure.sage_object import SageObject from sage.homology.homology_group import HomologyGroup from sage.rings.integer_ring import ZZ +from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup +from sage.groups.abelian_gps.abelian_group import AbelianGroup from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups +from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup -from sage.libs.ecl import EclObject, ecl_eval, EclListIterator - +from sage.matrix.all import matrix +from sage.homology.chain_complex import ChainComplex +from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet -# Redirection of ECL and Maxima stdout to /dev/null -# This is also done in the Maxima library, but we -# also do it here for redundancy. -ecl_eval(r"""(defparameter *dev-null* (make-two-way-stream - (make-concatenated-stream) (make-broadcast-stream)))""") -ecl_eval("(setf original-standard-output *standard-output*)") -ecl_eval("(setf *standard-output* *dev-null*)") - -# Loading and initialization of Kenzo -# Note that it will load kenzo.fas file from $SAGE_LOCAL/lib/ecl/ -ecl_eval("(require :kenzo)") -ecl_eval("(in-package :cat)") -ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)") +from sage.libs.ecl import EclObject, ecl_eval, EclListIterator +from sage.features.kenzo import Kenzo # defining the auxiliary functions as wrappers over the kenzo ones -chcm_mat = EclObject("chcm-mat") -homologie = EclObject("homologie") -sphere = EclObject("sphere") -crts_prdc = EclObject("crts-prdc") -moore = EclObject("moore") -k_z = EclObject("k-z") -k_z2 = EclObject("k-z2") -echcm = EclObject("echcm") -loop_space = EclObject("loop-space") -tnsr_prdc = EclObject("tnsr-prdc") -typep = EclObject("typep") -classifying_space = EclObject("classifying-space") -suspension = EclObject("suspension") +kenzo_names = ['add', + 'array-dimensions', + 'basis_aux1', + 'basis_aux1', + 'bicomplex-spectral-sequence', + 'build-finite-ss2', + 'build-mrph-aux', + 'change-sorc-trgt-aux', + 'chcm-mat', + 'chcm-mat2', + 'classifying-space', + 'cmps', + 'convertmatrice', + 'crts-prdc', + 'degr-aux', + 'dffr-aux', + 'dffr_aux1', + 'dgop', + 'dgop-int-ext', + 'dstr-change-sorc-trgt-aux', + 'echcm', + 'eilenberg-moore-spectral-sequence', + 'evaluation-aux1', + 'gmsm', + 'homologie', + 'homotopy-list', + 'idnt-mrph', + 'join', + 'k-z', + 'k-z2', + 'k-zp', + 'kabstractsimplex_aux1', + 'kchaincomplex_aux1', + 'kmorphismchaincomplex_aux1', + 'loop-space', + 'make-array-from-lists', + 'make-array-to-lists', + 'moore', + 'ncol', + 'nlig', + 'nreverse', + 'nth', + 'opps', + 'orgn_aux1', + 'sbtr', + 'serre-spectral-sequence-product', + 'serre-whitehead-spectral-sequence', + 'sfinitesimplicialset_aux1', + 'smash-product', + 'sorc-aux', + 'spectral-sequence-differential-matrix', + 'spectral-sequence-group', + 'sphere', + 'suspension', + 'tnsr-prdc', + 'trgt-aux', + 'wedge', + 'zero-mrph'] + + +# Now initialize Kenzo. For each string s in kenzo_names, the +# following defines __s__, a wrapper for a Kenzo function. For +# example __sphere__ is defined as EclObject("sphere"). Hyphens +# are replaced with underscores to get valid Python identifiers. +if Kenzo().is_present(): + ecl_eval("(require :kenzo)") + ecl_eval("(in-package :cat)") + ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)") + for s in kenzo_names: + name = '__{}__'.format(s.replace('-', '_')) + exec('{} = EclObject("{}")'.format(name, s)) def Sphere(n): @@ -86,7 +137,7 @@ def Sphere(n): sage: [s2.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, 0, 0, 0, 0, 0] """ - kenzosphere = sphere(n) + kenzosphere = __sphere__(n) return KenzoSimplicialSet(kenzosphere) @@ -100,10 +151,9 @@ def MooreSpace(m, n): INPUT: - - ``m`` - A positive integer. The order of the nontrivial homology group. - - - ``n`` - The dimension in which the homology is not trivial + - ``m`` -- A positive integer. The order of the nontrivial homology group. + - ``n`` -- The dimension in which the homology is not trivial OUTPUT: @@ -118,7 +168,7 @@ def MooreSpace(m, n): sage: [m24.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0] """ - kenzomoore = moore(m, n) + kenzomoore = __moore__(m, n) return KenzoSimplicialSet(kenzomoore) @@ -136,7 +186,6 @@ def EilenbergMacLaneSpace(G, n): - ``n`` -- the dimension in which the homotopy is not trivial - OUTPUT: - A :class:`KenzoSimplicialGroup` @@ -151,14 +200,17 @@ def EilenbergMacLaneSpace(G, n): sage: [f3.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, C2, 0, C2, C2, C2] """ - if G is ZZ: - kenzospace = k_z(n) + if G == ZZ: + kenzospace = __k_z__(n) return KenzoSimplicialGroup(kenzospace) - elif G in CommutativeAdditiveGroups() and G.cardinality() == 2: - kenzospace = k_z2(n) + elif G == AdditiveAbelianGroup([2]): + kenzospace = __k_z2__(n) + return KenzoSimplicialGroup(kenzospace) + elif G in CommutativeAdditiveGroups() and G.is_cyclic(): + kenzospace = __k_zp__(G.cardinality(), n) return KenzoSimplicialGroup(kenzospace) else: - raise NotImplementedError("Eilenberg-MacLane spaces are only supported over ZZ and ZZ_2") + raise NotImplementedError("Eilenberg-MacLane spaces are only supported over ZZ and ZZ_n") class KenzoObject(SageObject): @@ -178,8 +230,8 @@ def __init__(self, kenzo_object): TESTS:: sage: from sage.interfaces.kenzo import KenzoObject # optional -kenzo - sage: from sage.interfaces.kenzo import sphere # optional -kenzo - sage: ks = sphere(2) # optional -kenzo + sage: from sage.interfaces.kenzo import __sphere__ # optional -kenzo + sage: ks = __sphere__(2) # optional -kenzo sage: ks # optional -kenzo sage: s2 = KenzoObject(ks) # optional -kenzo @@ -208,13 +260,160 @@ def _repr_(self): return kenzo_string[6:-1] +class KenzoSpectralSequence(KenzoObject): + r""" + Wrapper around Kenzo spectral sequences + """ + + def group(self, p, i, j): + r""" + Return the ``i,j``'th group of the ``p`` page. + + INPUT: + + - ``p`` -- the page to take the group from. + + - ``i`` -- the column where the group is taken from. + + - ``j`` -- the row where the group is taken from. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: EMS = S2.em_spectral_sequence() # optional - kenzo + sage: EMS.group(0, -1, 2) # optional - kenzo + Additive abelian group isomorphic to Z + sage: EMS.group(0, -1, 3) # optional - kenzo + Trivial group + """ + invs = __spectral_sequence_group__(self._kenzo, p, i, j).python() + if not invs: + invs = [] + return AdditiveAbelianGroup(invs) + + def matrix(self, p, i, j): + r""" + Return the matrix that determines the differential from the + ``i,j``'th group of the ``p``'th page. + + INPUT: + + - ``p`` -- the page. + + - ``i`` -- the column of the differential domain. + + - ``j`` -- the row of the differential domain. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: L = S3.loop_space() # optional - kenzo + sage: EMS = L.em_spectral_sequence() # optional - kenzo + sage: EMS.table(1, -5, -2, 5, 8) # optional - kenzo + 0 Z Z + Z + Z Z + Z + Z + 0 0 0 0 + 0 0 Z Z + Z + 0 0 0 0 + sage: EMS.matrix(1, -2 ,8) # optional - kenzo + [ 3 -2 0] + [ 3 0 -3] + [ 0 2 -3] + """ + klist = __spectral_sequence_differential_matrix__(self._kenzo, p, i, j) + plist = klist.python() + if plist is None or plist == [None]: + i = len(self.group(p, i, j).invariants()) + j = len(self.group(p, i - p, j + p - 1).invariants()) + return matrix(i, j) + return matrix(plist) + + def differential(self, p, i, j): + r""" + Return the ``(p, i, j)`` differential morphism of the spectral sequence. + + INPUT: + + - ``p`` -- the page. + + - ``i`` -- the column of the differential domain. + + - ``j`` -- the row of the differential domain. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: L = S3.loop_space() # optional - kenzo + sage: EMS = L.em_spectral_sequence() # optional - kenzo + sage: EMS.table(1,-5,-2,5,8) # optional - kenzo + 0 Z Z + Z + Z Z + Z + Z + 0 0 0 0 + 0 0 Z Z + Z + 0 0 0 0 + sage: EMS.matrix(1, -3, 8) # optional - kenzo + [ 2 -2 2] + sage: EMS.differential(1, -3, 8) # optional - kenzo + Morphism from module over Integer Ring with invariants (0, 0, 0) to module with invariants (0,) that sends the generators to [(2), (-2), (2)] + """ + domain = self.group(p, i, j) + codomain = self.group(p, i - p, j + p - 1) + M = self.matrix(p, i, j) + images = [codomain(r) for r in M.columns()] + return domain.hom(images, codomain=codomain) + + def table(self, p, i1, i2, j1, j2): + r""" + Return a table printing the groups in the ``p`` page. + + INPUT: + + - ``p`` -- the page to print. + + -- ``i1`` -- the first column to print. + + -- ``i2`` -- the last column to print. + + -- ``j1`` -- the first row to print. + + -- ``j2`` -- the last row to print. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: EMS = S2.em_spectral_sequence() # optional - kenzo + sage: EMS.table(0, -2, 2, -2, 2) # optional - kenzo + 0 Z 0 0 0 + 0 0 0 0 0 + 0 0 Z 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + """ + from sage.misc.table import table + groups = [] + for j in range(j2 - j1 + 1): + row = [] + for i in range(i1, i2 + 1): + group = self.group(p, i, j2 - j) + if group.invariants(): + row.append(group.short_name()) + else: + row.append('0') + groups.append(row) + return table(groups) + + class KenzoChainComplex(KenzoObject): r""" - Wrapper to Kenzo chain complexes. + Wrapper to Kenzo chain complexes. Kenzo simplicial sets are a particular case + of Kenzo chain complexes. """ def homology(self, n): r""" - Return the ``n``'th homology group of the kenzo chain complex + Return the ``n``'th homology group of the chain complex associated to this + kenzo object. INPUT: @@ -226,17 +425,17 @@ def homology(self, n): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional - kenzo - sage: s2 = Sphere(2) # optional - kenzo - sage: s2 # optional - kenzo - [K1 Simplicial-Set] - sage: s2.homology(2) # optional - kenzo - Z + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s2 # optional - kenzo + [K1 Simplicial-Set] + sage: s2.homology(2) # optional - kenzo + Z """ - echcm1 = echcm(self._kenzo) - m1 = chcm_mat(echcm1, n) - m2 = chcm_mat(echcm1, n+1) - homology = homologie(m1, m2) + echcm1 = __echcm__(self._kenzo) + m1 = __chcm_mat__(echcm1, n) + m2 = __chcm_mat__(echcm1, n + 1) + homology = __homologie__(m1, m2) lhomomology = [i for i in EclListIterator(homology)] res = [] for component in lhomomology: @@ -256,21 +455,202 @@ def tensor_product(self, other): - A :class:`KenzoChainComplex` - sage: from sage.interfaces.kenzo import Sphere # optional - kenzo - sage: s2 = Sphere(2) # optional - kenzo - sage: s3 = Sphere(3) # optional - kenzo - sage: p = s2.tensor_product(s3) # optional - kenzo - sage: type(p) # optional - kenzo - - sage: [p.homology(i) for i in range(8)] # optional - kenzo - [Z, 0, Z, Z, 0, Z, 0, 0] + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: p = s2.tensor_product(s3) # optional - kenzo + sage: type(p) # optional - kenzo + + sage: [p.homology(i) for i in range(8)] # optional - kenzo + [Z, 0, Z, Z, 0, Z, 0, 0] + """ + return KenzoChainComplex(__tnsr_prdc__(self._kenzo, other._kenzo)) + + def basis(self, dim): + r""" + Return the list of generators of the chain complex associated to the kenzo + object ``self`` in dimension ``dim``. + + INPUT: + + - ``dim`` -- An integer number + + OUTPUT: + + - A list of the form ['G"dim"G0', 'G"dim"G1', 'G"dim"G2', ...]. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: for i in range(6): # optional - kenzo + ....: print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) # optional - kenzo + Basis in dimension 0: ['G0G0', 'G0G1', 'G0G2'] + Basis in dimension 1: ['G1G0', 'G1G1'] + Basis in dimension 2: None + Basis in dimension 3: ['G3G0', 'G3G1'] + Basis in dimension 4: ['G4G0', 'G4G1'] + Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2'] + + """ + return __basis_aux1__(self._kenzo, dim).python() + + def identity_morphism(self): + r""" + Return the identity morphism (degree 0) between ``self`` and itself. + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: tp = s2.tensor_product(s2) # optional - kenzo + sage: idnt = tp.identity_morphism() # optional - kenzo + sage: type(idnt) # optional - kenzo + + """ + return KenzoChainComplexMorphism(__idnt_mrph__(self._kenzo)) + + def null_morphism(self, target=None, degree=None): + r""" + Return the null morphism between the chain complexes ``self`` and ``target`` + of degree ``degree``. + + INPUT: + + - ``target`` -- A KenzoChainComplex or None (default). + - ``degree`` -- An integer number or None (default). + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` representing the null morphism between + ``self`` and ``target`` of degree ``degree``. If ``target`` takes None value, + ``self`` is assumed as the target chain complex; if ``degree`` takes None value, + 0 is assumed as the degree of the null morphism. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp22 = s2.tensor_product(s2) # optional - kenzo + sage: tp22 # optional - kenzo + [K... Chain-Complex] + sage: tp23 = s2.tensor_product(s3) # optional - kenzo + sage: tp23 # optional - kenzo + [K... Chain-Complex] + sage: null1 = tp22.null_morphism() # optional - kenzo + sage: null1 # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null2 = tp22.null_morphism(target = tp23, degree = -3) # optional - kenzo + sage: null2 # optional - kenzo + [K... Morphism (degree -3): K... -> K...] + """ + if target is None: + target = self + if degree is None: + degree = 0 + if not isinstance(target, KenzoChainComplex): + raise ValueError("'target' parameter must be a KenzoChainComplex instance") + elif (not degree == 0) and (not degree.is_integer()): + raise ValueError("'degree' parameter must be an Integer number") + else: + return KenzoChainComplexMorphism(__zero_mrph__(self._kenzo, target._kenzo, degree)) + + def differential(self, dim=None, comb=None): + r""" + Return the differential of a combination. + + INPUT: + + - ``dim`` -- An integer number or None (default) + + - ``comb`` -- A list representing a formal sum of generators in the module + of dimension ``dim`` or None (default). For example, to represent + G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. + Note that the generators must be in ascending order respect to the number + after the second G in their representation; the parameter + ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in + Kenzo. + + OUTPUT: + + - If ``dim`` and ``comb`` are not None, it returns a Kenzo combination + representing the differential of the formal combination represented by + ``comb`` in the chain complex ``self`` in dimension ``dim``. On the other + hand, if `dim`` or ``comb`` (or both) take None value, the differential + :class:`KenzoMorphismChainComplex` of ``self`` is returned. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: kenzo_chcm.differential(4, [1, 'G4G0']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 3} + <1 * G3G0> + <3 * G3G1> + ------------------------------------------------------------------------------ + + sage: kenzo_chcm.basis(5) # optional - kenzo + ['G5G0', 'G5G1', 'G5G2'] + sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <6 * G4G0> + <-3 * G4G1> + ------------------------------------------------------------------------------ + + """ + if dim is not None and comb is not None: + cmbn_list = pairing(comb) + return KenzoObject(__dffr_aux1__(self._kenzo, dim, cmbn_list)) + else: + return KenzoChainComplexMorphism(__dffr_aux__(self._kenzo)) + + def orgn(self): + r""" + Return the :orgn slot of Kenzo, which stores as a list the origin of the object + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: l2 = s2.loop_space() # optional - kenzo + sage: l2.orgn() # optional - kenzo + '(LOOP-SPACE [K... Simplicial-Set])' + sage: A = l2.cartesian_product(s2) # optional - kenzo + sage: A.orgn() # optional - kenzo + '(CRTS-PRDC [K... Simplicial-Group] [K... Simplicial-Set])' """ - return KenzoChainComplex(tnsr_prdc(self._kenzo, other._kenzo)) + return str(__orgn_aux1__(self._kenzo)) class KenzoSimplicialSet(KenzoChainComplex): r""" Wrapper to Kenzo simplicial sets. + + In Kenzo, the homology of a simplicial set in computed from its associated + chain complex. Hence, this class inherits from `KenzoChainComplex`. """ def loop_space(self, n=1): @@ -297,7 +677,7 @@ def loop_space(self, n=1): sage: [l2.homology(i) for i in range(8)] # optional - kenzo [Z, Z, Z, Z, Z, Z, Z, Z] """ - return KenzoSimplicialGroup(loop_space(self._kenzo, n)) + return KenzoSimplicialGroup(__loop_space__(self._kenzo, n)) def cartesian_product(self, other): r""" @@ -322,7 +702,7 @@ def cartesian_product(self, other): sage: [p.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, Z] """ - prod_kenzo = crts_prdc(self._kenzo, other._kenzo) + prod_kenzo = __crts_prdc__(self._kenzo, other._kenzo) return KenzoSimplicialSet(prod_kenzo) def suspension(self): @@ -343,7 +723,207 @@ def suspension(self): sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, Z, 0] """ - return KenzoSimplicialSet(suspension(self._kenzo)) + return KenzoSimplicialSet(__suspension__(self._kenzo)) + + def homotopy_group(self, n): + """ + Return the n'th homotopy group of ``self`` + + INPUT: + + - ``n`` -- the dimension of the homotopy group to be computed + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: p = s2.cartesian_product(s2) # optional - kenzo + sage: p.homotopy_group(3) # optional - kenzo + Multiplicative Abelian group isomorphic to Z x Z + + + .. WARNING:: + + This method assumes that the underlying space is simply connected. + You might get wrong answers if it is not. + """ + if n not in ZZ or n < 2: + raise ValueError("""homotopy groups can only be computed + for dimensions greater than 1""") + lgens = __homotopy_list__(self._kenzo, n).python() + if lgens is not None: + trgens = [0 if i == 1 else i for i in sorted(lgens)] + return AbelianGroup(trgens) + else: + return AbelianGroup([]) + + def em_spectral_sequence(self): + r""" + Return the Eilenberg-Moore spectral sequence of ``self``. + + OUTPUT: + + - A :class:`KenzoSpectralSequence` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: EMS = S2.em_spectral_sequence() # optional - kenzo + sage: EMS.table(0, -2, 2, -2, 2) # optional - kenzo + 0 Z 0 0 0 + 0 0 0 0 0 + 0 0 Z 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + + + .. WARNING:: + + This method assumes that the underlying space is simply connected. + You might get wrong answers if it is not. + """ + if self.homology(1).invariants(): + raise ValueError("""Eilenberg-Moore spectral sequence implemented + only for 1-reduced simplicial sets""") + return KenzoSpectralSequence(__eilenberg_moore_spectral_sequence__(self._kenzo)) + + def sw_spectral_sequence(self): + r""" + Return the Serre sequence of the first step of the Whitehead tower. + + OUTPUT: + + - A :class:`KenzoSpectralSequence` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: E = S3.sw_spectral_sequence() # optional - kenzo + sage: T = E.table(0, 0, 4, 0, 4) # optional - kenzo + sage: T # optional - kenzo + Z 0 0 Z 0 + 0 0 0 0 0 + Z 0 0 Z 0 + 0 0 0 0 0 + Z 0 0 Z 0 + """ + if self.homology(1).invariants(): + raise ValueError("""Eilenberg-Moore spectral sequence implemented + only for 1-reduced simplicial sets""") + return KenzoSpectralSequence(__serre_whitehead_spectral_sequence__(self._kenzo)) + + def serre_spectral_sequence(self): + r""" + Return the spectral sequence of ``self``. + + The object self must be created as a cartesian product (twisted or not). + + OUTPUT: + + - A :class:`KenzoSpectralSequence` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere + sage: S2 = Sphere(2) # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: P = S2.cartesian_product(S3) # optional - kenzo + sage: E = P.serre_spectral_sequence() # optional - kenzo + sage: E.table(0, 0, 2, 0, 3) # optional - kenzo + Z 0 Z + 0 0 0 + 0 0 0 + Z 0 Z + + .. WARNING:: + + This method assumes that the underlying space is simply connected. + You might get wrong answers if it is not. + """ + if self.homology(1).invariants(): + raise ValueError("""Eilenberg-Moore spectral sequence implemented + only for 1-reduced simplicial sets""") + return KenzoSpectralSequence(__serre_spectral_sequence_product__(self._kenzo)) + + def wedge(self, other): + r""" + Return the wedge of ``self`` and ``other``. + + INPUT: + + - ``other`` -- the Kenzo simplicial set with which the wedge is made + + OUTPUT: + + - A :class:`KenzoSimplicialSet` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: w = s2.wedge(s3) # optional - kenzo + sage: type(w) # optional - kenzo + + sage: [w.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, Z, Z, 0, 0] + """ + wedge_kenzo = __wedge__(self._kenzo, other._kenzo) + return KenzoSimplicialSet(wedge_kenzo) + + def join(self, other): + r""" + Return the join of ``self`` and ``other``. + + INPUT: + + - ``other`` -- the Kenzo simplicial set with which the join is made + + OUTPUT: + + - A :class:`KenzoSimplicialSet` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: j = s2.join(s3) # optional - kenzo + sage: type(j) # optional - kenzo + + sage: [j.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, 0, 0, 0, 0] + """ + join_kenzo = __join__(self._kenzo, other._kenzo) + return KenzoSimplicialSet(join_kenzo) + + def smash_product(self, other): + r""" + Return the smash product of ``self`` and ``other``. + + INPUT: + + - ``other`` -- the Kenzo simplicial set with which the smash product is made + + OUTPUT: + + - A :class:`KenzoSimplicialSet` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: s = s2.smash_product(s3) # optional - kenzo + sage: type(s) # optional - kenzo + + sage: [s.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, 0, 0, 0, Z] + """ + smash_kenzo = __smash_product__(self._kenzo, other._kenzo) + return KenzoSimplicialSet(smash_kenzo) class KenzoSimplicialGroup(KenzoSimplicialSet): @@ -370,4 +950,1058 @@ def classifying_space(self): sage: [c.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0] """ - return KenzoSimplicialGroup(classifying_space(self._kenzo)) + return KenzoSimplicialGroup(__classifying_space__(self._kenzo)) + + +def k2s_matrix(kmatrix): + r""" + Convert an array of ECL to a matrix of Sage. + + INPUT: + + - ``kmatrix`` -- An array in ECL + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import k2s_matrix # optional - kenzo + sage: from sage.libs.ecl import EclObject + sage: M = EclObject("#2A((1 2 3) (3 2 1) (1 1 1))") + sage: k2s_matrix(M) # optional - kenzo + [1 2 3] + [3 2 1] + [1 1 1] + """ + dimensions = __array_dimensions__(kmatrix).python() + kmatrix_list = __make_array_to_lists__(kmatrix).python() + return matrix(dimensions[0], dimensions[1], kmatrix_list) + + +def s2k_matrix(smatrix): + r""" + Convert a matrix of Sage to an array of ECL. + + INPUT: + + - ``smatrix`` -- A matrix in Sage + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import s2k_matrix # optional - kenzo + sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) + sage: s2k_matrix(A) # optional - kenzo + + """ + initcontents = [] + dimensions = smatrix.dimensions() + for i in smatrix.rows(): + initcontents.append(i.list()) + return __make_array_from_lists__(dimensions[0], dimensions[1], initcontents) + + +def s2k_dictmat(sdictmat): + r""" + Convert a dictionary in Sage, whose values are matrices, to an assoc list + in ECL. + + INPUT: + + - ``sdictmat`` -- A dictionary in Sage + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import s2k_dictmat # optional - kenzo + sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) + sage: B = Matrix([[1,2],[2,1],[1,1]]) + sage: d = {1 : A, 2 : B} + sage: s2k_dictmat(d) # optional - kenzo + + + """ + rslt = EclObject([]) + for k in sdictmat.keys(): + rslt = EclObject(k).cons(s2k_matrix(sdictmat[k])).cons(rslt) + return rslt + + +def pairing(slist): + r""" + Convert a list of Sage (which has an even length) to an assoc list in ECL. + + INPUT: + + - ``slist`` -- A list in Sage + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import pairing # optional - kenzo + sage: l = [1,2,3] + sage: pairing(l) # optional - kenzo + + """ + rslt = EclObject([]) + for k in range(len(slist) - 1, 0, -2): + rslt = EclObject(slist[k - 1]).cons(EclObject(slist[k])).cons(rslt) + return rslt + + +def KChainComplex(chain_complex): + r""" + Construct a KenzoChainComplex from a ChainComplex of degree = -1 in + Sage. + + INPUT: + + - ``chain_complex`` -- A ChainComplex of degree = -1 + + OUTPUT: + + - A KenzoChainComplex + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: kenzo_chcm.homology(5) # optional - kenzo + Z x Z + """ + d = chain_complex.differential() + chcm = s2k_dictmat(d) + str_orgn = str(d)[1:-1].replace(":", " ").replace(" ", ".").replace("\n", "").replace(",", "") + return KenzoChainComplex(__kchaincomplex_aux1__(chcm, str_orgn)) + + +def SChainComplex(kchaincomplex, start=0, end=15): + r""" + Convert the KenzoChainComplex ``kchcm`` (between dimensions ``start`` and + ``end``) to a ChainComplex. + + INPUT: + + - ``kchaincomplex`` -- A KenzoChainComplex + + - ``start`` -- An integer number (optional, default 0) + + - ``end`` -- An integer number greater than or equal to ``start`` (optional, default 15) + + OUTPUT: + + - A ChainComplex + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: SChainComplex(KChainComplex(sage_chcm)) == sage_chcm # optional - kenzo + True + + :: + + sage: from sage.interfaces.kenzo import SChainComplex, Sphere # optional - kenzo + sage: S4 = Sphere(4) # optional - kenzo + sage: C = SChainComplex(S4) # optional - kenzo + sage: C # optional - kenzo + Chain complex with at most 3 nonzero terms over Integer Ring + sage: C._ascii_art_() # optional - kenzo + 0 <-- C_4 <-- 0 ... 0 <-- C_0 <-- 0 + sage: [C.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, 0, 0, Z, 0] + """ + matrices = {} + for i in range(start, end): + dffr_i = __chcm_mat2__(kchaincomplex._kenzo, i) + nlig = __nlig__(dffr_i).python() + ncol = __ncol__(dffr_i).python() + if ((nlig != 0) and (ncol != 0)): + matrices[i] = k2s_matrix(__convertmatrice__(dffr_i)) + else: + matrices[i] = matrix(nlig, ncol) + return ChainComplex(matrices, degree=-1) + + +def SAbstractSimplex(simplex, dim): + r""" + Convert an abstract simplex of Kenzo to an AbstractSimplex. + + INPUT: + + - ``simplex`` -- An abstract simplex of Kenzo. + + - ``dim``-- The dimension of ``simplex``. + + OUTPUT: + + - An AbstractSimplex. + + EXAMPLES:: + + sage: from sage.libs.ecl import EclObject, ecl_eval + sage: from sage.interfaces.kenzo import KenzoObject,\ + ....: SAbstractSimplex # optional - kenzo + sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo + sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo + sage: SAbSm1.degeneracies() # optional - kenzo + [3, 2, 1, 0] + sage: SAbSm1.dimension() # optional - kenzo + 6 + sage: SAbSm2.dimension() # optional - kenzo + 11 + """ + degeneracies = __dgop_int_ext__(__dgop__(simplex._kenzo)).python() + if degeneracies is None: + degeneracies = [] + else: + degeneracies = tuple(degeneracies) + name = __gmsm__(simplex._kenzo).python() + return AbstractSimplex(dim, degeneracies, name=name) + + +def KAbstractSimplex(simplex): + r""" + Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo. + + INPUT: + + - ``simplex`` -- An AbstractSimplex. + + OUTPUT: + + - An abstract simplex of Kenzo. + + EXAMPLES:: + + sage: from sage.homology.simplicial_set import AbstractSimplex + sage: from sage.interfaces.kenzo import KAbstractSimplex,\ + ....: SAbstractSimplex # optional - kenzo + sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo + sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo + sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo + True + sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo + True + """ + return KenzoObject(__kabstractsimplex_aux1__(simplex.degeneracies(), + 's' + str(hash(simplex)))) + + +def KFiniteSimplicialSet(sset): + r""" + Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo. + + INPUT: + + - ``sset`` -- A finite SimplicialSet. + + OUTPUT: + + - A finite simplicial set of Kenzo. + + EXAMPLES:: + + sage: from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet + sage: from sage.interfaces.kenzo import KFiniteSimplicialSet # optional - kenzo + sage: s0 = AbstractSimplex(0, name='s0') + sage: s1 = AbstractSimplex(0, name='s1') + sage: s2 = AbstractSimplex(0, name='s2') + sage: s01 = AbstractSimplex(1, name='s01') + sage: s02 = AbstractSimplex(1, name='s02') + sage: s12 = AbstractSimplex(1, name='s12') + sage: s012 = AbstractSimplex(2, name='s012') + sage: Triangle = SimplicialSet({s01: (s1, s0),\ + ....: s02: (s2, s0), s12: (s2, s1)}, base_point = s0) + sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo + sage: KTriangle.homology(1) # optional - kenzo + Z + sage: KTriangle.basis(1) # optional - kenzo + ['CELL_1_0', 'CELL_1_1', 'CELL_1_2'] + sage: S1 = simplicial_sets.Sphere(1) + sage: S3 = simplicial_sets.Sphere(3) + sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo + sage: KS1vS3.homology(3) # optional - kenzo + Z + """ + from sage.homology.simplicial_set_constructions import ProductOfSimplicialSets + if isinstance(sset, ProductOfSimplicialSets): + f0 = KFiniteSimplicialSet(sset.factor(0)) + for f1 in sset.factors()[1:]: + f0 = f0.cartesian_product(KFiniteSimplicialSet(f1)) + return f0 + else: + allcells = sset.cells() + namecells = {c: 'cell_{}_{}'.format(d, allcells[d].index(c)) + for d in allcells for c in allcells[d]} + dim = sset.dimension() + list_rslt = [namecells[i] for i in sset.n_cells(0)] + if (dim > 0): + for k in range(1, dim + 1): + k_cells = sset.n_cells(k) + if k_cells: + list_rslt.append(k) + for x in k_cells: + list_rslt.append(namecells[x]) + auxiliar_list = [] + for z in sset.faces(x): + degen_z = z.degeneracies() + name = namecells[z.nondegenerate()] + degen_z.append(name) + auxiliar_list.append(degen_z) + list_rslt.append(auxiliar_list) + return KenzoSimplicialSet(__build_finite_ss2__(list_rslt)) + + +def SFiniteSimplicialSet(ksimpset, limit): + r""" + Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a + finite SimplicialSet in Sage. + + INPUT: + + - ``ksimpset`` -- A finite simplicial set in Kenzo. + + - ``limit`` -- A natural number. + + OUTPUT: + + - A finite SimplicialSet. + + EXAMPLES:: + + sage: from sage.homology.simplicial_set import SimplicialSet + sage: from sage.interfaces.kenzo import AbstractSimplex,\ + ....: KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo + sage: s0 = AbstractSimplex(0, name='s0') # optional - kenzo + sage: s1 = AbstractSimplex(0, name='s1') # optional - kenzo + sage: s2 = AbstractSimplex(0, name='s2') # optional - kenzo + sage: s01 = AbstractSimplex(1, name='s01') # optional - kenzo + sage: s02 = AbstractSimplex(1, name='s02') # optional - kenzo + sage: s12 = AbstractSimplex(1, name='s12') # optional - kenzo + sage: s012 = AbstractSimplex(2, name='s012') # optional - kenzo + sage: Triangle = SimplicialSet({s01: (s1, s0),\ + ....: s02: (s2, s0), s12: (s2, s1)}, base_point = s0) # optional - kenzo + sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo + sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo + sage: STriangle.homology() # optional - kenzo + {0: 0, 1: Z} + sage: S1 = simplicial_sets.Sphere(1) # optional - kenzo + sage: S3 = simplicial_sets.Sphere(3) # optional - kenzo + sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo + sage: SS1vS3 = SFiniteSimplicialSet(KS1vS3, 3) # optional - kenzo + sage: SS1vS3.homology() # optional - kenzo + {0: 0, 1: Z, 2: 0, 3: Z} + """ + list_orgn = __orgn_aux1__(ksimpset._kenzo).python() + if __nth__(0, list_orgn).python()[0] == 'CRTS-PRDC': + return SFiniteSimplicialSet( + KenzoSimplicialSet(__nth__(1, list_orgn)), limit).cartesian_product( + SFiniteSimplicialSet(KenzoSimplicialSet(__nth__(2, list_orgn)), limit)) + rslt = {} + simplices = [] + faces = [] + bases = [] + names = [] + for k in range(limit + 1): + basis_k = __basis_aux1__(ksimpset._kenzo, k) + names_k = ksimpset.basis(k) + lbasis_k = [AbstractSimplex(k, name=i) for i in EclListIterator(basis_k)] + bases.append(lbasis_k) + names.append(names_k) + all_simplices = __sfinitesimplicialset_aux1__(ksimpset._kenzo, limit) + lall_simplices = [i for i in EclListIterator(all_simplices)] + dim = 1 + for Kdim in lall_simplices: + for simp in Kdim: + index1 = names[dim].index(str(simp.car())) + lKdim_cdr = [] + for i in EclListIterator(simp.cdr()): + degenop = __dgop_int_ext__(__dgop__(i)).python() + if degenop is None: + degenop = [] + index2 = names[dim - len(degenop) - 1].index(str(__gmsm__(i))) + lKdim_cdr.append(bases[dim - len(degenop) - 1][index2].apply_degeneracies(*degenop)) + simplices.append(bases[dim][index1]) + faces.append(tuple(lKdim_cdr)) + dim += 1 + for i in range(len(simplices)): + rslt[simplices[i]] = faces[i] + return SimplicialSet(rslt) + + +class KenzoChainComplexMorphism(KenzoObject): + r""" + Wrapper to Kenzo morphisms between chain complexes. + """ + + def source_complex(self): + r""" + Return the source chain complex of the morphism. + + OUTPUT: + + - A :class:`KenzoChainComplex` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] + sage: differential_morphism.source_complex() # optional - kenzo + [K... Chain-Complex] + """ + return KenzoChainComplex(__sorc_aux__(self._kenzo)) + + def target_complex(self): + r""" + Return the target chain complex of the morphism. + + OUTPUT: + + - A :class:`KenzoChainComplex` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] + sage: differential_morphism.target_complex() # optional - kenzo + [K... Chain-Complex] + """ + return KenzoChainComplex(__trgt_aux__(self._kenzo)) + + def degree(self): + r""" + Return the degree of the morphism. + + OUTPUT: + + - An integer number, the degree of the morphism. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] + sage: differential_morphism.degree() # optional - kenzo + -1 + sage: differential_morphism.composite(differential_morphism).degree() # optional - kenzo + -2 + sage: kenzo_chcm.null_morphism().degree() # optional - kenzo + 0 + """ + return __degr_aux__(self._kenzo).python() + + def evaluation(self, dim, comb): + r""" + Apply the morphism on a combination ``comb`` of dimension ``dim``. + + INPUT: + + - ``dim`` -- An integer number + + - ``comb`` -- A list representing a formal sum of generators in the module + of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 + we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the + generators must be in ascending order respect to the number after the + second G in their representation; the parameter + ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in + Kenzo. + + OUTPUT: + + - A Kenzo combination representing the result of applying the morphism on the formal + combination represented by ``comb`` in the chain complex ``self`` in + dimension ``dim``. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] + sage: dif_squared = differential_morphism.composite(differential_morphism) # optional - kenzo + sage: dif_squared # optional - kenzo + [K... Morphism (degree -2): K... -> K...] + sage: kenzo_chcm.basis(5) # optional - kenzo + ['G5G0', 'G5G1', 'G5G2'] + sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <6 * G4G0> + <-3 * G4G1> + ------------------------------------------------------------------------------ + + sage: differential_morphism.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <6 * G4G0> + <-3 * G4G1> + ------------------------------------------------------------------------------ + + sage: dif_squared.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 3} + ------------------------------------------------------------------------------ + + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idx2 = idnt.sum(idnt) # optional - kenzo + sage: idnt.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 5} + <1 * G5G0> + <2 * G5G2> + ------------------------------------------------------------------------------ + + sage: idx2.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 5} + <2 * G5G0> + <4 * G5G2> + ------------------------------------------------------------------------------ + + """ + if dim.is_integer(): + if isinstance(comb, list): + cmbn_list = pairing(comb) + return KenzoObject(__evaluation_aux1__(self._kenzo, dim, cmbn_list)) + else: + raise ValueError("'comb' parameter must be a list") + else: + raise ValueError("'dim' parameter must be an integer number") + + def opposite(self): + r""" + Return the opposite morphism of ``self``, i.e., -1 x ``self``. + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: opps_id = idnt.opposite() # optional - kenzo + sage: opps_id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: idnt.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <2 * G4G0> + <-5 * G4G1> + ------------------------------------------------------------------------------ + + sage: opps_id.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <-2 * G4G0> + <5 * G4G1> + ------------------------------------------------------------------------------ + + """ + return KenzoChainComplexMorphism(__opps__(self._kenzo)) + + def composite(self, object=None): + r""" + Return the composite of ``self`` and the morphism(s) given by the parameter ``object``. + + INPUT: + + - ``object`` -- A KenzoChainComplexMorphism instance, a KenzoChainComplex instance, a tuple + of KenzoChainComplexMorphism and KenzoChainComplex instances, or None (default). + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism`: if ``object`` is a KenzoChainComplexMorphism, the + composite of ``self`` and ``object`` is returned; if ``object`` is a KenzoChainComplex, + the composite of ``self`` and the differential morphism of ``object`` is returned; if + ``object`` is a tuple, the composite of ``self`` and the morphisms or the differential + morphisms of the given chain complexes in ``object`` is returned (if ``object`` is + None, ``self`` morphism is returned). + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp22 = s2.tensor_product(s2) # optional - kenzo + sage: tp23 = s2.tensor_product(s3) # optional - kenzo + sage: idnt = tp22.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null = tp23.null_morphism(target = tp22, degree = 4) # optional - kenzo + sage: null # optional - kenzo + [K... Morphism (degree 4): K... -> K...] + sage: idnt.composite((tp22, null)) # optional - kenzo + [K... Morphism (degree 3): K... -> K...] + """ + if object is None: + return self + if isinstance(object, KenzoChainComplexMorphism): + return KenzoChainComplexMorphism(__cmps__(self._kenzo, object._kenzo)) + elif isinstance(object, KenzoChainComplex): + return KenzoChainComplexMorphism(__cmps__(self._kenzo, __dffr_aux__(object._kenzo))) + elif isinstance(object, tuple): + rslt = self._kenzo + for mrph in object: + rslt = __cmps__(rslt, mrph._kenzo) + return KenzoChainComplexMorphism(rslt) + + def sum(self, object=None): + r""" + Return a morphism, sum of the morphism ``self`` and the morphism(s) given + by the parameter ``object``. + + INPUT: + + - ``object`` -- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism + instances or None (default). + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism`, sum of the morphism ``self`` and the morphism(s) + given by ``object`` (if ``object`` is None, ``self`` morphism is returned). + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: opps_id = idnt.opposite() # optional - kenzo + sage: opps_id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null = kenzo_chcm.null_morphism() # optional - kenzo + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: idx2 = idnt.sum(idnt) # optional - kenzo + sage: idx5 = idx2.sum(\ + ....: (opps_id, idnt, idnt, null, idx2.sum(idnt), opps_id)) # optional - kenzo + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <4 * G4G0> + <-10 * G4G1> + ------------------------------------------------------------------------------ + + sage: idx5.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <10 * G4G0> + <-25 * G4G1> + ------------------------------------------------------------------------------ + + """ + if object is None: + return self + if isinstance(object, KenzoChainComplexMorphism): + return KenzoChainComplexMorphism(__add__(self._kenzo, object._kenzo)) + elif isinstance(object, tuple): + rslt = self._kenzo + for mrph in object: + rslt = __add__(rslt, mrph._kenzo) + return KenzoChainComplexMorphism(rslt) + + def substract(self, object=None): + r""" + Return a morphism, difference of the morphism ``self`` and the morphism(s) given by the + parameter ``object``. + + INPUT: + + - ``object`` -- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism + instances or None (default). + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism`, difference of the morphism ``self`` and the + morphism(s) given by ``object`` (if ``object`` is None, ``self`` morphism is returned). + For example, if ``object`` = (mrph1, mrph2, mrph3) the result is + ``self`` - mrph1 - mrph2 - mrph3. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: opps_id = idnt.opposite() # optional - kenzo + sage: opps_id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null = kenzo_chcm.null_morphism() # optional - kenzo + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: idx2 = idnt.substract(opps_id) # optional - kenzo + sage: opps_idx2 = idx2.substract\ + ....: ((opps_id, idnt, idnt, null, idx2.substract(opps_id))) # optional - kenzo + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <4 * G4G0> + <-10 * G4G1> + ------------------------------------------------------------------------------ + + sage: opps_idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <-4 * G4G0> + <10 * G4G1> + ------------------------------------------------------------------------------ + + """ + if object is None: + return self + if isinstance(object, KenzoChainComplexMorphism): + return KenzoChainComplexMorphism(__sbtr__(self._kenzo, object._kenzo)) + elif isinstance(object, tuple): + rslt = self._kenzo + for mrph in object: + rslt = __sbtr__(rslt, mrph._kenzo) + return KenzoChainComplexMorphism(rslt) + + def change_source_target_complex(self, source=None, target=None): + r""" + Build, from the morphism ``self``, a new morphism with ``source`` + and ``target`` as source and target Kenzo chain complexes, respectively. + + INPUT: + + - ``source`` -- A KenzoChainComplex instance or None (default). + + - ``target`` -- A KenzoChainComplex instance or None (default). + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` inheriting from ``self`` the + degree (:degr slot in Kenzo), the algorithm (:intr slot in Kenzo) + and the strategy (:strt slot in Kenzo). The source and target slots + of this new morphism are given by the parameters ``source`` and + ``target`` respectively; if any parameter is ommited, the corresponding + slot is inherited from ``self``. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo + sage: from sage.libs.ecl import ecl_eval + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: ZCC # optional - kenzo + [K... Chain-Complex] + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp = s2.tensor_product(s3) # optional - kenzo + sage: tp # optional - kenzo + [K... Filtered-Chain-Complex] + sage: null = ZCC.null_morphism(tp) # optional - kenzo + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null.source_complex() # optional - kenzo + [K... Chain-Complex] + sage: null2 = null.change_source_target_complex(source = tp) # optional - kenzo + sage: null2 # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null2.source_complex() # optional - kenzo + [K... Filtered-Chain-Complex] + """ + source = source or self.source_complex() + target = target or self.target_complex() + return KenzoChainComplexMorphism( + __change_sorc_trgt_aux__(self._kenzo, source._kenzo, target._kenzo)) + + def destructive_change_source_target_complex(self, source=None, target=None): + r""" + Modify destructively the morphism ``self`` taking ``source`` and ``target`` as source and + target Kenzo chain complexes of ``self``, respectively. + + INPUT: + + - ``source`` -- A KenzoChainComplex instance or None (default). + + - ``target`` -- A KenzoChainComplex instance or None (default). + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism`. The source and target slots of ``self`` are replaced + respectively by the parameters ``source`` and ``target``; if any parameter is ommited, the + corresponding slot is inherited from ``self``. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo + sage: from sage.libs.ecl import ecl_eval + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: ZCC # optional - kenzo + [K... Chain-Complex] + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp = s2.tensor_product(s3) # optional - kenzo + sage: tp # optional - kenzo + [K... Filtered-Chain-Complex] + sage: null = ZCC.null_morphism(tp) # optional - kenzo + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null.target_complex() # optional - kenzo + [K... Filtered-Chain-Complex] + sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo + [K... Cohomology-Class on K... of degree 0] + sage: null.target_complex() # optional - kenzo + [K... Chain-Complex] + """ + source = source or self.source_complex() + target = target or self.target_complex() + return KenzoChainComplexMorphism( + __dstr_change_sorc_trgt_aux__(self._kenzo, source._kenzo, target._kenzo)) + + +def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): + r""" + Build a morphism of chain complexes by means of the corresponding build-mrph Kenzo + function. + + INPUT: + + - ``source_complex`` -- The source object as a KenzoChainComplex instance + + - ``target_complex`` -- The target object as a KenzoChainComplex instance + + - ``degree`` -- An integer number representing the degree of the morphism + + - ``algorithm`` -- A Lisp function defining the mapping (:intr slot in Kenzo) + + - ``strategy`` -- The strategy (:strt slot in Kenzo), which must be one of + the two strings ``gnrt`` or ``cmbn``, depending if the ``algorithm`` (a Lisp + function) uses as arguments a degree and a generator or a combination, + respectively. + + - ``orgn`` -- A list containing a description about the origin of the morphism + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KenzoChainComplex,\ + ....: build_morphism # optional - kenzo + sage: from sage.libs.ecl import ecl_eval + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: A = build_morphism(ZCC, ZCC, -1,\ + ....: ecl_eval("#'(lambda (comb) (cmbn (1- (degr comb))))"),\ + ....: "cmbn", ["zero morphism on ZCC"]) # optional - kenzo + sage: A.target_complex() # optional - kenzo + [K... Chain-Complex] + sage: A.degree() # optional - kenzo + -1 + sage: type(A) # optional - kenzo + + """ + return KenzoChainComplexMorphism( + __build_mrph_aux__(source_complex._kenzo, target_complex._kenzo, + degree, algorithm, ":"+strategy, orgn)) + + +def morphism_dictmat(morphism): + r""" + Computes a list of matrices in ECL associated to a morphism in Sage. + + INPUT: + + - ``morphism`` -- A morphism of chain complexes + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import morphism_dictmat # optional - kenzo + sage: X = simplicial_complexes.Simplex(1) + sage: Y = simplicial_complexes.Simplex(0) + sage: g = Hom(X,Y)({0:0, 1:0}) + sage: f = g.associated_chain_complex_morphism() + sage: morphism_dictmat(f) # optional - kenzo + + """ + rslt = EclObject([]) + source = morphism.domain() + d = source.differential() + for k in d.keys(): + rslt = EclObject(k).cons(s2k_matrix(morphism.in_degree(k))).cons(rslt) + return rslt + + +def KChainComplexMorphism(morphism): + r""" + Construct a KenzoChainComplexMorphism from a ChainComplexMorphism in Sage. + + INPUT: + + - ``morphism`` -- A morphism of chain complexes + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplexMorphism # optional - kenzo + sage: C = ChainComplex({0: identity_matrix(ZZ, 1)}) + sage: D = ChainComplex({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) + sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) + sage: g = KChainComplexMorphism(f) # optional - kenzo + sage: g # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: g.source_complex() # optional - kenzo + [K... Chain-Complex] + sage: g.target_complex() # optional - kenzo + [K... Chain-Complex] + """ + source = KChainComplex(morphism.domain()) + target = KChainComplex(morphism.codomain()) + matrix_list = morphism_dictmat(morphism) + return KenzoChainComplexMorphism( + __kmorphismchaincomplex_aux1__(matrix_list, source._kenzo, target._kenzo)) + + +def s2k_listofmorphisms(l): + r""" + Computes a list of morphisms of chain complexes in Kenzo from a list of morphisms in Sage. + + INPUT: + + - ``l`` -- A list of morphisms of chain complexes + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import s2k_listofmorphisms # optional - kenzo + sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) + sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) + sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) + sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) + sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) + sage: l = [M1, M2] + sage: s2k_listofmorphisms(l) # optional - kenzo + K...] [K... Morphism (degree 0): K... -> K...])> + """ + rslt = EclObject([]) + for m in l: + rslt = EclObject(KChainComplexMorphism(m)._kenzo).cons(rslt) + return __nreverse__(rslt) + + +def BicomplexSpectralSequence(l): + r""" + Construct the spectral sequence associated to the bicomplex given by a list of morphisms. + + INPUT: + + - ``l`` -- A list of morphisms of chain complexes + + OUTPUT: + + - A :class:`KenzoSpectralSequence` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import BicomplexSpectralSequence # optional - kenzo + sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) + sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) + sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) + sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) + sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) + sage: l = [M1, M2] + sage: E = BicomplexSpectralSequence(l) # optional - kenzo + sage: E.group(2,0,1) # optional - kenzo + Additive abelian group isomorphic to Z/2 + Z + sage: E.table(3,0,2,0,2) # optional - kenzo + 0 0 0 + Z/2 + Z/4 0 0 + 0 0 Z + sage: E.matrix(2,2,0) # optional - kenzo + [ 0 0] + [-4 0] + """ + return KenzoSpectralSequence(__bicomplex_spectral_sequence__(s2k_listofmorphisms(l))) diff --git a/src/sage/interfaces/macaulay2.py b/src/sage/interfaces/macaulay2.py index f6f7df8dc7f..a2e93ebb688 100644 --- a/src/sage/interfaces/macaulay2.py +++ b/src/sage/interfaces/macaulay2.py @@ -857,7 +857,7 @@ def _macaulay2_input_ring(self, base_ring, vars, order='GRevLex'): sage: macaulay2._macaulay2_input_ring(R.base_ring(), R.gens(), 'Lex') # optional - macaulay2 'sage...[symbol x, MonomialSize=>16, MonomialOrder=>Lex]' """ - if not isinstance(base_ring, string_types): + if not isinstance(base_ring, str): base_ring = self(base_ring).name() varstr = str(vars)[1:-1].rstrip(',') diff --git a/src/sage/knots/link.py b/src/sage/knots/link.py index 8d98039a30a..52ceaf4253b 100644 --- a/src/sage/knots/link.py +++ b/src/sage/knots/link.py @@ -310,6 +310,15 @@ def __init__(self, data): Traceback (most recent call last): ... ValueError: invalid input: data must be either a list or a braid + + Verify that :trac:`29692` is fixed:: + + sage: B = BraidGroup(5) + sage: L = Link(B([3,4,3,-4])) + sage: L + Link with 1 component represented by 4 crossings + sage: L.braid() + s0*s1*s0*s1^-1 """ if isinstance(data, list): if len(data) != 2 or not all(isinstance(i, list) for i in data[0]): @@ -338,20 +347,7 @@ def __init__(self, data): from sage.groups.braid import Braid, BraidGroup if isinstance(data, Braid): # Remove all unused strands - support = sorted(set(abs(x) for x in data.Tietze())) - i = 0 - cur = 1 - while i < len(support): - if support[i] == cur: - cur += 1 - i += 1 - elif support[i] == cur + 1: - support.insert(i, cur+1) - cur += 2 - i += 2 - else: - cur = support[i] - i += 1 + support = sorted(set().union(*((abs(x), abs(x) + 1) for x in data.Tietze()))) d = {} for i,s in enumerate(support): d[s] = i+1 @@ -359,7 +355,7 @@ def __init__(self, data): if not support: B = BraidGroup(2) else: - B = BraidGroup(len(support)+1) + B = BraidGroup(len(support)) self._braid = B([d[x] for x in data.Tietze()]) self._oriented_gauss_code = None self._pd_code = None diff --git a/src/sage/libs/flint/flint_ntl_wrap.h b/src/sage/libs/flint/flint_ntl_wrap.h index 058d13b2e92..841d990817d 100644 --- a/src/sage/libs/flint/flint_ntl_wrap.h +++ b/src/sage/libs/flint/flint_ntl_wrap.h @@ -15,7 +15,7 @@ #include /* If flint was already previously included via another header (e.g. - * arb_wrap.h) then it may be neessary to redefine ulong and slong again */ + * arb_wrap.h) then it may be necessary to redefine ulong and slong again */ #ifndef ulong #define ulong mp_limb_t diff --git a/src/sage/libs/flint/flint_wrap.h b/src/sage/libs/flint/flint_wrap.h index 179597d2d56..b68c93ce810 100644 --- a/src/sage/libs/flint/flint_wrap.h +++ b/src/sage/libs/flint/flint_wrap.h @@ -24,7 +24,7 @@ #include /* If flint was already previously included via another header (e.g. - * arb_wrap.h) then it may be neessary to redefine ulong and slong again */ + * arb_wrap.h) then it may be necessary to redefine ulong and slong again */ #ifndef ulong #define ulong mp_limb_t diff --git a/src/sage/manifolds/differentiable/degenerate_submanifold.py b/src/sage/manifolds/differentiable/degenerate_submanifold.py index 43e097f2e3c..2aada97535b 100644 --- a/src/sage/manifolds/differentiable/degenerate_submanifold.py +++ b/src/sage/manifolds/differentiable/degenerate_submanifold.py @@ -425,7 +425,7 @@ def list_of_screens(self): def set_transverse(self, rigging=None, normal=None): r""" - For setting a transversal disttribution of the degenerate submanifold. + For setting a transversal distribution of the degenerate submanifold. according to the type of the submanifold amoung the 4 possible types, one must enter a list of normal transversal vector fields and/or a list of transversal and not normal vector fields spanning a transverse diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py index 942e8d58cd8..68668fb9a46 100644 --- a/src/sage/manifolds/manifold.py +++ b/src/sage/manifolds/manifold.py @@ -324,8 +324,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from __future__ import print_function -from __future__ import absolute_import from sage.categories.fields import Fields from sage.categories.manifolds import Manifolds diff --git a/src/sage/matrix/action.pyx b/src/sage/matrix/action.pyx index 12000c49764..14d2d5cc414 100644 --- a/src/sage/matrix/action.pyx +++ b/src/sage/matrix/action.pyx @@ -50,15 +50,15 @@ AUTHOR: - Robert Bradshaw (2007-09): Initial version. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2007 Robert Bradshaw # # 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. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** import operator @@ -517,9 +517,10 @@ cdef class PolymapMatrixAction(MatrixMulAction): """ return f._polymap_times_matrix_(mat, self._codomain) + cdef class MatrixSchemePointAction(MatrixMulAction): r""" - Action class for left multiplication of schemes points by matricies. + Action class for left multiplication of schemes points by matrices. """ def __init__(self, G, S): """ diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx index 2c22f4cf1ab..707d9cc031d 100644 --- a/src/sage/matrix/matrix2.pyx +++ b/src/sage/matrix/matrix2.pyx @@ -13680,13 +13680,20 @@ cdef class Matrix(Matrix1): [0.750000000000000 0.800000000000000 0.833333333333333] [0.857142857142857 0.875000000000000 0.888888888888889] [0.900000000000000 0.909090909090909 0.916666666666667] + + We check that :trac:`29700` is fixed:: + + sage: M = matrix(3,[1,1,1,1,0,0,0,1,0]) + sage: A,B = M.diagonalization(QQbar) + sage: _ = A.n() + """ if prec is None: prec = digits_to_bits(digits) try: return self.change_ring(sage.rings.real_mpfr.RealField(prec)) - except TypeError: + except (TypeError, ValueError): # try to return a complex result return self.change_ring(sage.rings.complex_field.ComplexField(prec)) diff --git a/src/sage/matrix/matrix_generic_sparse.pyx b/src/sage/matrix/matrix_generic_sparse.pyx index bbf0015ca8a..7618257e13a 100644 --- a/src/sage/matrix/matrix_generic_sparse.pyx +++ b/src/sage/matrix/matrix_generic_sparse.pyx @@ -210,7 +210,8 @@ cdef class Matrix_generic_sparse(matrix_sparse.Matrix_sparse): """ EXAMPLES:: - sage: a = matrix([[1,10],[3,4]],sparse=True); a + sage: R. = ZZ[] + sage: a = matrix(R, [[1,10],[3,4]],sparse=True); a [ 1 10] [ 3 4] sage: loads(dumps(a)) == a @@ -239,7 +240,8 @@ cdef class Matrix_generic_sparse(matrix_sparse.Matrix_sparse): """ EXAMPLES:: - sage: a = matrix([[1,10],[3,4]],sparse=True); a + sage: R. = QQ[] + sage: a = matrix(R, [[1,10],[3,4]],sparse=True); a [ 1 10] [ 3 4] sage: a+a @@ -248,7 +250,7 @@ cdef class Matrix_generic_sparse(matrix_sparse.Matrix_sparse): :: - sage: a = matrix([[1,10,-5/3],[2/8,3,4]],sparse=True); a + sage: a = matrix(R, [[1,10,-5/3],[2/8,3,4]], sparse=True); a [ 1 10 -5/3] [ 1/4 3 4] sage: a+a diff --git a/src/sage/matrix/matrix_integer_sparse.pyx b/src/sage/matrix/matrix_integer_sparse.pyx index c6cb12ad86a..8163172d862 100644 --- a/src/sage/matrix/matrix_integer_sparse.pyx +++ b/src/sage/matrix/matrix_integer_sparse.pyx @@ -219,6 +219,63 @@ cdef class Matrix_integer_sparse(Matrix_sparse): self.cache('dict', d) return d + cdef sage.structure.element.Matrix _matrix_times_matrix_(self, sage.structure.element.Matrix _right): + """ + Return the product of the sparse integer matrices + ``self`` and ``_right``. + + EXAMPLES:: + + sage: a = matrix(ZZ, 2, [1,2,3,4], sparse=True) + sage: b = matrix(ZZ, 2, 3, [1..6], sparse=True) + sage: a * b + [ 9 12 15] + [19 26 33] + """ + cdef Matrix_integer_sparse right, ans + right = _right + + cdef mpz_vector* v + + # Build a table that gives the nonzero positions in each column of right + cdef list nonzero_positions_in_columns = [set() for _ in range(right._ncols)] + cdef Py_ssize_t i, j, k + for i in range(right._nrows): + v = &(right._matrix[i]) + for j in range(v.num_nonzero): + ( nonzero_positions_in_columns[v.positions[j]]).add(i) + # pre-computes the list of nonzero columns of right + cdef list right_indices + right_indices = [j for j in range(right._ncols) + if nonzero_positions_in_columns[j]] + + ans = self.new_matrix(self._nrows, right._ncols) + + # Now do the multiplication, getting each row completely before filling it in. + cdef set c + cdef mpz_t x, y, s + mpz_init(x) + mpz_init(y) + mpz_init(s) + for i in range(self._nrows): + v = &(self._matrix[i]) + if not v.num_nonzero: + continue + for j in right_indices: + mpz_set_si(s, 0) + c = nonzero_positions_in_columns[j] + for k in range(v.num_nonzero): + if v.positions[k] in c: + mpz_vector_get_entry(y, &right._matrix[v.positions[k]], j) + mpz_mul(x, v.entries[k], y) + mpz_add(s, s, x) + mpz_vector_set_entry(&ans._matrix[i], j, s) + + mpz_clear(x) + mpz_clear(y) + mpz_clear(s) + return ans + ######################################################################## # LEVEL 3 functionality (Optional) # * cdef _sub_ diff --git a/src/sage/matrix/matrix_modn_sparse.pyx b/src/sage/matrix/matrix_modn_sparse.pyx index 1d0f8e94c32..335be5fb687 100644 --- a/src/sage/matrix/matrix_modn_sparse.pyx +++ b/src/sage/matrix/matrix_modn_sparse.pyx @@ -271,7 +271,8 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): Even though sparse and dense matrices are represented differently, they still compare as equal if they have the - same entries: + same entries:: + sage: a*b == a._matrix_times_matrix_dense(b) True sage: d = matrix(GF(43), 3, 8, range(24)) @@ -287,7 +288,6 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): [32770 32770 32770] sage: M*M.transpose() # previously returned [32738] [3] - """ cdef Matrix_modn_sparse right, ans right = _right @@ -295,24 +295,29 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): cdef c_vector_modint* v # Build a table that gives the nonzero positions in each column of right - nonzero_positions_in_columns = [set([]) for _ in range(right._ncols)] + cdef list nonzero_positions_in_columns = [set() for _ in range(right._ncols)] cdef Py_ssize_t i, j, k - for i from 0 <= i < right._nrows: + for i in range(right._nrows): v = &(right.rows[i]) - for j from 0 <= j < right.rows[i].num_nonzero: - nonzero_positions_in_columns[v.positions[j]].add(i) + for j in range(v.num_nonzero): + ( nonzero_positions_in_columns[v.positions[j]]).add(i) + # pre-computes the list of nonzero columns of right + cdef list right_indices + right_indices = [j for j in range(right._ncols) + if nonzero_positions_in_columns[j]] ans = self.new_matrix(self._nrows, right._ncols) # Now do the multiplication, getting each row completely before filling it in. cdef int x, y, s + cdef set c - for i from 0 <= i < self._nrows: - v = &self.rows[i] - for j from 0 <= j < right._ncols: + for i in range(self._nrows): + v = &(self.rows[i]) + for j in range(right._ncols): s = 0 - c = nonzero_positions_in_columns[j] - for k from 0 <= k < v.num_nonzero: + c = nonzero_positions_in_columns[j] + for k in range(v.num_nonzero): if v.positions[k] in c: y = get_entry(&right.rows[v.positions[k]], j) x = v.entries[k] * y diff --git a/src/sage/matrix/matrix_rational_sparse.pyx b/src/sage/matrix/matrix_rational_sparse.pyx index 15476b9f48d..aa532514023 100644 --- a/src/sage/matrix/matrix_rational_sparse.pyx +++ b/src/sage/matrix/matrix_rational_sparse.pyx @@ -163,26 +163,33 @@ cdef class Matrix_rational_sparse(Matrix_sparse): cdef mpq_vector* v # Build a table that gives the nonzero positions in each column of right - nonzero_positions_in_columns = [set([]) for _ in range(right._ncols)] + cdef list nonzero_positions_in_columns = [set() for _ in range(right._ncols)] cdef Py_ssize_t i, j, k - for i from 0 <= i < right._nrows: + for i in range(right._nrows): v = &(right._matrix[i]) - for j from 0 <= j < right._matrix[i].num_nonzero: - nonzero_positions_in_columns[v.positions[j]].add(i) + for j in range(v.num_nonzero): + ( nonzero_positions_in_columns[v.positions[j]]).add(i) + # pre-computes the list of nonzero columns of right + cdef list right_indices + right_indices = [j for j in range(right._ncols) + if nonzero_positions_in_columns[j]] ans = self.new_matrix(self._nrows, right._ncols) # Now do the multiplication, getting each row completely before filling it in. + cdef set c cdef mpq_t x, y, s mpq_init(x) mpq_init(y) mpq_init(s) - for i from 0 <= i < self._nrows: - v = &self._matrix[i] - for j from 0 <= j < right._ncols: + for i in range(self._nrows): + v = &(self._matrix[i]) + if not v.num_nonzero: + continue + for j in right_indices: mpq_set_si(s, 0, 1) - c = nonzero_positions_in_columns[j] - for k from 0 <= k < v.num_nonzero: + c = nonzero_positions_in_columns[j] + for k in range(v.num_nonzero): if v.positions[k] in c: mpq_vector_get_entry(y, &right._matrix[v.positions[k]], j) mpq_mul(x, v.entries[k], y) diff --git a/src/sage/matrix/matrix_sparse.pyx b/src/sage/matrix/matrix_sparse.pyx index d5dca213251..80b1d979d74 100644 --- a/src/sage/matrix/matrix_sparse.pyx +++ b/src/sage/matrix/matrix_sparse.pyx @@ -177,17 +177,20 @@ cdef class Matrix_sparse(matrix.Matrix): sage: type(A) sage: B = matrix(QQ['x,y'], 2, [-1,-1,-2,-2], sparse=True) - sage: A*B + sage: A * B [2 2] [2 2] + sage: B * A + [-2 3] + [-4 6] """ cdef Py_ssize_t row, col, row_start, k1, k2, len_left, len_right, a, b - left_nonzero = left.nonzero_positions(copy=False, column_order=False) - right_nonzero = right.nonzero_positions(copy=False, column_order=True) + cdef list left_nonzero = left.nonzero_positions(copy=False, column_order=False) + cdef list right_nonzero = right.nonzero_positions(copy=False, column_order=True) len_left = len(left_nonzero) len_right = len(right_nonzero) - e = {} + cdef dict e = {} k1 = 0 while k1 < len_left: row_start = k1 @@ -196,30 +199,30 @@ cdef class Matrix_sparse(matrix.Matrix): while k2 < len_right: sig_check() col = get_ij(right_nonzero, k2, 1) - sum = None + s = None k1 = row_start - while k1 < len_left and get_ij(left_nonzero,k1,0) == row and \ - k2 < len_right and get_ij(right_nonzero,k2,1) == col: + while (k1 < len_left and get_ij(left_nonzero,k1,0) == row + and k2 < len_right and get_ij(right_nonzero,k2,1) == col): sig_check() - a = get_ij(left_nonzero, k1,1) - b = get_ij(right_nonzero,k2,0) + a = get_ij(left_nonzero, k1, 1) + b = get_ij(right_nonzero, k2, 0) if a == b: - if sum is None: - sum = left.get_unsafe(row,a)*right.get_unsafe(a,col) + if s is None: + s = left.get_unsafe(row,a) * right.get_unsafe(a,col) else: - sum = sum + left.get_unsafe(row,a)*right.get_unsafe(a,col) - k1 = k1 + 1 - k2 = k2 + 1 + s += left.get_unsafe(row,a) * right.get_unsafe(a,col) + k1 += 1 + k2 += 1 elif a < b: - k1 = k1 + 1 + k1 += 1 else: - k2 = k2 + 1 - if sum is not None: - e[row, col] = sum - while k2 < len_right and get_ij(right_nonzero,k2,1) == col: - k2 = k2 + 1 - while k1 < len_left and get_ij(left_nonzero,k1,0) == row: - k1 = k1 + 1 + k2 += 1 + if s is not None: + e[row, col] = s + while k2 < len_right and get_ij(right_nonzero, k2, 1) == col: + k2 += 1 + while k1 < len_left and get_ij(left_nonzero, k1, 0) == row: + k1 += 1 return left.new_matrix(left._nrows, right._ncols, entries=e, coerce=False, copy=False) def _multiply_classical_with_cache(Matrix_sparse left, Matrix_sparse right): diff --git a/src/sage/matroids/extension.pyx b/src/sage/matroids/extension.pyx index c0156678def..cb47076bebb 100644 --- a/src/sage/matroids/extension.pyx +++ b/src/sage/matroids/extension.pyx @@ -18,7 +18,7 @@ AUTHORS: Methods ======= """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2013 Rudi Pendavingh # Copyright (C) 2013 Stefan van Zwam # @@ -26,13 +26,14 @@ Methods # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** include 'sage/data_structures/bitset.pxi' from .basis_matroid cimport BasisMatroid from sage.arith.all import binomial + cdef class CutNode: """ An internal class used for creating linear subclasses of a matroids in a @@ -41,11 +42,11 @@ cdef class CutNode: A linear subclass is a set of hyperplanes `mc` with the property that certain sets of hyperplanes must either be fully contained in `mc` or intersect `mc` in at most 1 element. The way we generate them is by a - depth-first seach. This class represents a node in the search tree. + depth-first search. This class represents a node in the search tree. It contains the set of hyperplanes selected so far, as well as a collection of hyperplanes whose insertion has been explored elsewhere in - the seach tree. + the search tree. The class has methods for selecting a hyperplane to insert, for inserting hyperplanes and closing the set to become a linear subclass again, and for diff --git a/src/sage/matroids/matroid.pyx b/src/sage/matroids/matroid.pyx index 8c9753554aa..d274d9eec53 100644 --- a/src/sage/matroids/matroid.pyx +++ b/src/sage/matroids/matroid.pyx @@ -6623,7 +6623,7 @@ cdef class Matroid(SageObject): sage: M.is_max_weight_independent_generic() False - Here is an example from [GriRei18]_ (Example 7.4.12 in v5):: + Here is an example from [GriRei18]_ (Example 7.4.12 in v6):: sage: A = Matrix(QQ, [[ 1, 1, 0, 0], ....: [-1, 0, 1, 1], @@ -6781,7 +6781,7 @@ cdef class Matroid(SageObject): sage: M.dual().is_max_weight_coindependent_generic(weights=wt) True - Here is an example from [GriRei18]_ (Example 7.4.12 in v5):: + Here is an example from [GriRei18]_ (Example 7.4.12 in v6):: sage: A = Matrix(QQ, [[ 1, 1, 0, 0], ....: [-1, 0, 1, 1], diff --git a/src/sage/misc/remote_file.py b/src/sage/misc/remote_file.py index 5d99a2e8670..297c5376e55 100644 --- a/src/sage/misc/remote_file.py +++ b/src/sage/misc/remote_file.py @@ -3,7 +3,6 @@ from __future__ import absolute_import import os -import sys from urllib.request import Request, urlopen diff --git a/src/sage/misc/sage_timeit.py b/src/sage/misc/sage_timeit.py index 13035cc5134..f82300651dc 100644 --- a/src/sage/misc/sage_timeit.py +++ b/src/sage/misc/sage_timeit.py @@ -201,7 +201,7 @@ def sage_timeit(stmt, globals_dict=None, preparse=None, number=0, repeat=3, prec sage: gc.isenabled() True """ - import time, math + import math import timeit as timeit_ import sage.repl.interpreter as interpreter diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index 6251ec5742c..635415dd5f5 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -118,7 +118,6 @@ def foo(unsigned int x=1, a=')"', b={not (2+1==3):'bar'}, *args, **kwds): return import inspect import functools import os -import sys import tokenize import re EMBEDDED_MODE = False diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py index ab0de0a7b66..d3db30be44b 100644 --- a/src/sage/misc/sphinxify.py +++ b/src/sage/misc/sphinxify.py @@ -107,8 +107,8 @@ def sphinxify(docstring, format='html'): """) staticdir = os.path.join(confdir, 'static') os.makedirs(staticdir) - with open(os.path.join(staticdir, 'empty'), 'w') as filed: pass - + with open(os.path.join(staticdir, 'empty'), 'w') as filed: + pass with open(os.path.join(srcdir, 'docutils.conf'), 'w') as filed: filed.write(r""" [parsers] @@ -158,7 +158,6 @@ def sphinxify(docstring, format='html'): if __name__ == '__main__': - import sys if len(sys.argv) == 2: print(sphinxify(sys.argv[1])) else: diff --git a/src/sage/modular/cusps_nf.py b/src/sage/modular/cusps_nf.py index cad947a62ec..b2a19d94eec 100644 --- a/src/sage/modular/cusps_nf.py +++ b/src/sage/modular/cusps_nf.py @@ -1099,7 +1099,7 @@ def number_of_Gamma0_NFCusps(N): OUTPUT: - ingeter -- the number of orbits of cusps under Gamma0(N)-action. + integer -- the number of orbits of cusps under Gamma0(N)-action. EXAMPLES:: diff --git a/src/sage/modular/modform_hecketriangle/readme.py b/src/sage/modular/modform_hecketriangle/readme.py index cc89da2da80..c5455b39a88 100644 --- a/src/sage/modular/modform_hecketriangle/readme.py +++ b/src/sage/modular/modform_hecketriangle/readme.py @@ -602,7 +602,7 @@ - Specifying the form as a rational function in the basic generators (see below) - For weakly holomorphic modular forms it is possible to exactly determine the form by specifying (sufficiently many) initial coefficients of its Fourier expansion. - - There is even hope (no garantuee) to determine a (exact) form from + - There is even hope (no guarantee) to determine a (exact) form from the initial numerical coefficients (see below). - By specifying the coefficients with respect to a basis of the space (if the corresponding space supports coordinate vectors) diff --git a/src/sage/plot/colors.py b/src/sage/plot/colors.py index b1c9a9c76ae..84da272fbb5 100644 --- a/src/sage/plot/colors.py +++ b/src/sage/plot/colors.py @@ -20,7 +20,7 @@ For a list of color maps in Sage, evaluate:: sage: sorted(colormaps) - [u'Accent', u'Accent_r', u'Blues', u'Blues_r', u'BrBG', u'BrBG_r', ...] + [u'Accent', u'Blues', u'BrBG', ...] These are imported from matplotlib's cm_ module. @@ -1373,7 +1373,7 @@ def get_cmap(cmap): and color names. For a list of map names, evaluate:: sage: sorted(colormaps) - [u'Accent', u'Accent_r', u'Blues', u'Blues_r', ...] + [u'Accent', u'Blues', ...] See :func:`rgbcolor` for valid list/tuple element formats. @@ -1467,7 +1467,7 @@ class Colormaps(collections.MutableMapping): For a list of map names, evaluate:: sage: sorted(colormaps) - [u'Accent', u'Accent_r', u'Blues', u'Blues_r', ...] + [u'Accent', u'Blues', ...] """ def __init__(self): """ @@ -1494,7 +1494,7 @@ def load_maps(self): sage: len(maps.maps) 0 sage: maps.load_maps() - sage: len(maps.maps)>130 + sage: len(maps.maps)>60 True """ global cm @@ -1538,7 +1538,7 @@ def __len__(self): sage: from sage.plot.colors import Colormaps sage: maps = Colormaps() - sage: len(maps)>130 + sage: len(maps)>60 True """ self.load_maps() diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py index a7533fa3d94..12a2b1f6701 100644 --- a/src/sage/plot/contour_plot.py +++ b/src/sage/plot/contour_plot.py @@ -223,7 +223,7 @@ def _render_on_subplot(self, subplot): cb.add_lines(CS) -@suboptions('colorbar', orientation='vertical', format=None, spacing=None) +@suboptions('colorbar', orientation='vertical', format=None, spacing='uniform') @suboptions('label', fontsize=9, colors='blue', inline=None, inline_spacing=3, fmt="%1.2f") @options(plot_points=100, fill=True, contours=None, linewidths=None, diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py index 3135cebe2dd..184a97cfd36 100644 --- a/src/sage/plot/multigraphics.py +++ b/src/sage/plot/multigraphics.py @@ -1295,15 +1295,15 @@ def position(self, index): sage: g2 = circle((0,1), 1.) sage: G = graphics_array([g1, g2]) sage: G.position(0) # tol 1.0e-13 - (0.028906249999999998, - 0.038541666666666696, - 0.45390624999999996, - 0.9229166666666667) + (0.023437500000000003, + 0.03415488992713045, + 0.4627803348994754, + 0.9345951100728696) sage: G.position(1) # tol 1.0e-13 - (0.5171874999999999, - 0.038541666666666696, - 0.45390624999999996, - 0.9229166666666667) + (0.5136230468749999, + 0.19293222169724827, + 0.46278033489947534, + 0.617040446532634) """ if not self._positions: diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index 9b16c34c8f7..43d7a17cec1 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -587,7 +587,7 @@ def f(x): return (x-3)*(x-5)*(x-7)+40 from sage.arith.srange import srange from sage.misc.randstate import current_randstate #for plot adaptive refinement -from math import sin, cos, pi #for polar_plot +from math import sin, cos, pi, log, exp #for polar_plot and log scaling from sage.ext.fast_eval import fast_float, is_fast_float @@ -1945,6 +1945,8 @@ def f(x): return (floor(x)+0.5) / (1-(x-0.5)**2) elif 'color' in kwds: kwds['rgbcolor'] = kwds.pop('color', (0,0,1)) # take blue as default ``rgbcolor`` G_kwds = Graphics._extract_kwds_for_show(kwds, ignore=['xmin', 'xmax']) + if 'scale' in G_kwds: + kwds['scale'] = G_kwds['scale'] # pass scaling information to _plot too original_opts = kwds.pop('__original_opts', {}) do_show = kwds.pop('show',False) @@ -2273,21 +2275,44 @@ def golden_rainbow(i,lightness=0.4): initial_points = reduce(lambda a,b: a+b, [[x - epsilon, x + epsilon] for x in excluded_points], []) - data = generate_plot_points(f, xrange, plot_points, + else: + initial_points = None + + # If we are a log scale plot on the x axis, do a change of variables + # so we sample the range in log scale + is_log_scale = ('scale' in options.keys() and + not parametric and + options['scale'] in ['loglog', 'semilogx']) + if is_log_scale: + f_exp = lambda x: f(exp(x)) + log_xrange = (log(xrange[0]), log(xrange[1])) + if initial_points is None: + log_initial_points = None + else: + log_initial_points = [log(x) for x in initial_points] + data = generate_plot_points(f_exp, log_xrange, plot_points, adaptive_tolerance, adaptive_recursion, - randomize, initial_points) + randomize, log_initial_points) + average_distance_between_points = abs(log_xrange[1] - log_xrange[0])/plot_points else: data = generate_plot_points(f, xrange, plot_points, adaptive_tolerance, adaptive_recursion, - randomize) - + randomize, initial_points) + average_distance_between_points = abs(xrange[1] - xrange[0])/plot_points for i in range(len(data)-1): # If the difference between consecutive x-values is more than - # 2 times the difference between two consecutive plot points, then + # 2 times the average difference between two consecutive plot points, then # add an exclusion point. - if abs(data[i+1][0] - data[i][0]) > 2*abs(xmax - xmin)/plot_points: + if abs(data[i+1][0] - data[i][0]) > 2*average_distance_between_points: excluded_points.append((data[i][0] + data[i+1][0])/2) + + # If we did a change in variables, undo it now + if is_log_scale: + for i,(a,fa) in enumerate(data): + data[i] = (exp(a), fa) + for i,p in enumerate(excluded_points): + excluded_points[i] = exp(p) if parametric: # We need the original x-values to be able to exclude points in parametric plots @@ -3122,6 +3147,20 @@ def plot_semilogx(funcs, *args, **kwds): g = plot_semilogx(exp, (1,10), base=2) # with base 2 sphinx_plot(g) + :: + + sage: s = var('s') # Samples points logarithmically so graph is smooth + sage: f = 4000000/(4000000 + 4000*s*i - s*s) + sage: plot_semilogx(20*log(abs(f), 10), (s, 1, 1e6)) + Graphics object consisting of 1 graphics primitive + + .. PLOT:: + + s = var('s') # Samples points logarithmically so graph is smooth + f = 4000000/(4000000 + 4000*s*i - s*s) + g = plot_semilogx(20*log(abs(f), 10), (s, 1, 1e6)) + sphinx_plot(g) + """ return plot(funcs, *args, scale='semilogx', **kwds) diff --git a/src/sage/plot/plot3d/shapes2.py b/src/sage/plot/plot3d/shapes2.py index 7a8c4cebd79..07e00c048da 100644 --- a/src/sage/plot/plot3d/shapes2.py +++ b/src/sage/plot/plot3d/shapes2.py @@ -848,6 +848,18 @@ def threejs_repr(self, render_params): point = dict(point=center, size=size, color=color, opacity=opacity) return [('point', point)] + def stl_binary_repr(self, render_params): + """ + Return an empty list, as this is not useful for STL export. + + EXAMPLES:: + + sage: P = point3d((1,2,3)).translate(-1, -2, -3) + sage: P.stl_binary_repr(P.default_render_params()) + [] + """ + return [] + class Line(PrimitiveObject): r""" @@ -1215,6 +1227,18 @@ def threejs_repr(self, render_params): reprs.append(('line', line)) return reprs + def stl_binary_repr(self, render_params): + """ + Return an empty list, as this is not useful for STL export. + + EXAMPLES:: + + sage: L = line3d([(1,2,3), (4,5,6)]).translate(-1, -2, -3) + sage: L.stl_binary_repr(L.default_render_params()) + [] + """ + return [] + @rename_keyword(alpha='opacity') def point3d(v, size=5, **kwds): diff --git a/src/sage/rings/fraction_field.py b/src/sage/rings/fraction_field.py index 9dfa3ebcaee..f683fbfbed6 100644 --- a/src/sage/rings/fraction_field.py +++ b/src/sage/rings/fraction_field.py @@ -79,6 +79,7 @@ from sage.rings.integer_ring import ZZ from sage.structure.richcmp import richcmp from sage.structure.parent import Parent +from sage.structure.element import parent from sage.structure.coerce import py_scalar_to_element from sage.structure.coerce_maps import CallableConvertMap, DefaultConvertMap_unique from sage.categories.basic import QuotientFields, Rings @@ -606,8 +607,21 @@ def _element_constructor_(self, x, y=None, coerce=True): sage: S. = ZZ[] sage: S.fraction_field()(s/(s+1), (t-1)/(t+2)) (s^2 + 2*s)/(s^2 - 1) + + Check that :trac:`29713` is fixed:: + + sage: F = FractionField(QQ['a']) + sage: a = F.gen() + sage: R = PolynomialRing(F, 'x') + sage: FF = FractionField(R) + sage: elt = F(-1/2/(a^2+a)) + sage: x = FF(elt) + sage: F(x) + -1/2/(a^2 + a) """ if y is None: + if parent(x) is self: + return x ring_one = self.ring().one() try: return self._element_class(self, x, ring_one, coerce=coerce) @@ -616,6 +630,9 @@ def _element_constructor_(self, x, y=None, coerce=True): y = self._element_class(self, ring_one, ring_one, coerce=False, reduce=False) else: + if parent(x) is self: + y = self(y) + x, y = x.numerator() * y.denominator(), y.numerator() * x.denominator() try: return self._element_class(self, x, y, coerce=coerce) except (TypeError, ValueError): @@ -658,12 +675,12 @@ def resolve_fractions(x, y): except (AttributeError, TypeError, ValueError): pass try: - P = yd.parent() + P = parent(yd) return (P(xn) * yd, yn * P(xd)) except (AttributeError, TypeError, ValueError): pass try: - P = xd.parent() + P = parent(xd) return (xn * P(yd), P(yn) * xd) except (AttributeError, TypeError, ValueError): pass @@ -679,7 +696,7 @@ def resolve_fractions(x, y): try: return self._element_class(self, x, y, coerce=coerce) except TypeError: - if not x != x0: + if parent(x) is parent(x0): raise def construction(self): diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx index 1879407eb16..44936e6a6a4 100644 --- a/src/sage/rings/integer.pyx +++ b/src/sage/rings/integer.pyx @@ -7254,7 +7254,7 @@ cdef class int_to_Z(Morphism): sage: type(1 + 2r) - This is intented for internal use by the coercion system, + This is intended for internal use by the coercion system, to facilitate fast expressions mixing ints and more complex Python types. Note that (as with all morphisms) the input is forcably coerced to the domain ``int`` if it is not diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index 6c3d573044a..d5715fbc735 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -238,8 +238,6 @@ def normalize_additional_units(base_ring, add_units, warning=True): return sorted(set(add_units_result)) - - class LocalizationElement(IntegralDomainElement): """ Element class for localizations of integral domains @@ -536,13 +534,12 @@ class Localization(IntegralDomain, UniqueRepresentation): the exact division operator `//` (:meth:`sage.structure.element.Element.__floordiv__`) in order to guarantee an successful application. - INPUT: - ``base_ring`` -- an instance of :class:`Ring` allowing the construction of :meth:`fraction_field` (that is an integral domain) - ``additional_units`` -- tuple of elements of ``base_ring`` which should be turned into units - ``names`` -- passed to :class:`IntegralDomain` - - ``normalize`` -- (optinal, default: True) passed to :class:`IntegralDomain` + - ``normalize`` -- (optional, default: True) passed to :class:`IntegralDomain` - ``category`` -- (optional, default: None) passed to :class:`IntegralDomain` - ``warning`` -- (optional, default: True) to supress a warning which is thrown if self cannot be represented uniquely diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py index 16593f89eeb..994a826734d 100644 --- a/src/sage/rings/number_field/S_unit_solver.py +++ b/src/sage/rings/number_field/S_unit_solver.py @@ -1921,7 +1921,7 @@ def construct_complement_dictionaries(split_primes_list, SUK, verbose=False): rfv_to_ev = {} - # We build a second dictionary of dictiories. + # We build a second dictionary of dictionaries. # comp_exp_vec[q] is the dictionary mod q which assigns to each exponent vector # a list of 'complementary' exponent vectors. diff --git a/src/sage/rings/polynomial/laurent_polynomial.pyx b/src/sage/rings/polynomial/laurent_polynomial.pyx index 17904ad8b17..c9af44acde8 100644 --- a/src/sage/rings/polynomial/laurent_polynomial.pyx +++ b/src/sage/rings/polynomial/laurent_polynomial.pyx @@ -2045,7 +2045,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cdef int p cdef int n = len(var_name_hash) cdef long c_hash - for m,c in self._poly.dict().iteritems(): + for m, c in self._poly.iterator_exp_coeff(): c_hash = hash(c) if c_hash != 0: for p in range(n): @@ -2117,10 +2117,12 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): self._mon = ETuple({}, int(self._parent.ngens())) return - cdef dict D = self._poly._mpoly_dict_recursive( - self._parent.variable_names(), - self._parent.base_ring() - ) + #cdef dict D = self._poly._mpoly_dict_recursive( + # self._parent.variable_names(), + # self._parent.base_ring() + # ) + cdef dict D = self._poly.dict() + cdef ETuple e if i is None: e = None @@ -2150,8 +2152,9 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: a.dict() # indirect doctest {(0, 0): 3, (2, -1): 1} """ - cdef dict D = self._poly._mpoly_dict_recursive(self._parent.variable_names(), - self._parent.base_ring()) + #cdef dict D = self._poly._mpoly_dict_recursive(self._parent.variable_names(), + # self._parent.base_ring()) + cdef dict D = self._poly.dict() cdef dict DD if self._mon.is_constant(): self._prod = PolyDict(D, force_etuples=False) @@ -2283,12 +2286,11 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: parent(g.coefficients()[0]) is parent(g).base_ring() True """ - cdef dict d = self.dict() cdef ETuple e - if len(d) == 1: - (e, c), = d.items() + if self._poly.is_term(): + (e, c), = self.dict().items() e = e.emul(-1) - P = self.parent() + P = self._parent try: c = c.inverse_of_unit() except (AttributeError, ZeroDivisionError, ArithmeticError): @@ -2369,9 +2371,10 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cdef ETuple t = ETuple(n) if self._prod is None: self._compute_polydict() - if t not in self._prod.exponents(): + try: + return self._prod[t] + except KeyError: return self._parent.base_ring().zero() - return self._prod[t] def __iter__(self): """ @@ -2385,17 +2388,28 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: sorted(f) # indirect doctest [(-7, x^-2*y^3), (-1, x^6), (1, x^-3*y^2), (5, x^-2*y)] """ - if self._prod is None: - self._compute_polydict() - cdef tuple G = self._parent.gens() - cdef Py_ssize_t i - cdef list exps - for c, e in self._prod.list(): - exps = e - prod = self._parent.one() - for i in range(len(exps)): - prod *= G[i]**exps[i] - yield (c, prod) + P = self._parent + one = P._R.one() + if self._mon.is_constant(): + for exp, coeff in self._poly.iterator_exp_coeff(): + yield (coeff, P.element_class(P, one, exp)) + else: + for exp, coeff in self._poly.iterator_exp_coeff(): + yield (coeff, P.element_class(P, one, exp.eadd(self._mon))) + + def iterator_exp_coeff(self): + """ + Iterate over ``self`` as pairs of (ETuple, coefficient). + + EXAMPLES:: + + sage: P. = LaurentPolynomialRing(QQ) + sage: f = (y^2 - x^9 - 7*x*y^3 + 5*x*y)*x^-3 + sage: list(f.iterator_exp_coeff()) + [((6, 0), -1), ((-2, 3), -7), ((-2, 1), 5), ((-3, 2), 1)] + """ + for exp, coeff in self._poly.iterator_exp_coeff(): + yield (exp.eadd(self._mon), coeff) def monomials(self): """ @@ -2408,18 +2422,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: sorted(f.monomials()) [x^-3*y^2, x^-2*y, x^-2*y^3, x^6] """ - cdef list L = [] - if self._prod is None: - self._compute_polydict() - cdef tuple gens = self._parent.gens() - cdef list exps - for c, e in self._prod.list(): - exps = e - prod = self._parent.one() - for i in range(len(exps)): - prod *= gens[i]**exps[i] - L.append(prod) - return L + return [mon for coeff, mon in self] def monomial_coefficient(self, mon): """ @@ -2448,14 +2451,25 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): -7 sage: f.monomial_coefficient(x^2) 0 + + TESTS:: + + sage: P. = LaurentPolynomialRing(QQ) + sage: f = y^2 * x^-2 + sage: f.monomial_coefficient(x + y) + Traceback (most recent call last): + ... + ValueError: input must be a monomial """ if mon.parent() != self._parent: raise TypeError("input must have the same parent") cdef LaurentPolynomial_mpair m = mon - if self._prod is None: - self._compute_polydict() if m._prod is None: m._compute_polydict() + if len(m._prod) != 1: + raise ValueError("input must be a monomial") + if self._prod is None: + self._compute_polydict() c = self._prod.monomial_coefficient(m._prod.dict()) return self._parent.base_ring()(c) @@ -2598,6 +2612,8 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cpdef dict dict(self): """ + Return ``self`` represented as a ``dict``. + EXAMPLES:: sage: L. = LaurentPolynomialRing(QQ) @@ -2713,8 +2729,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cdef LaurentPolynomial_mpair right = rhs if right.is_zero(): raise ZeroDivisionError - cdef dict d = right.dict() - if len(d) == 1: + if right._poly.is_term(): return self * ~right else: return RingElement._div_(self, rhs) @@ -2737,9 +2752,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: (38*z^-2909).is_monomial() False """ - - d = self._poly.dict() - return len(d) == 1 and 1 in d.values() + return self._poly.is_monomial() cpdef _neg_(self): """ @@ -2905,7 +2918,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): ( right)._compute_polydict() try: - sortkey = self.parent().term_order().sortkey + sortkey = self._parent.term_order().sortkey except AttributeError: sortkey = None @@ -3418,3 +3431,4 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): ans._mon = mon ans._poly = root return (True, ans) + diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 51ada7c9699..1937ead811d 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -357,7 +357,7 @@ cdef class MPolynomial(CommutativeRingElement): x = [etb.var(v) for v in my_vars] n = len(x) - expr = etb.constant(self.base_ring()(0)) + expr = etb.constant(self.base_ring().zero()) for (m, c) in self.dict().iteritems(): monom = prod([ x[i]**m[i] for i in range(n) if m[i] != 0], etb.constant(c)) @@ -1155,11 +1155,6 @@ cdef class MPolynomial(CommutativeRingElement): returning tuples of the form ``(coeff, mon)`` for each non-zero monomial. - .. NOTE:: - - This function creates the entire list upfront because Cython - doesn't (yet) support iterators. - EXAMPLES:: sage: P. = PolynomialRing(QQ,3) @@ -1170,8 +1165,34 @@ cdef class MPolynomial(CommutativeRingElement): sage: sum(c*m for c,m in f) == f True """ - L = zip(self.coefficients(), self.monomials()) - return iter(L) + for exp, coeff in self.iterator_exp_coeff(): + yield (coeff, self.monomial(exp)) + + def iterator_exp_coeff(self, as_ETuples=True): + """ + Iterate over ``self`` as pairs of ((E)Tuple, coefficient). + + INPUT: + + - ``as_ETuples`` -- (default: ``True``) if ``True`` iterate over + pairs whose first element is an ETuple, otherwise as a tuples + + EXAMPLES:: + + sage: R. = QQ[] + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + sage: list(f.iterator_exp_coeff(as_ETuples=False)) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + + sage: R. = PolynomialRing(QQ, 3, order='lex') + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((2, 1, 0), 1), ((1, 0, 3), 1), ((0, 4, 0), 2)] + """ + for exp in self.exponents(): + yield (exp, self.monomial_coefficient(exp)) def content(self): """ diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index a733b29763d..45a043990ab 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -64,6 +64,7 @@ from sage.structure.sequence import Sequence from .multi_polynomial import MPolynomial from sage.categories.morphism import Morphism +from sage.misc.lazy_attribute import lazy_attribute def is_MPolynomial(x): @@ -391,7 +392,7 @@ def __init__(self, parent, x): True """ if not isinstance(x, polydict.PolyDict): - x = polydict.PolyDict(x, parent.base_ring()(0), remove_zero=True) + x = polydict.PolyDict(x, parent.base_ring().zero(), remove_zero=True) MPolynomial_element.__init__(self, parent, x) def _new_constant_poly(self, x, P): @@ -758,36 +759,60 @@ def dict(self): """ return self.element().dict() - #def __iter__(self): - # """ - # Facilitates iterating over the monomials of self, - # returning tuples of the form (coeff, mon) for each - # non-zero monomial. - # - # EXAMPLES:: - - # sage: R = ZZ['t'] - # sage: P. = PolynomialRing(R,3) - # sage: f = 3*x^3*y + 16*x + 7 - # sage: [(c,m) for c,m in f] - # [(3, x^3*y), (16, x), (7, 1)] - # sage: f = P.random_element(10,10) - # sage: sum(c*m for c,m in f) == f - # True - # """ - # exps = self.exponents() - # parent = self.parent() - # for exp in exps: - # yield self.element()[exp], MPolynomial_polydict(parent, {exp: 1}) + def __iter__(self): + """ + Iterate over ``self`` respecting the term order. - def __getitem__(self, x): + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, order='lex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x^4*y*z^3), (1, x^2*z), (1, x*y^5*z^2)] + + :: + + sage: R. = PolynomialRing(QQbar, order='deglex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x^4*y*z^3), (1, x*y^5*z^2), (1, x^2*z)] + + :: + + sage: R. = PolynomialRing(QQbar, order='degrevlex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x*y^5*z^2), (1, x^4*y*z^3), (1, x^2*z)] + + :: + + sage: R = ZZ['t'] + sage: P. = PolynomialRing(R,3) + sage: f = 3*x^3*y + 16*x + 7 + sage: [(c,m) for c,m in f] + [(3, x^3*y), (16, x), (7, 1)] + sage: f = P.random_element(10,10) + sage: sum(c*m for c,m in f) == f + True """ - INPUT: + elt = self.element() + ring = self.parent() + one = ring.base_ring().one() + for exp in self._exponents: + yield (elt[exp], + MPolynomial_polydict(ring, polydict.PolyDict({exp:one}, + force_int_exponents=False, + force_etuples=False)) + ) + def __getitem__(self, x): + """ + Return the coefficient corresponding to ``x``. - - ``x`` - a tuple or, in case of a single-variable - MPolynomial ring x can also be an integer. + INPUT: + - ``x`` -- a tuple or, in case of a single-variable + MPolynomial ring x can also be an integer EXAMPLES:: @@ -819,7 +844,36 @@ def __getitem__(self, x): try: return self.element()[x] except KeyError: - return self.parent().base_ring()(0) + return self.parent().base_ring().zero() + + def iterator_exp_coeff(self, as_ETuples=True): + """ + Iterate over ``self`` as pairs of ((E)Tuple, coefficient). + + INPUT: + + - ``as_ETuples`` -- (default: ``True``) if ``True`` iterate over + pairs whose first element is an ETuple, otherwise as a tuples + + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, order='lex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f.iterator_exp_coeff()) + [((4, 1, 3), 1), ((2, 0, 1), 1), ((1, 5, 2), 1)] + + sage: R. = PolynomialRing(QQbar, order='deglex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f.iterator_exp_coeff(as_ETuples=False)) + [((4, 1, 3), 1), ((1, 5, 2), 1), ((2, 0, 1), 1)] + """ + elt = self.element() + if as_ETuples: + for exp in self._exponents: + yield (exp, elt[exp]) + else: + for exp in self._exponents: + yield (tuple(exp), elt[exp]) def coefficient(self, degrees): """ @@ -897,7 +951,7 @@ def coefficient(self, degrees): """ looking_for = None if isinstance(degrees, MPolynomial) and degrees.parent() == self.parent() and degrees.is_monomial(): - looking_for = [e if e > 0 else None for e in degrees.exponents()[0]] + looking_for = [e if e > 0 else None for e in degrees._exponents[0]] elif isinstance(degrees, list): looking_for = degrees elif isinstance(degrees, dict): @@ -911,18 +965,33 @@ def coefficient(self, degrees): raise ValueError("You must pass a dictionary list or monomial.") return self.parent()(self.element().polynomial_coefficient(looking_for)) - def exponents(self, as_ETuples=True): + @lazy_attribute + def _exponents(self): + """ + Return the exponents of the monomials appearing in ``self`` for + internal use only. + + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, 3) + sage: f = a^3 + b + 2*b^2 + sage: f._exponents + [(3, 0, 0), (0, 2, 0), (0, 1, 0)] """ - Return the exponents of the monomials appearing in self. + return sorted(self.element().dict(), key=self.parent().term_order().sortkey, reverse=True) + + def exponents(self, as_ETuples=True): + r""" + Return the exponents of the monomials appearing in ``self``. INPUT: - - as_ETuples (default: ``True``): return the list of exponents as a list - of ETuples. + - ``as_ETuples`` -- (default: ``True``): return the list of + exponents as a list of ETuples OUTPUT: - Return the list of exponents as a list of ETuples or tuples. + The list of exponents as a list of ETuples or tuples. EXAMPLES:: @@ -937,24 +1006,24 @@ def exponents(self, as_ETuples=True): sage: type(f.exponents(as_ETuples=False)[0]) <... 'tuple'> + + TESTS: + + Check that we can mutate the list and not change the result:: + + sage: R. = PolynomialRing(QQbar, 3) + sage: f = a^3 + b + 2*b^2 + sage: E = f.exponents(); E + [(3, 0, 0), (0, 2, 0), (0, 1, 0)] + sage: E.pop() + (0, 1, 0) + sage: E != f.exponents() + True """ - try: - exp = self.__exponents - if as_ETuples: - return exp - else: - return [tuple(e) for e in exp] - except AttributeError: - self.__exponents = list(self.element().dict()) - try: - self.__exponents.sort(key=self.parent().term_order().sortkey, - reverse=True) - except AttributeError: - pass - if as_ETuples: - return self.__exponents - else: - return [tuple(e) for e in self.__exponents] + if as_ETuples: + return list(self._exponents) # Make a shallow copy + else: + return [tuple(e) for e in self._exponents] def inverse_of_unit(self): """ @@ -967,12 +1036,11 @@ def inverse_of_unit(self): sage: l.inverse_of_unit().parent() Univariate Polynomial Ring in c over Rational Field """ - d = self.element().dict() - k = list(d) if self.is_unit(): - if len(k) != 1: + d = self.element().dict() + if len(d) != 1: raise NotImplementedError - return d[k[0]].inverse_of_unit() + return list(d.values())[0].inverse_of_unit() raise ArithmeticError("is not a unit") def is_homogeneous(self): @@ -1031,7 +1099,7 @@ def _homogenize(self, var): def is_generator(self): """ - Returns True if self is a generator of it's parent. + Return ``True`` if ``self`` is a generator of its parent. EXAMPLES:: @@ -1043,19 +1111,18 @@ def is_generator(self): sage: (x*y).is_generator() False """ - d = self.element().dict() - if len(d) == 1: - (e, c), = d.items() - if c.is_one() and len(e.nonzero_positions()) == 1 and e.nonzero_values()[0] == 1: - return True + elt = self.element() + if len(elt) == 1: + (e, c), = elt.dict().items() + return e.nonzero_values() == [1] and c.is_one() return False def is_monomial(self): """ - Returns True if self is a monomial, which we define to be a + Return ``True`` if ``self`` is a monomial, which we define to be a product of generators with coefficient 1. - Use is_term to allow the coefficient to not be 1. + Use :meth:`is_term` to allow the coefficient to not be 1. EXAMPLES:: @@ -1076,18 +1143,11 @@ def is_monomial(self): sage: (2*x*y).is_monomial() False """ - term = (len(self.element().dict().keys()) == 1) - if term: - if self.coefficients()[0] == 1: - return True - else: - return False - else: - return False + return len(self.element()) == 1 and self.element().coefficients()[0] == 1 def is_term(self): """ - Returns True if self is a term, which we define to be a + Return ``True`` if ``self`` is a term, which we define to be a product of generators times some coefficient, which need not be 1. @@ -1112,7 +1172,7 @@ def is_term(self): sage: (2*x*y).is_term() True """ - return len(self.element().dict().keys()) == 1 + return len(self.element()) == 1 def subs(self, fixed=None, **kw): """ @@ -1179,16 +1239,9 @@ def monomials(self): True """ ring = self.parent() - one = ring.base_ring()(1) - return [MPolynomial_polydict(ring, polydict.PolyDict({m:one}, force_int_exponents=False, force_etuples=False)) for m in self.exponents()] - try: - return self.__monomials - except AttributeError: - ring = self.parent() - one = self.parent().base_ring()(1) - self.__monomials = sorted([ MPolynomial_polydict(ring, polydict.PolyDict( {m:one}, force_int_exponents=False, force_etuples=False ) ) \ - for m in self._MPolynomial_element__element.dict().keys() ], reverse=True) - return self.__monomials + one = ring.base_ring().one() + return [MPolynomial_polydict(ring, polydict.PolyDict({m:one}, force_int_exponents=False, force_etuples=False)) + for m in self._exponents] def constant_coefficient(self): """ @@ -1209,7 +1262,7 @@ def constant_coefficient(self): try: return d[polydict.ETuple({},self.parent().ngens())] except KeyError: - return self.parent().base_ring()(0) + return self.parent().base_ring().zero() def is_univariate(self): """ @@ -1230,7 +1283,7 @@ def is_univariate(self): sage: f.is_univariate() True """ - mons = self.element().dict().keys() + mons = self.element().dict() found = -1 for mon in mons: @@ -1378,7 +1431,7 @@ def nvariables(self): def is_constant(self): """ - True if polynomial is constant, and False otherwise. + Return ``True`` if ``self`` is a constant and ``False`` otherwise. EXAMPLES:: @@ -1390,10 +1443,7 @@ def is_constant(self): sage: g.is_constant() True """ - if len(self.dict()) <= 1 and self.degrees().is_constant(): - return True - else: - return False + return self.element().is_constant() def lm(self): """ @@ -1440,7 +1490,7 @@ def lm(self): return self R = self.parent() f = self._MPolynomial_element__element.lcmt( R.term_order().greater_tuple ) - one = R.base_ring()(1) + one = R.base_ring().one() self.__lm = MPolynomial_polydict(R,polydict.PolyDict({f:one},zero=R.base_ring().zero(),force_int_exponents=False, force_etuples=False)) return self.__lm @@ -1606,7 +1656,8 @@ def _derivative(self, var=None): if var is None: raise ValueError("must specify which variable to differentiate with respect to") - gens = list(self.parent().gens()) + P = self.parent() + gens = list(P.gens()) # check if var is one of the generators try: @@ -1615,8 +1666,8 @@ def _derivative(self, var=None): # var is not a generator; do term-by-term differentiation recursively # var may be, for example, a generator of the base ring d = dict([(e, x._derivative(var)) for (e, x) in self.dict().items()]) - d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) + return MPolynomial_polydict(P, d) # differentiate w.r.t. indicated variable d = {} @@ -1624,8 +1675,8 @@ def _derivative(self, var=None): for (exp, coeff) in self.dict().items(): if exp[index] > 0: d[exp.esub(v)] = coeff * exp[index] - d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) + return MPolynomial_polydict(P, d) def integral(self, var=None): r""" @@ -1677,7 +1728,8 @@ def integral(self, var=None): raise ValueError("must specify which variable to integrate " "with respect to") - gens = list(self.parent().gens()) + P = self.parent() + gens = list(P.gens()) # check if var is one of the generators try: @@ -1687,17 +1739,17 @@ def integral(self, var=None): # var may be, for example, a generator of the base ring d = dict([(e, x.integral(var)) for (e, x) in self.dict().items()]) - d = polydict.PolyDict(d, self.parent().base_ring()(0), + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + return MPolynomial_polydict(P, d) # integrate w.r.t. indicated variable d = {} v = polydict.ETuple({index:1}, len(gens)) for (exp, coeff) in self.dict().items(): d[exp.eadd(v)] = coeff / (1+exp[index]) - d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) + return MPolynomial_polydict(P, d) def factor(self, proof=None): r""" diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index ab1879650e4..2fcfe6d5bb9 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -2121,7 +2121,7 @@ cdef class MPolynomial_libsingular(MPolynomial): coerced_x = [parent.coerce(e) for e in x] except TypeError: # give up, evaluate functional - y = parent.base_ring()(0) + y = parent.base_ring().zero() for (m,c) in self.dict().iteritems(): y += c*mul([ x[i]**m[i] for i in m.nonzero_positions()]) return y @@ -2165,10 +2165,9 @@ cdef class MPolynomial_libsingular(MPolynomial): """ return self._hash_c() - cpdef int _cmp_(left, right) except -2: + cpdef _richcmp_(left, right, int op): """ - Compare left and right and return -1, 0, and 1 for <,==, and > - respectively. + Compare left and right. EXAMPLES:: @@ -2218,11 +2217,11 @@ cdef class MPolynomial_libsingular(MPolynomial): True """ if left is right: - return 0 + return rich_to_bool(op, 0) cdef poly *p = (left)._poly cdef poly *q = (right)._poly cdef ring *r = (left)._parent_ring - return singular_polynomial_cmp(p, q, r) + return rich_to_bool(op, singular_polynomial_cmp(p, q, r)) cpdef _add_(left, right): """ @@ -2989,12 +2988,12 @@ cdef class MPolynomial_libsingular(MPolynomial): if r!=currRing: rChangeCurrRing(r) base = self._parent._base p = self._poly - pd = dict() + cdef dict d, pd = dict() while p: d = dict() for v from 1 <= v <= r.N: n = p_GetExp(p,v,r) - if n!=0: + if n != 0: d[v-1] = n pd[ETuple(d,r.N)] = si2sa(p_GetCoeff(p, r), r, base) @@ -3002,6 +3001,51 @@ cdef class MPolynomial_libsingular(MPolynomial): p = pNext(p) return pd + def iterator_exp_coeff(self, as_ETuples=True): + """ + Iterate over ``self`` as pairs of ((E)Tuple, coefficient). + + INPUT: + + - ``as_ETuples`` -- (default: ``True``) if ``True`` iterate over + pairs whose first element is an ETuple, otherwise as a tuples + + EXAMPLES:: + + sage: R. = QQ[] + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + sage: list(f.iterator_exp_coeff(as_ETuples=False)) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + + sage: R. = PolynomialRing(QQ, 3, order='lex') + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((2, 1, 0), 1), ((1, 0, 3), 1), ((0, 4, 0), 2)] + """ + cdef poly *p + cdef ring *r = self._parent_ring + cdef int n + cdef int v + if r!=currRing: rChangeCurrRing(r) + base = self._parent._base + p = self._poly + cdef dict d + while p: + d = dict() + for v from 1 <= v <= r.N: + n = p_GetExp(p,v,r) + if n != 0: + d[v-1] = n + + exp = ETuple(d,r.N) + if as_ETuples: + yield (exp, si2sa(p_GetCoeff(p, r), r, base)) + else: + yield (tuple(exp), si2sa(p_GetCoeff(p, r), r, base)) + p = pNext(p) + cpdef long number_of_terms(self): """ Return the number of non-zero coefficients of this polynomial. @@ -3126,6 +3170,41 @@ cdef class MPolynomial_libsingular(MPolynomial): p_Delete(&m,r) return self._parent._base._zero_element + def __iter__(self): + """ + Facilitates iterating over the monomials of self, + returning tuples of the form ``(coeff, mon)`` for each + non-zero monomial. + + EXAMPLES:: + + sage: R. = PolynomialRing(QQ, order='degrevlex') + sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z + sage: list(f) + [(23, x^6*y^7), (6, x^7*z), (1, x^3*y)] + sage: list(R.zero()) + [] + + sage: R. = PolynomialRing(QQ, order='lex') + sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z + sage: list(f) + [(6, x^7*z), (23, x^6*y^7), (1, x^3*y)] + """ + cdef MPolynomialRing_libsingular parent = self._parent + cdef ring *_ring = parent._ring + if _ring != currRing: rChangeCurrRing(_ring) + base = parent._base + cdef poly *t, *p = p_Copy(self._poly, _ring) + + while p: + t = pNext(p) + p.next = NULL + coeff = si2sa(p_GetCoeff(p, _ring), _ring, base) + p_SetCoeff(p, n_Init(1,_ring), _ring) + p_Setm(p, _ring) + yield (coeff, new_MP(parent, p)) + p = t + def exponents(self, as_ETuples=True): """ Return the exponents of the monomials appearing in this @@ -3133,9 +3212,8 @@ cdef class MPolynomial_libsingular(MPolynomial): INPUT: - - ``as_ETuples`` - (default: ``True``) if true returns the result as an list of ETuples - otherwise returns a list of tuples - + - ``as_ETuples`` -- (default: ``True``) if ``True`` returns the + result as an list of ETuples, otherwise returns a list of tuples EXAMPLES:: @@ -3153,16 +3231,18 @@ cdef class MPolynomial_libsingular(MPolynomial): pl = list() ml = list(xrange(r.N)) - while p: - for v from 1 <= v <= r.N: - ml[v-1] = p_GetExp(p,v,r) - - if as_ETuples: + if as_ETuples: + while p: + for v from 1 <= v <= r.N: + ml[v-1] = p_GetExp(p,v,r) pl.append(ETuple(ml)) - else: + p = pNext(p) + else: + while p: + for v from 1 <= v <= r.N: + ml[v-1] = p_GetExp(p,v,r) pl.append(tuple(ml)) - - p = pNext(p) + p = pNext(p) return pl def inverse_of_unit(self): @@ -3272,6 +3352,10 @@ cdef class MPolynomial_libsingular(MPolynomial): True sage: (x*y + x).is_monomial() False + sage: P(2).is_monomial() + False + sage: P.zero().is_monomial() + False """ cdef poly *_p cdef ring *_ring @@ -3279,7 +3363,7 @@ cdef class MPolynomial_libsingular(MPolynomial): _ring = self._parent_ring if self._poly == NULL: - return True + return False if(_ring != currRing): rChangeCurrRing(_ring) @@ -3291,6 +3375,32 @@ cdef class MPolynomial_libsingular(MPolynomial): p_Delete(&_p, _ring) return ret + def is_term(self): + """ + Return ``True`` if ``self`` is a term, which we define to be a + product of generators times some coefficient, which need + not be 1. + + Use :meth:`is_monomial()` to require that the coefficient be 1. + + EXAMPLES:: + + sage: P. = PolynomialRing(QQ) + sage: x.is_term() + True + sage: (2*x).is_term() + True + sage: (x*y).is_term() + True + sage: (x*y + x).is_term() + False + sage: P(2).is_term() + True + sage: P.zero().is_term() + False + """ + return self._poly != NULL and self._poly.next == NULL + def subs(self, fixed=None, **kw): """ Fixes some given variables in a given multivariate polynomial @@ -3609,16 +3719,13 @@ cdef class MPolynomial_libsingular(MPolynomial): sage: p.monomials() [x] """ - l = list() + cdef list l = [] cdef MPolynomialRing_libsingular parent = self._parent cdef ring *_ring = parent._ring if(_ring != currRing): rChangeCurrRing(_ring) cdef poly *p = p_Copy(self._poly, _ring) cdef poly *t - if p == NULL: - return [] - while p: t = pNext(p) p.next = NULL diff --git a/src/sage/rings/polynomial/pbori.pyx b/src/sage/rings/polynomial/pbori.pyx index 0ea74a744ce..e4d6fb4a415 100644 --- a/src/sage/rings/polynomial/pbori.pyx +++ b/src/sage/rings/polynomial/pbori.pyx @@ -207,7 +207,7 @@ from sage.structure.parent cimport Parent from sage.structure.sequence import Sequence from sage.structure.element import coerce_binop from sage.structure.unique_representation import UniqueRepresentation -from sage.structure.richcmp cimport richcmp, richcmp_not_equal +from sage.structure.richcmp cimport richcmp, richcmp_not_equal, rich_to_bool from sage.categories.action cimport Action @@ -2241,7 +2241,7 @@ cdef class BooleanMonomial(MonoidElement): gens = self._parent.gens() return self._parent, (tuple(gens.index(x) for x in self.variables()),) - cpdef int _cmp_(left, right) except -2: + cpdef _richcmp_(left, right, int op): """ Compare BooleanMonomial objects. @@ -2267,7 +2267,7 @@ cdef class BooleanMonomial(MonoidElement): """ cdef int res res = left._pbmonom.compare((right)._pbmonom) - return res + return rich_to_bool(op, res) def _repr_(self): """ diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx index 42001d4fcfa..99cf3a2963f 100644 --- a/src/sage/rings/polynomial/plural.pyx +++ b/src/sage/rings/polynomial/plural.pyx @@ -133,6 +133,7 @@ from sage.rings.polynomial.polydict import ETuple from sage.rings.ring import check_default_category from sage.structure.element cimport CommutativeRingElement, Element, ModuleElement, RingElement from sage.structure.factory import UniqueFactory +from sage.structure.richcmp cimport rich_to_bool from sage.structure.parent cimport Parent from sage.structure.parent_gens cimport ParentWithGens from sage.rings.polynomial.term_order import TermOrder @@ -1469,10 +1470,9 @@ cdef class NCPolynomial_plural(RingElement): """ return self._hash_c() - cpdef int _cmp_(left, right) except -2: + cpdef _richcmp_(left, right, int op): """ - Compare left and right and return -1, 0, and 1 for <,==, and > - respectively. + Compare left and right. EXAMPLES:: @@ -1515,11 +1515,11 @@ cdef class NCPolynomial_plural(RingElement): True """ if left is right: - return 0 + return rich_to_bool(op, 0) cdef poly *p = (left)._poly cdef poly *q = (right)._poly cdef ring *r = (left._parent)._ring - return singular_polynomial_cmp(p, q, r) + return rich_to_bool(op, singular_polynomial_cmp(p, q, r)) cpdef _add_(left, right): """ diff --git a/src/sage/rings/polynomial/polydict.pyx b/src/sage/rings/polynomial/polydict.pyx index f86c7c79905..48567384b9e 100644 --- a/src/sage/rings/polynomial/polydict.pyx +++ b/src/sage/rings/polynomial/polydict.pyx @@ -493,6 +493,26 @@ cdef class PolyDict: # exponent sums is at most 1. return len(set(map(sum, self.__repn))) <= 1 + def is_constant(self): + """ + Return ``True`` if ``self`` is a constant and ``False`` otherwise. + + EXAMPLES:: + + sage: from sage.rings.polynomial.polydict import PolyDict + sage: f = PolyDict({(2,3):2, (1,2):3, (2,1):4}) + sage: f.is_constant() + False + sage: g = PolyDict({(0,0):2}) + sage: g.is_constant() + True + sage: h = PolyDict({}) + sage: h.is_constant() + True + """ + cdef int ell = len(self.__repn) + return ell == 0 or (ell == 1 and sum(sum(k) for k in self.__repn) == 0) + def homogenize(PolyDict self, var): R = self.__repn H = {} diff --git a/src/sage/rings/polynomial/skew_polynomial_ring.py b/src/sage/rings/polynomial/skew_polynomial_ring.py index 571b9bc0e59..b55cba4c3be 100644 --- a/src/sage/rings/polynomial/skew_polynomial_ring.py +++ b/src/sage/rings/polynomial/skew_polynomial_ring.py @@ -5,7 +5,7 @@ which constructs a general dense skew univariate polynomials over commutative base rings with automorphisms over the base rings. This is the set of formal polynomials where the coefficients are written on the left of the variable of the skew polynomial ring. The modified multiplication -operation over elements of the base ring is extended to all elements of the skew poynomial ring +operation over elements of the base ring is extended to all elements of the skew polynomial ring by associativity and distributivity. This module also provides :class:`~sage.rings.polynomial.skew_polynomial_ring.SkewPolynomialRing_finite_order` @@ -1394,7 +1394,7 @@ def center(self, name=None, names=None, default=False): sage: P.parent() is S True - together with a converion map in the reverse direction:: + together with a conversion map in the reverse direction:: sage: Zy(x^6 + 2*x^3 + 3) y^2 + 2*y + 3 diff --git a/src/sage/rings/puiseux_series_ring_element.pyx b/src/sage/rings/puiseux_series_ring_element.pyx index 29be2de67af..d4bedc3428f 100644 --- a/src/sage/rings/puiseux_series_ring_element.pyx +++ b/src/sage/rings/puiseux_series_ring_element.pyx @@ -99,7 +99,7 @@ REFERENCES: # 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. -# http://www.gnu.org/licenses/ +# https://www.gnu.org/licenses/ # **************************************************************************** from sage.arith.functions import lcm @@ -141,7 +141,7 @@ cdef class PuiseuxSeries(AlgebraElement): - ``f`` -- one of the following types of inputs: * instance of :class:`PuiseuxSeries` - * instance that can be coerced into the Laurent sersies ring of the parent + * instance that can be coerced into the Laurent series ring of the parent - ``e`` -- integer (default: 1) the ramification index @@ -182,7 +182,7 @@ cdef class PuiseuxSeries(AlgebraElement): # -------------------------------------------------------- # choose a representative for this Puiseux series having - # minimal ramification index. This is neccessary because + # minimal ramification index. This is necessary because # some methods need it as minimal as possible (for example # :meth:`laurent_series' or :meth:`power_series`) # -------------------------------------------------------- diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index 7fc0cb99173..7fa7f8dab0c 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -875,7 +875,7 @@ def _factor_multivariate_polynomial(self, f, proof=True): # # As nbruin pointed out during the review of Trac #25390, # this can be accomplished more efficiently using the resultant - # of the polynomial with the number field's minimial polynomial. + # of the polynomial with the number field's minimal polynomial. # # We use two auxiliary polynomial rings: # diff --git a/src/sage/rings/valuation/inductive_valuation.py b/src/sage/rings/valuation/inductive_valuation.py index de73549d9d2..de63cb9532b 100644 --- a/src/sage/rings/valuation/inductive_valuation.py +++ b/src/sage/rings/valuation/inductive_valuation.py @@ -29,14 +29,14 @@ An introduction is also given in Chapter 4 of [Rüt2014]_. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2016-2018 Julian Rüth # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from __future__ import absolute_import from .valuation import DiscreteValuation, InfiniteDiscretePseudoValuation @@ -676,7 +676,7 @@ def mac_lane_step(self, G, principal_part_bound=None, assume_squarefree=False, a INPUT: - - ``G`` -- a sqaurefree monic non-constant integral polynomial ``G`` + - ``G`` -- a squarefree monic non-constant integral polynomial ``G`` which is not an :meth:`equivalence unit ` - ``principal_part_bound`` -- an integer or ``None`` (default: @@ -1596,7 +1596,8 @@ def _test_is_equivalence_irreducible(self, **options): tester = self._tester(**options) S = tester.some_elements(self.domain().some_elements()) for f in S: - if f.is_constant(): continue + if f.is_constant(): + continue is_equivalence_irreducible = self.is_equivalence_irreducible(f) F = self.equivalence_decomposition(f) tester.assertEqual(is_equivalence_irreducible, len(F)==0 or (len(F)==1 and F[0][1]==1)) diff --git a/src/sage/schemes/affine/affine_space.py b/src/sage/schemes/affine/affine_space.py index 0c847dbea65..b6c2f2d6989 100644 --- a/src/sage/schemes/affine/affine_space.py +++ b/src/sage/schemes/affine/affine_space.py @@ -957,6 +957,21 @@ def chebyshev_polynomial(self, n, kind='first', monic=False): else: raise ValueError("keyword 'kind' must have a value of either 'first' or 'second'") + def origin(self): + """ + Return the rational point at the origin of this affine space. + + EXAMPLES:: + + sage: A. = AffineSpace(QQ, 3) + sage: A.origin() + (0, 0, 0) + sage: _ == A(0,0,0) + True + + """ + return self([0]*self.ngens()) + class AffineSpace_field(AffineSpace_generic): def _point(self, *args, **kwds): @@ -1125,7 +1140,7 @@ def curve(self,F): INPUT: - ``F`` -- a polynomial, or a list or tuple of polynomials in - the coordinate ring of this affine space. + the coordinate ring of this affine space EXAMPLES:: @@ -1136,6 +1151,80 @@ def curve(self,F): from sage.schemes.curves.constructor import Curve return Curve(F, self) + def line_through(self, p, q): + """ + Return the line through ``p`` and ``q``. + + INPUT: + + - ``p``, ``q`` -- distinct rational points of the affine space + + EXAMPLES:: + + sage: A3. = AffineSpace(3, QQ) + sage: p1 = A3(1, 2, 3) + sage: p2 = A3(4, 5, 6) + sage: A3.line_through(p1, p2) + Affine Curve over Rational Field defined by -1/6*x + 1/6*y - 1/6, + -1/6*x + 1/6*z - 1/3, -1/6*y + 1/6*z - 1/6, -1/6*x + 1/3*y - 1/6*z + sage: L = _ + sage: L(p1) + (1, 2, 3) + sage: L(p2) + (4, 5, 6) + sage: A3.line_through(p1, p1) + Traceback (most recent call last): + ... + ValueError: not distinct points + + """ + if p == q: + raise ValueError("not distinct points") + + proj = self.projective_embedding(0) + P = proj.codomain() + return P.line_through(proj(p), proj(q)).affine_patch(0, self) + + def translation(self, p, q=None): + """ + Return the automorphism of the affine space translating ``p`` to the origin. + + If ``q`` is given, the automorphism translates ``p`` to ``q``. + + INPUT: + + - ``p`` -- a rational point + + - ``q`` -- (default: ``None``) a rational point + + EXAMPLES:: + + sage: A. = AffineSpace(QQ, 3) + sage: p = A(1,2,3) + sage: q = A(4,5,6) + sage: A.translation(p, q) + Scheme endomorphism of Affine Space of dimension 3 over Rational Field + Defn: Defined on coordinates by sending (x, y, z) to + (x + 3, y + 3, z + 3) + sage: phi = A.translation(p) + sage: psi = A.translation(A.origin(), q) + sage: psi * phi + Scheme endomorphism of Affine Space of dimension 3 over Rational Field + Defn: Defined on coordinates by sending (x, y, z) to + (x + 3, y + 3, z + 3) + sage: psi * phi == A.translation(p, q) + True + + """ + gens = self.gens() + + if q is not None: + v = [cp - cq for cp, cq in zip(p, q)] + else: + v = [cp for cp in p] + + return self._morphism(self.Hom(self), [x - c for x, c in zip(gens, v)]) + class AffineSpace_finite_field(AffineSpace_field): def _point(self, *args, **kwds): diff --git a/src/sage/schemes/affine/affine_subscheme.py b/src/sage/schemes/affine/affine_subscheme.py index b5a0435b77c..f6a2171bfca 100644 --- a/src/sage/schemes/affine/affine_subscheme.py +++ b/src/sage/schemes/affine/affine_subscheme.py @@ -22,6 +22,7 @@ from sage.categories.fields import Fields from sage.interfaces.all import singular +from sage.modules.all import vector from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme from .affine_morphism import SchemeMorphism_polynomial_affine_subscheme_field @@ -537,3 +538,60 @@ def _morphism(self, *args, **kwds): (x*y : x : y) """ return SchemeMorphism_polynomial_affine_subscheme_field(*args, **kwds) + + def tangent_space(self, p): + """ + Return the tangent space at the point ``p``. + + The points of the tangent space are the tangent vectors at ``p``. + + INPUT: + + - ``p`` -- a rational point + + EXAMPLES:: + + sage: A3. = AffineSpace(3, QQ) + sage: X = A3.subscheme(z-x*y) + sage: X.tangent_space(A3.origin()) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + z + sage: X.tangent_space(X(1,1,1)) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + -x - y + z + + Tangent space at a point may have higher dimension than the dimension + of the point. :: + + sage: C = Curve([x + y + z, x^2 - y^2*z^2 + z^3]) + sage: C.singular_points() + [(0, 0, 0)] + sage: p = C(0,0,0) + sage: C.tangent_space(p) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + x + y + z + sage: _.dimension() + 2 + sage: q = C(1,0,-1) + sage: C.tangent_space(q) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + x + y + z, + 2*x + 3*z + sage: _.dimension() + 1 + + """ + A = self.ambient_space() + R = A.coordinate_ring() + gens = R.gens() + + J = self.Jacobian_matrix() + Jp = J.apply_map( lambda f: f.subs(dict(zip(gens, p))) ) + I = [f for f in Jp * vector(gens) if f] + + return A.subscheme(R.ideal(I)) + diff --git a/src/sage/schemes/curves/affine_curve.py b/src/sage/schemes/curves/affine_curve.py index c5384f08387..a0bb92c7b59 100644 --- a/src/sage/schemes/curves/affine_curve.py +++ b/src/sage/schemes/curves/affine_curve.py @@ -117,7 +117,8 @@ from sage.rings.infinity import infinity from sage.schemes.affine.affine_space import AffineSpace, is_AffineSpace -from sage.schemes.affine.affine_subscheme import AlgebraicScheme_subscheme_affine +from sage.schemes.affine.affine_subscheme import (AlgebraicScheme_subscheme_affine, + AlgebraicScheme_subscheme_affine_field) from .curve import Curve_generic @@ -785,7 +786,7 @@ def rational_parameterization(self): return H([para[1]/para[0], para[2]/para[0]]) -class AffineCurve_field(AffineCurve): +class AffineCurve_field(AffineCurve, AlgebraicScheme_subscheme_affine_field): """ Affine curves over fields. """ @@ -1600,6 +1601,63 @@ def extension(self): p_maps = [res[i][2] for i in range(len(res))] return tuple([tuple(patches), tuple(t_maps), tuple(p_maps)]) + def tangent_line(self, p): + """ + Return the tangent line at the point ``p``. + + INPUT: + + - ``p`` -- a rational point of the curve + + EXAMPLES:: + + sage: A3. = AffineSpace(3, QQ) + sage: C = Curve([x + y + z, x^2 - y^2*z^2 + z^3]) + sage: p = C(0,0,0) + sage: C.tangent_line(p) + Traceback (most recent call last): + ... + ValueError: the curve is not smooth at (0, 0, 0) + sage: p = C(1,0,-1) + sage: C.tangent_line(p) + Affine Curve over Rational Field defined by x + y + z, 2*x + 3*z + 1 + + We check that the tangent line at ``p`` is the tangent space at ``p``, + translated to ``p``. :: + + sage: Tp = C.tangent_space(p) + sage: Tp + Closed subscheme of Affine Space of dimension 3 over Rational Field defined by: + x + y + z, + 2*x + 3*z + sage: phi = A3.translation(A3.origin(), p) + sage: T = phi * Tp.embedding_morphism() + sage: T.image() + Closed subscheme of Affine Space of dimension 3 over Rational Field defined by: + -2*y + z + 1, + x + y + z + sage: _ == C.tangent_line(p) + True + + """ + A = self.ambient_space() + R = A.coordinate_ring() + gens = R.gens() + + Tp = self.tangent_space(p) + + if Tp.dimension() > 1: + raise ValueError("the curve is not smooth at {}".format(p)) + + from sage.schemes.curves.all import Curve + + # translate to p + I = [] + for poly in Tp.defining_polynomials(): + I.append(poly.subs({x: x - c for x, c in zip(gens, p)})) + + return Curve(I, A) + class AffinePlaneCurve_field(AffinePlaneCurve, AffineCurve_field): """ diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 592bb68dc65..c0fd53295b5 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -115,13 +115,14 @@ from sage.matrix.all import matrix from sage.misc.all import add, sage_eval -from sage.rings.all import degree_lowest_rational_function +from sage.rings.all import degree_lowest_rational_function, IntegerRing from sage.rings.number_field.number_field import NumberField from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.qqbar import (number_field_elements_from_algebraics, QQbar) from sage.rings.rational_field import is_RationalField from sage.rings.integer import Integer + from sage.schemes.projective.projective_space import ProjectiveSpace, is_ProjectiveSpace from sage.schemes.projective.projective_subscheme import (AlgebraicScheme_subscheme_projective, @@ -1558,6 +1559,32 @@ def is_complete_intersection(self): L = singular.is_ci(I).sage() return len(self.ambient_space().gens()) - len(I.sage().gens()) == L[-1] + def tangent_line(self, p): + """ + Return the tangent line at the point ``p``. + + INPUT: + + - ``p`` -- a rational point of the curve + + EXAMPLES:: + + sage: P. = ProjectiveSpace(QQ, 3) + sage: C = Curve([x*y - z*w, x^2 - y*w, y^2*w - x*z*w], P) + sage: p = C(1,1,1,1) + sage: C.tangent_line(p) + Projective Curve over Rational Field defined by -2*x + y + w, -3*x + z + 2*w + + """ + for i in range(len(p)): + if p[i]: + C = self.affine_patch(i) + q = p.dehomogenize(i) + T = C.tangent_line(q) + return T.projective_closure(i, self.ambient_space()) + + raise TypeError("{} does not define a point in the projective space".format(p)) + class ProjectivePlaneCurve_field(ProjectivePlaneCurve, ProjectiveCurve_field): """ @@ -2291,7 +2318,7 @@ def _coordinate_functions(self): sage: C._coordinate_functions (1, y, z) """ - # homogeneous cooridinate functions + # homogeneous coordinate functions coords = list(self._open_affine._coordinate_functions) coords.insert(self._open_affine_index, self._function_field.one()) return tuple(coords) @@ -2307,6 +2334,10 @@ def _singularities(self): sage: C = Curve(y^2*z^7 - x^9 - x*z^8) sage: C._singularities [(Point (x, z), [Place (1/y, 1/y*z^5 + 4*y*z^4 + 1/y^2*z)])] + sage: D = Curve(x) + sage: D._singularities + [] + """ S = self.ambient_space().coordinate_ring() to_F = self._lift_to_function_field @@ -2317,19 +2348,20 @@ def _singularities(self): places = [] for i in range(self.ngens()): denom = self._coordinate_functions[i] - funcs = [] - for p in S._first_ngens(i) + sing.defining_polynomials(): - f = to_F(p)/denom**p.degree() - if not f.is_zero(): - funcs.append(f) + if denom: + funcs = [] + for p in S._first_ngens(i) + sing.defining_polynomials(): + f = to_F(p)/denom**p.degree() + if not f.is_zero(): + funcs.append(f) - if funcs: - f = funcs.pop() - pls = f.zeros() - for f in funcs: - pls = [p for p in pls if f.valuation(p) > 0] + if funcs: + f = funcs.pop() + pls = f.zeros() + for f in funcs: + pls = [p for p in pls if f.valuation(p) > 0] - places.extend(pls) + places.extend(pls) # compute closed points below the places lying on the singular locus, # and then collect places lying on each closed points @@ -2562,6 +2594,79 @@ def closed_points(self, degree=1): return points + @cached_method + def L_polynomial(self, name='t'): + """ + Return the L-polynomial of this possibly singular curve. + + INPUT: + + - ``name`` -- (default: ``t``) name of the variable of the polynomial + + EXAMPLES:: + + sage: A. = AffineSpace(GF(3), 2) + sage: C = Curve(y^2 - x^5 - x^4 - 2*x^3 - 2*x - 2) + sage: Cbar = C.projective_closure() + sage: Cbar.L_polynomial() + 9*t^4 - 3*t^3 + t^2 - t + 1 + + """ + F = self.function_field() + L = F.L_polynomial() + + R = L.parent() + T = R.gen() + + f = R.one() + for p, places in self._singularities: + for place in places: + f = f * (1 - T**place.degree()) + f = f // (1 - T**p.degree()) + + return L * f + + def number_of_rational_points(self, r=1): + """ + Return the number of rational points of the curve with + constant field extended by degree ``r``. + + INPUT: + + - ``r`` -- positive integer (default: `1`) + + EXAMPLES:: + + sage: A. = AffineSpace(GF(3), 2) + sage: C = Curve(y^2 - x^5 - x^4 - 2*x^3 - 2*x - 2) + sage: Cbar = C.projective_closure() + sage: Cbar.number_of_rational_points(3) + 21 + sage: D = Cbar.change_ring(Cbar.base_ring().extension(3)) + sage: D.base_ring() + Finite Field in z3 of size 3^3 + sage: len(D.closed_points()) + 21 + + """ + q = self.base_ring().order() + L = self.L_polynomial() + Lp = L.derivative() + + R = IntegerRing()[[L.parent().gen()]] # power series ring + L = R(L) + Lp = R(Lp) + + previous_prec = R.default_prec() + R.set_default_prec(r) + + f = Lp / L + n = f[r-1] + q**r + 1 + + R.set_default_prec(previous_prec) + + return n + class IntegralProjectivePlaneCurve_finite_field(ProjectivePlaneCurve_finite_field, IntegralProjectiveCurve_finite_field): """ diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index 0a5f3ebc6c7..8c5f0d82fc7 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2809,7 +2809,6 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): if K is rings.QQ: v = K.embeddings(RealField())[0] v_inf = refine_embedding(v, Infinity) - v_is_real = v_inf(K.gen()).imag().is_zero() # Find a suitable working precision. See trac#29666 for an diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index f56d3f424b2..3c2d253d63b 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -147,7 +147,7 @@ AUTHOR: """ -#**************************************************************************** +# *************************************************************************** # Copyright (C) 2016 Chris Wuthrich # # Distributed under the terms of the GNU General Public License (GPL) @@ -159,8 +159,8 @@ AUTHOR: # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#**************************************************************************** +# https://www.gnu.org/licenses/ +# *************************************************************************** from __future__ import print_function from cysignals.memory cimport sig_malloc, sig_free, sig_realloc @@ -1110,7 +1110,7 @@ cdef class ModularSymbolNumerical: # now to the bound for the unitary cusps # this is a bit better because they - # are definied over Q + # are defined over Q t0 = E0.torsion_order() if cinf == 1: t0 *= Integer(2) diff --git a/src/sage/schemes/generic/algebraic_scheme.py b/src/sage/schemes/generic/algebraic_scheme.py index 46d84da174b..b3af58476dc 100644 --- a/src/sage/schemes/generic/algebraic_scheme.py +++ b/src/sage/schemes/generic/algebraic_scheme.py @@ -1716,9 +1716,9 @@ def rational_points(self, **kwds): In the case of numerically approximated points, the points are returned over as points of the ambient space. - For a dimesion greater than 0 scheme, depending on bound size, either the + For a dimension greater than 0 scheme, depending on bound size, either the points in the ambient space are enumerated or a sieving algorithm lifting points - modulo primes is used. See the documention in homset for the details of the + modulo primes is used. See the documentation in homset for the details of the sieving algorithm. INPUT: diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py index eb4898f6013..f4dde5bf06e 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py @@ -26,7 +26,7 @@ - Dean Bisogno (2017): Fixed Hasse-Witt computation """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2006 David Kohel # Copyright (C) 2007 Robert Bradshaw # Copyright (C) 2010 Alyson Deines , Marina Gresham @@ -45,8 +45,8 @@ # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from __future__ import absolute_import from sage.rings.all import ZZ, RR, QQ, GF @@ -61,6 +61,7 @@ from sage.schemes.curves.projective_curve import ProjectivePlaneCurve_finite_field + class HyperellipticCurve_finite_field(hyperelliptic_generic.HyperellipticCurve_generic, ProjectivePlaneCurve_finite_field): def _frobenius_coefficient_bound_charpoly(self): @@ -838,7 +839,8 @@ def points(self): from sage.rings.finite_rings.finite_field_constructor import zech_log_bound try: return self.__points - except AttributeError: pass + except AttributeError: + pass if self.base_ring().is_prime_field(): self.__points = self._points_cache_sqrt() @@ -1298,7 +1300,7 @@ def cardinality_exhaustive(self, extension_degree=1, algorithm=None): def cardinality_hypellfrob(self, extension_degree=1, algorithm=None): r""" Count points on a single extension of the base field - using the ``hypellfrob`` prgoram. + using the ``hypellfrob`` program. EXAMPLES:: diff --git a/src/sage/schemes/projective/projective_space.py b/src/sage/schemes/projective/projective_space.py index 2a2916ef49c..4fed0413bac 100644 --- a/src/sage/schemes/projective/projective_space.py +++ b/src/sage/schemes/projective/projective_space.py @@ -1679,7 +1679,7 @@ def curve(self,F): INPUT: - ``F`` -- a polynomial, or a list or tuple of polynomials in - the coordinate ring of this projective space. + the coordinate ring of this projective space EXAMPLES:: @@ -1690,6 +1690,37 @@ def curve(self,F): from sage.schemes.curves.constructor import Curve return Curve(F, self) + def line_through(self, p, q): + """ + Return the line through ``p`` and ``q``. + + INPUT: + + - ``p``, ``q`` -- distinct rational points of the projective space + + EXAMPLES:: + + sage: P3. = ProjectiveSpace(3, QQ) + sage: p1 = P3(1, 2, 3, 4) + sage: p2 = P3(4, 3, 2, 1) + sage: P3.line_through(p1, p2) + Projective Curve over Rational Field defined by -5/4*x0 + 5/2*x1 - 5/4*x2, + -5/2*x0 + 15/4*x1 - 5/4*x3, -5/4*x0 + 15/4*x2 - 5/2*x3, -5/4*x1 + 5/2*x2 - 5/4*x3 + sage: p3 = P3(2,4,6,8) + sage: P3.line_through(p1, p3) + Traceback (most recent call last): + ... + ValueError: not distinct points + + """ + if p == q: + raise ValueError("not distinct points") + + from sage.schemes.curves.constructor import Curve + + m = matrix(3, list(self.gens()) + list(p) + list(q)) + return Curve([f for f in m.minors(3) if f]) + class ProjectiveSpace_finite_field(ProjectiveSpace_field): def _point(self, *args, **kwds): diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx index a5fbd555f2d..0791c72a70c 100644 --- a/src/sage/structure/element.pyx +++ b/src/sage/structure/element.pyx @@ -501,9 +501,12 @@ cdef class Element(SageObject): def __dir__(self): """ + Emulate ``__dir__`` for elements with dynamically attached methods. + Let cat be the category of the parent of ``self``. This method emulates ``self`` being an instance of both ``Element`` and - ``cat.element_class``, in that order, for attribute directory. + ``cat.element_class`` (and the corresponding ``morphism_class`` in the + case of a morphism), in that order, for attribute directory. EXAMPLES:: @@ -516,9 +519,26 @@ cdef class Element(SageObject): [..., 'is_idempotent', 'is_integer', 'is_integral', ...] sage: dir(1) # todo: not implemented [..., 'is_idempotent', 'is_integer', 'is_integral', ...] + + TESTS: + + Check that morphism classes are handled correctly (:trac:`29776`):: + + sage: R. = QQ[] + sage: f = R.hom([x, y+1], R) + sage: 'cartesian_product' in dir(f) + True + sage: 'extend_to_fraction_field' in dir(f) + True """ from sage.cpython.getattr import dir_with_other_class - return dir_with_other_class(self, self.parent().category().element_class) + ec = self.parent().category().element_class + try: + mc = self.category_for().morphism_class + except AttributeError: + return dir_with_other_class(self, ec) + else: + return dir_with_other_class(self, ec, mc) def _repr_(self): return "Generic element of a structure" diff --git a/src/sage/structure/parent.pyx b/src/sage/structure/parent.pyx index eb0255bf171..55a5cec3635 100644 --- a/src/sage/structure/parent.pyx +++ b/src/sage/structure/parent.pyx @@ -144,8 +144,8 @@ cdef bint is_Integer(x): def is_Parent(x): """ - Return True if x is a parent object, i.e., derives from - sage.structure.parent.Parent and False otherwise. + Return ``True`` if x is a parent object, i.e., derives from + sage.structure.parent.Parent and ``False`` otherwise. EXAMPLES:: @@ -1346,7 +1346,7 @@ cdef class Parent(sage.structure.category_object.CategoryObject): codomain = im_gens.universe() if isinstance(im_gens, Sequence_generic): im_gens = list(im_gens) - # Not all homsets accept catgory/check/base_map as arguments + # Not all homsets accept category/check/base_map as arguments kwds = {} if check is not None: kwds['check'] = check diff --git a/src/sage/tensor/all.py b/src/sage/tensor/all.py index cb7b9845b0c..b85a40c1b9d 100644 --- a/src/sage/tensor/all.py +++ b/src/sage/tensor/all.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import from .coordinate_patch import CoordinatePatch from .differential_forms import DifferentialForms from .differential_form_element import DifferentialForm, wedge diff --git a/src/sage/tensor/differential_form_element.py b/src/sage/tensor/differential_form_element.py index c4b57580128..5e1bcc1dbd6 100644 --- a/src/sage/tensor/differential_form_element.py +++ b/src/sage/tensor/differential_form_element.py @@ -21,8 +21,6 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from __future__ import print_function - from sage.symbolic.ring import SR from sage.structure.element import RingElement, AlgebraElement diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index 8fe82bfcc11..310e55d2ff2 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -184,12 +184,16 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False 0 sage: (out, err, ret) = test_executable(["sage", "--advanced"]) - sage: out.find("search through the Sage documentation") >= 0 + sage: out.find("run the Sage cleaner.") >= 0 True sage: err '' sage: ret 0 + sage: out.find("print the Sage root directory") >= 0 # optional - build + True + sage: out.find("regular expression search through the Sage") >= 0 # optional - build + True Basic information about the Sage installation:: @@ -216,7 +220,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False sage: out, err, ret = test_executable(["sage", "--info", "sqlite"]) # optional - build sage: print(out) # optional - build Found local metadata for sqlite-... - = SQLite = + SQLite + ====== ... SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. @@ -229,7 +234,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False sage: out, err, ret = test_executable(["sage", "-p", "--info", "--info", "sqlite"]) # optional - build sage: print(out) # optional - build Found local metadata for sqlite-... - = SQLite = + SQLite + ====== ... SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. diff --git a/src/sage/version.py b/src/sage/version.py index 42ea1e04034..951db210d81 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,5 +1,5 @@ # Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! -version = '9.2.beta0' -date = '2020-05-28' -banner = 'SageMath version 9.2.beta0, Release Date: 2020-05-28' +version = '9.2.beta1' +date = '2020-06-13' +banner = 'SageMath version 9.2.beta1, Release Date: 2020-06-13' diff --git a/tox.ini b/tox.ini index b260e8193da..dca633fb504 100644 --- a/tox.ini +++ b/tox.ini @@ -83,7 +83,7 @@ envlist = -{### ### Configuration factors: ### - python2 # configure Sage to use Python 2 instead of the default (Python 3) + python3_spkg } skipsdist = true @@ -279,7 +279,6 @@ setenv = # # - python # - python2: CONFIG_CONFIGURE_ARGS_1=--with-python=2 python3: CONFIG_CONFIGURE_ARGS_1= python3_spkg: CONFIG_CONFIGURE_ARGS_1=--without-system-python3 macos-python3_xcode: CONFIG_CONFIGURE_ARGS_1=--with-python=3 PYTHON3=/usr/bin/python3 @@ -368,7 +367,7 @@ commands = docker: done' # pathpy checksuite needs tox. #28728: gap fails its test suite. # linbox/cysignals testsuites fail. ppl takes very long. - local: bash -c 'export PATH={env:PATH} && {env:SETENV} && {env:BOOTSTRAP:./bootstrap} && ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && make -k V=0 base-toolchain && make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_PRE:} {posargs:build} && (make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) ' + local: bash -c 'export PATH={env:PATH} && {env:SETENV} && {env:BOOTSTRAP:./bootstrap} && ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && make -k V=0 base-toolchain && make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_PRE:} {posargs:build} && (make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) ' [testenv:check_configure] ## Test that configure behaves properly