diff --git a/.cirrus.yml.backup b/.cirrus.yml.backup deleted file mode 100644 index 3970103e..00000000 --- a/.cirrus.yml.backup +++ /dev/null @@ -1,20 +0,0 @@ -######################################################### -# Build arm64 wheels for OSX on Cirrus CI -######################################################### - -cirrus_wheels_macos_arm64_task: - name: Build macOS arm64 wheels. - macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:13.3.1 - env: - PATH: /opt/homebrew/opt/python@3.10/bin:$PATH - CIBW_ARCHS_MACOS: arm64 - CIBW_TEST_COMMAND: "python -m flint.test" - install_pre_requirements_script: - - python3 -m venv venv - - venv/bin/pip install --upgrade pip - - venv/bin/pip install cibuildwheel==2.16.2 - run_cibuildwheel_script: - - venv/bin/cibuildwheel --platform macos - wheels_artifacts: - path: "wheelhouse/*" diff --git a/.coveragerc.meson b/.coveragerc.meson deleted file mode 100644 index a72fd709..00000000 --- a/.coveragerc.meson +++ /dev/null @@ -1,2 +0,0 @@ -[run] -plugins = coverage_plugin diff --git a/.coveragerc.setuptools b/.coveragerc.setuptools deleted file mode 100644 index d9a48b4b..00000000 --- a/.coveragerc.setuptools +++ /dev/null @@ -1,2 +0,0 @@ -[run] -plugins = Cython.Coverage diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 0e8cc813..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: "monthly" - groups: - minor-patch-dependencies: - patterns: - - "*" - update-types: - - "patch" - - "minor" diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml deleted file mode 100644 index 42cf56c8..00000000 --- a/.github/workflows/buildwheel.yml +++ /dev/null @@ -1,359 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build_wheels: - name: Build wheels for ${{ matrix.os }} - runs-on: ${{ matrix.os }} - continue-on-error: true - strategy: - fail-fast: false - matrix: - os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2022, macos-15-intel, macos-14] - - steps: - - uses: actions/checkout@v6.0.2 - - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - - uses: msys2/setup-msys2@v2.30.0 - with: - msystem: mingw64 - if: ${{ startsWith( matrix.os , 'windows' ) }} - - # Install pkgconfig on Windows from choco rather than from msys and - # avoid using the Strawberry one. - - run: choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite - if: ${{ startsWith( matrix.os , 'windows' ) }} - - # We have to set this here rather than in the cibuildwheel config - # This is probably something to do with \ vs / in paths... - - run: echo "PKG_CONFIG_PATH=${{ github.workspace }}/.local/lib/pkgconfig" >> $env:GITHUB_ENV - if: ${{ startsWith( matrix.os , 'windows' ) }} - - - name: Build wheels - uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 - env: - # override setting in pyproject.toml to use msys2 instead of msys64 bash - CIBW_BEFORE_ALL_WINDOWS: msys2 -c bin/cibw_before_all_windows.sh - - - uses: actions/upload-artifact@v5 - with: - name: wheels-${{ matrix.os }} - path: wheelhouse/*.whl - - build_sdist: - name: Build sdist - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v6.0.2 - - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - - run: bin/install_latest_flint_ubuntu.sh - - run: pip install build - - run: python -m build --sdist - - - uses: actions/upload-artifact@v5 - with: - name: sdist - path: dist/*.tar.gz - - test_wheels: - needs: build_wheels - name: Test ${{ matrix.python-version }} wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ - ubuntu-22.04, - ubuntu-24.04, - ubuntu-24.04-arm, - windows-2022, - windows-2025, - macos-15-intel, - macos-14, - macos-15, - ] - # This list to be kept in sync with python-requires in pyproject.toml. - python-version: ['3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t', 'pypy3.11'] - - steps: - - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - uses: actions/download-artifact@v7 - with: - path: wheelhouse - merge-multiple: true - - run: pip install --no-index --find-links wheelhouse python_flint - - # Check if the GIL is disabled in the free-threading build after import. - - run: | - python --version --version - which python - python -c "import sysconfig; print(sysconfig.get_config_var('Py_GIL_DISABLED'))" - python -c "import sys; print(getattr(sys, '_is_gil_enabled', lambda: True)())" - python -c "import sys; import flint; print(getattr(sys, '_is_gil_enabled', lambda: True)())" - - - run: python -m flint.test --verbose - - # On new enough Ubuntu we can build against the system deb. - test_pip_flint_deb: - name: Build on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04] - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install . - - run: python -m flint.test --verbose - - test_docs: - name: Test docs (build and doctest) - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: bin/install_latest_flint_ubuntu.sh - - run: pip install --upgrade pip - - run: pip install -r requirements-dev.txt - - run: spin run -- pytest --doctest-glob='*.rst' doc/source - - run: spin docs - - # Test build with minimum Cython and meson-python versions. - test_old_build_requires: - name: 'Test old Cython/meson-python' - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - # The versions of cython and meson-python here should be kept in sync - # with those in pyproject.toml so that we test the stated minimum - # versions. - # - # We don't need to specify ninja as a requirement in pyproject.toml - # because without --no-build-isolation meson-python handles it - # automatically in get_requirements_for_build_wheel(). - - run: 'pip install "cython==3.0.11" "meson-python==0.18" "ninja<1.11"' - - run: pip install --no-build-isolation . - - run: python -m flint.test --verbose - - # For older Ubuntu we have to build Flint >= 3.0.0 - test_flint_releases: - name: Test flint ${{ matrix.flint-tag }} - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - # Supported Flint versions: - flint-tag: ['v3.0.1', 'v3.1.3-p1', 'v3.2.2', 'v3.3.1'] - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: bin/install_flint_ubuntu.sh ${{ matrix.flint-tag }} - - run: pip install . - - run: python -m flint.test --verbose - - # Test against flint main - test_flint_main: - name: Test flint main Linux x86-64 - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: bin/install_flint_ubuntu.sh main - # Need to disable flint version check to build against main - - run: pip install --config-settings=setup-args="-Dflint_version_check=false" . - - run: python -m flint.test --verbose - - # Test against flint main - test_flint_main_arm: - name: Test flint main Linux ARM - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: bin/install_flint_ubuntu.sh main - # Need to disable flint version check to build against main - - run: pip install --config-settings=setup-args="-Dflint_version_check=false" . - - run: python -m flint.test --verbose - - # Test that we can make a coverage build and report coverage - test_coverage_build_setuptools: - name: Test coverage setuptools build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install -r requirements-dev.txt - - run: bin/coverage_setuptools.sh - - # Test that we can make a coverage build and report coverage - test_coverage_build_meson: - name: Test coverage meson build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.12' # does not work with 3.13 - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install -r requirements-dev.txt - - run: bin/coverage.sh - - # Run SymPy test suite against python-flint master - test_sympy: - name: Test SymPy ${{ matrix.sympy-version }} - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - sympy-version: ['1.13.1', '1.14.0'] - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install . - - run: pip install pytest pytest-xdist hypothesis - - run: pip install sympy==${{ matrix.sympy-version }} - - run: python -c 'import sympy; sympy.test(parallel=True)' - - # Run SymPy master branch agains python-flint main - test_sympy_master: - name: Test SymPy master - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - run: sudo apt-get update - - run: sudo apt-get install libflint-dev - - run: pip install . - - run: pip install pytest pytest-xdist hypothesis - - run: pip install git+https://github.com/sympy/sympy.git@master - - run: python -c 'import sympy; sympy.test(parallel=True)' - - # Push nightly wheels to Anaconda scientific-python nightly channel - # https://scientific-python.org/specs/spec-0004/ - # https://anaconda.org/scientific-python-nightly-wheels/python-flint - # https://github.com/scientific-python/upload-nightly-action/issues/111 - - nightly-wheels-upload: - name: Upload Anaconda Scientific Python nightly wheels - needs: [build_wheels] - # Run on push/merge to main - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - - steps: - # Downloads all artifacts - - name: Download release artifacts - uses: actions/download-artifact@v7 - with: - path: wheelhouse - merge-multiple: true - - - name: Copy the wheels into dist - run: mkdir dist && cp wheelhouse/*.whl dist - - - name: Upload wheels - uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf # 0.6.3 - with: - artifacts_path: dist - # This token is generated from anaconda.org - # https://github.com/scientific-python/upload-nightly-action/issues/111 - anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} - - # Deploy wheels and sdist to PyPI - - pypi_release: - name: Publish to PyPI - needs: [build_wheels, build_sdist] - # Run only when a tag is pushed to the flintlib/python-flint repo - if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository_owner == 'flintlib'" - environment: - name: pypi - url: https://pypi.org/p/python-flint - permissions: - id-token: write - runs-on: ubuntu-latest - - steps: - # Downloads all artifacts - - name: Download release artifacts - uses: actions/download-artifact@v7 - with: - path: wheelhouse - merge-multiple: true - - - name: Copy the PyPI files into dist - run: mkdir dist && cp wheelhouse/*.whl wheelhouse/*.tar.gz dist - - - name: Publish package on PyPI - # It is recommended to pin a commit hash here for security but it - # should be kept up to date. Possibly all actions and dependencies used - # by the build script should be pinned... - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 - - # Make a GitHub release - - github-publish: - name: Publish GitHub release - needs: pypi_release - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v6.0.2 - - - name: Download sdist - uses: actions/download-artifact@v7 - with: - name: sdist - path: dist - - - name: Create GitHub release - env: - GH_TOKEN: ${{ github.token }} - run: > - gh release create ${{ github.ref_name }} dist/* - --title "python-flint ${{ github.ref_name }}" - --notes "https://github.com/flintlib/python-flint?tab=readme-ov-file#changelog" diff --git a/.github/workflows/ci-emscripten.yml b/.github/workflows/ci-emscripten.yml deleted file mode 100644 index 27f1741b..00000000 --- a/.github/workflows/ci-emscripten.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Run Pyodide CI - -on: - pull_request: - workflow_dispatch: - -env: - FORCE_COLOR: 3 - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - # cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - env: - PYODIDE_VERSION: "https://github.com/pyodide/pyodide-build-environment-nightly/releases/download/20250523-emscripten_4.0.9/xbuildenv.tar.bz2" - PYTHON_VERSION: 3.13 # any 3.13.x version works - EMSCRIPTEN_VERSION: 4.0.9 - NODE_VERSION: 22 - steps: - - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2 - - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.4.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Set up Emscripten toolchain - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 - with: - version: ${{ env.EMSCRIPTEN_VERSION }} - actions-cache-folder: emsdk-cache - - - name: Set up Node.js - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install pyodide-build - run: | - pip install pyodide-build - pyodide xbuildenv install --url ${{ env.PYODIDE_VERSION }} - - - name: Restore WASM library directory from cache - id: cache-wasm-library-dir - uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 - with: - path: ${{ github.workspace }}/wasm-library-dir - key: wasm-library-dir-${{ hashFiles('bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0 - - - name: Build GMP, MPFR and FLINT - if: steps.cache-wasm-library-dir.outputs.cache-hit != 'true' - env: - CFLAGS: "-fPIC" - run: bin/pyodide_build_dependencies.sh --wasm-library-dir ${{ github.workspace }}/wasm-library-dir - - - name: Persist WASM library directory to cache - uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 - with: - path: ${{ github.workspace }}/wasm-library-dir - key: wasm-library-dir-${{ hashFiles('bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0 - - - name: Restore python-flint build directory from cache - uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 - with: - path: ${{ github.workspace }}/flint_wasm_build - key: flint-wasm-build-${{ hashFiles('**/meson.build', '**/pyproject.toml', '**/setup.py') }} - - - name: Build python-flint - env: - WASM_LIBRARY_DIR: ${{ github.workspace }}/wasm-library-dir - run: | - export PKG_CONFIG_PATH="${{ env.WASM_LIBRARY_DIR }}/lib/pkgconfig:${PKG_CONFIG_PATH}" - export CFLAGS="-I${{ env.WASM_LIBRARY_DIR }}/include ${CFLAGS:-}" - export LDFLAGS="-L${{ env.WASM_LIBRARY_DIR }}/lib -lflint -lmpfr -lgmp ${LDFLAGS:-}" - - echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" - echo "CFLAGS=${CFLAGS}" - echo "LDFLAGS=${LDFLAGS}" - - pkg-config --modversion python3 - pkg-config --modversion mpfr - pkg-config --modversion flint - - pyodide build -Cbuild-dir=flint_wasm_build -Csetup-args="-Dflint_version_check=false" - - - name: Persist python-flint build directory to cache - uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 - with: - path: ${{ github.workspace }}/flint_wasm_build - key: flint-wasm-build-${{ hashFiles('**/meson.build', '**/pyproject.toml', '**/setup.py') }} - - - name: Set up Pyodide virtual environment and test python-flint - run: | - pyodide venv .venv-pyodide - - source .venv-pyodide/bin/activate - pip install dist/*.whl - - cd doc - - pip install pytest hypothesis - # Don't use the cache provider plugin, as it doesn't work with Pyodide - # right now: https://github.com/pypa/cibuildwheel/issues/1966 - pytest -svra -p no:cacheprovider --pyargs flint diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 235d0f9a..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Linting - -on: [push, pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.12"] - steps: - - uses: actions/checkout@v6.0.2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install uv - uv pip install cython-lint --upgrade --system - - - name: cython-lint - run: | - cython-lint src/ diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 075ec3ce..00000000 --- a/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -build/* -build-install/* -dist/* -src/flint/**/*.c -src/flint/*.html -doc/build/* -fmake* -*.whl -*.pyc -*.pyd -*.so -__pycache__ -MANIFEST -.eggs -.local -*.egg-info -.coverage -*.swp -.python-version -*.DS_Store -.venv -.hypothesis diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index cb39cf02..00000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the OS, Python version and other tools you might need -build: - os: ubuntu-24.04 - tools: - python: "3.12" - - apt_packages: - - libflint-dev - jobs: - pre_build: - - pip install . - - # Tried to use this to build latest version of FLINT but FLINT does not build - # in rtd for some reason. FLINT's configure seems to fail in all sorts of ways - # even though GMP and MPFR build fine. - # - # commands: - # - pip install -r requirements-dev.txt - # - bin/build_dependencies_unix.sh --use-gmp-github-mirror - # - spin build -- --pkg-config-path=.local/lib/pkgconfig -Dadd_flint_rpath=true - # - spin docs - # - mv doc/build/html $READTHEDOCS_OUTPUT/html - -# Build documentation in the "docs/" directory with Sphinx -sphinx: - configuration: doc/source/conf.py - -# Optionally build your docs in additional formats such as PDF and ePub -# formats: -# - pdf -# - epub - -# Optional but recommended, declare the Python requirements required -# to build your documentation -# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -python: - install: - - requirements: requirements-dev.txt diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 43c2ad50..00000000 --- a/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-2016 Fredrik Johansson - -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 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 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. - diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 9acf0362..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include LICENSE -include CHANGES -include README.md -recursive-include src/flint *.pxd *.pyx *.py -include doc/source/*.py -include doc/source/*.rst -include doc/Makefile diff --git a/README.md b/README.md deleted file mode 100644 index d6b38322..00000000 --- a/README.md +++ /dev/null @@ -1,512 +0,0 @@ -Python-FLINT -============ - -Python extension module wrapping FLINT (Fast Library for Number Theory) -and Arb (arbitrary-precision ball arithmetic). Features: - -* Integers, rationals, integers mod n -* Real and complex numbers with rigorous error tracking -* Polynomials, power series and matrices over all the above types -* Lots of mathematical functions - -Documentation: https://python-flint.readthedocs.io/en/latest/ - -Repository: https://github.com/flintlib/python-flint/ - -Author: Fredrik Johansson - -Installation ------------- - -Currently python-flint supports CPython versions 3.11-3.14 and 3.14t -(free-threaded) and provides binaries on PyPI for the following platforms: - -- Windows (x86-64) -- MacOS (x86-64, arm64) -- Linux (manylinux: x86-64, aarch64) - -For these platforms python-flint can be installed simply with `pip` - - pip install python-flint - -Alternatively python-flint can be installed using `conda` - - conda install -c conda-forge python-flint - -Build from source ------------------ - -For other platforms or architectures installation needs to build from source. -First install FLINT 3. Starting with python-flint 0.5.0 older versions of Flint -such as 2.9 are not supported any more. Note that as of Flint 3 Arb no longer -needs to be built separately as it is now merged into Flint. - -As of e.g. Ubuntu 24.04 a new enough version of FLINT (at least version 3) can -be installed from the Ubuntu repos like - - sudo apt-get install libflint-dev - -For older distros the version in the repos is too old and a newer version of -FLINT needs to be built. See here for instructions on building FLINT: - -* http://flintlib.org/ - -A script that builds and installs FLINT on Ubuntu can be found here: - -* https://github.com/flintlib/python-flint/blob/master/bin/install_flint_ubuntu.sh - -The latest release of Python-FLINT can then be built from source and installed -using: - - pip install --no-binary python-flint python-flint - -Python-FLINT can also be installed from a git checkout or a source archive -as follows: - - pip install . - -See the documentation for further notes on building and installing -python-flint: - -* https://python-flint.readthedocs.io/en/latest/build.html -* https://python-flint.readthedocs.io/en/latest/install.html - -Examples -------------------------------------- - -Import Python-FLINT: - - >>> from flint import * - -Number-theoretic functions: - - >>> fmpz(1000).partitions_p() - 24061467864032622473692149727991 - >>> fmpq.bernoulli(64) - -106783830147866529886385444979142647942017/510 - -Polynomial arithmetic: - - >>> a = fmpz_poly([1,2,3]); b = fmpz_poly([2,3,4]); a.gcd(a * b) - 3*x^2 + 2*x + 1 - >>> a = fmpz_poly(list(range(10001))); b = fmpz_poly(list(range(10000))); a.gcd(a * b).degree() - 10000 - >>> x = fmpz_poly([0,1]); ((1-x**2)*(1+x**3)**3*(1+x+2*x)).factor() - (-1, [(3*x + 1, 1), (x + (-1), 1), (x^2 + (-1)*x + 1, 3), (x + 1, 4)]) - -Matrix arithmetic: - - >>> fmpz_mat([[1,1],[1,0]]) ** 10 - [89, 55] - [55, 34] - >>> fmpq_mat.hilbert(10,10).det() - 1/46206893947914691316295628839036278726983680000000000 - -Numerical evaluation: - - >>> showgood(lambda: (arb.pi() * arb(163).sqrt()).exp() - 640320**3 - 744, dps=25) - -7.499274028018143111206461e-13 - >>> showgood(lambda: (arb.pi() * 10**100 + arb(1)/1000).sin(), dps=25) - 0.0009999998333333416666664683 - -Numerical integration: - - >>> ctx.dps = 30 - >>> acb.integral(lambda x, _: (-x**2).exp(), -100, 100) ** 2 - [3.141592653589793238462643383 +/- 3.11e-28] - -To do -------------------------------------- - -* Write more tests and add missing docstrings -* Wrap missing flint types: matrices over finite fields, p-adic numbers, rational functions -* Build on the preliminary interface to FLINT's generic (gr) types. -* Make a nicer interface like `ZZ(1)` etc rather than `fmpz_poly([1, 2])`. -* Vector or array types (maybe) -* Many convenience methods -* Write generic implementations of functions missing for specific FLINT types -* Proper handling of special values in various places (throwing Python - exceptions instead of aborting, etc.) -* Various automatic conversions -* Conversions to and from external types (numpy, sage, sympy, mpmath, gmpy) -* Improved printing and string input/output -* IPython hooks (TeX pretty-printing etc.) - -Compatibility table -------------------- - -Generally each release of python-flint will be compatible with a range of -Python versions. Since python-flint 0.5.0 the minimum supported Flint version -is `3.0` and each release of python-flint supports all versions of Flint -`>=3.0` available at the time of release. - -Compatible versions: - -| python-flint | Release date | CPython | FLINT | Cython | -|--------------|---------------|-------------|------------|------------------| -| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.3` | `3.1-3.2?` | -| `0.8.0` | 29th Aug 2025 | `3.11-3.14` | `3.0-3.3` | `3.1` only | -| `0.7.0` | 16th Mar 2025 | `3.11-3.13` | `3.0-3.2` | `3.0.11-3.1.0a1` | -| `0.6.0` | 1st Feb 2024 | `3.9-3.12` | `3.0` only | `3.0` only | - -The requirement for Cython 3.1 is only for CPython's free-threaded build. -Otherwise Cython 3.0 is fine. Cython 3.2 is required for a stable ABI build of -python-flint. - -As of python-flint 0.7.0, CPython 3.13 [PEP -703](https://peps.python.org/pep-0703/) free-threaded (no-GIL) builds of -python-flint are provided. In the the free-threaded build, mutating matrices or -polynomials from multiple threads can lead to memory corruption. There are some -other known issues with the free-threaded build so it should be considered -experimental. - -CHANGELOG -========= - -Next release (0.9.0)... ------------------------ - -Contributors (0.9.0): - -- Rémy Oudompheng (RO) -- Agriya Khetarpal (AK) -- Oscar Benjamin (OB) -- Daniel Simmons-Marengo (DSM) - -Changes (0.9.0): - -- [gh-322](https://github.com/flintlib/python-flint/pull/322), - Add `mul_low` and `pow_trunc` methods to `fmpz_poly`, `fmpq_poly` and - `nmod_poly`. (RO) -- [gh-318](https://github.com/flintlib/python-flint/pull/318), - Add emscripten build in CI. Polynomial factors and roots are - now sorted into a consistent order for `nmod_poly` and - `fq_default_poly`. Some tests are fixed so that they pass on - 32-bit systems. (AK, OB) -- [gh-312](https://github.com/flintlib/python-flint/pull/312), - Add `discriminant` method to `fmpz_poly`, `fmpq_poly` and - `nmod_poly`. (RO) -- [gh-336](https://github.com/flintlib/python-flint/pull/336), - Fixed a bug in `arb.neg()` which caused it to return its input - without negating it. (DSM) -- [gh-339](https://github.com/flintlib/python-flint/pull/339), - Add `fmpq.__float__` method so that `float(fmpq)` and `complex(fmpq)` - work. (OB) -- [gh-324](https://github.com/flintlib/python-flint/pull/324), - Faster conversion from `int` to `fmpz` and back. (RO). -- [gh-359](https://github.com/flintlib/python-flint/pull/359), - Sort factorisations of all mpoly types. (OB) - -0.8.0 ------ - -Contributors (0.8.0): - -- Oscar Benjamin (OB) -- Robert Dougherty-Bliss (RDB) -- Rémy Oudompheng (RO) -- Agriya Khetarpal (AK) - -Notes (0.8.0): - -- This mostly a maintenance release with some bug fixes, - dependency updates and a few smaller features. -- Since GitHub Actions is retiring its MacOS x86-64 runners - python-flint 0.8.0 is likely the last release to provide - prebuilt wheels for MacOS x86-64 (MacOS arm64 remains - fully supported). It is likely that future versions will - still work fine on MacOS x86-64 but would require building - from source and will not be tested in python-flint's CI. - MacOS arm64 wheels will still be provided and tested. - -Changes (0.8.0): - -- [gh-302](https://github.com/flintlib/python-flint/pull/302), - [gh-283](https://github.com/flintlib/python-flint/pull/283), - [gh-284](https://github.com/flintlib/python-flint/pull/284), - Wheels now ship MPFR 4.2.2 and FLINT 3.3.1. Cython 3.1 is now - supported for building (and required for the freethreaded - build). Wheels are provided for CPython 3.14 and 3.14t - (free-threaded) and PyPy 3.11. (OB) -- [gh-310](https://github.com/flintlib/python-flint/pull/310), - Add `truncate`, `left_shift` and `right_shift` methods to - `fmpz_poly`, `fmpq_poly`, `nmod_poly`, `acb_poly`, `arb_poly` - to match other univariate polynomial types. (RO) -- [gh-287](https://github.com/flintlib/python-flint/pull/287), - [gh-293](https://github.com/flintlib/python-flint/pull/293), - [gh-305](https://github.com/flintlib/python-flint/pull/305), - [gh-307](https://github.com/flintlib/python-flint/pull/307), - [gh-309](https://github.com/flintlib/python-flint/pull/309), - Add type annotations for `fmpz`, `fmpq`, `nmod`, `fmpz_mod`, - `fq_default`, `fmpz_poly`, `fmpq_poly`, `nmod_poly`, - `fmpz_mod_poly`, `fq_default_poly`, `fmpz_mpoly`, `fmpq_mpoly`, - `nmod_mpoly`, `fmpz_mod_mpoly`, `fmpz_series` and `fmpq_series` - (about half of the codebase). (OB) -- [gh-300](https://github.com/flintlib/python-flint/pull/300), - Fix `arb.repr` which now returns a Python representation that - round trips. (OB) -- [gh-292](https://github.com/flintlib/python-flint/pull/292), - The `fmpq` constructor now accepts `fmpq` numerator and denominator - as input. (OB) -- [gh-289](https://github.com/flintlib/python-flint/pull/289), - Add `.prec` attribute to series types `fmpz_series`, `fmpq_series`, - `arb_series` and `acb_series`. (OB) -- [gh-285](https://github.com/flintlib/python-flint/pull/285), - Don't use deprecated meson build option. (AK) -- [gh-274](https://github.com/flintlib/python-flint/pull/274), - Add resultant methods to `fmpz_poly`, `fmpq_poly` and - `nmod_poly`. Now all univariate and polynomial types have the - resultant method except for `fq_default_poly`. (RDB) - - -0.7.0 ------ - -Contributors (0.7.0): - -- Jake Moss (JM) -- Giacomo Pope (GP) -- Joris Roos (JR) -- Edgar Costa (EC) -- Frédéric Chapoton (FC) -- Oscar Benjamin (OB) -- Tom Hubrecht (TH) - -Highlights (0.7.0): - -- [gh-270](https://github.com/flintlib/python-flint/pull/270), - PyPI packages are now built with FLINT 3.2.0 (previously - 3.0.1 was used). All versions from FLINT 3.0.0 to FLINT 3.2.0 - are compatible with python-flint but some features require - newer FLINT versions and the PyPI packages now use FLINT 3.2.0. -- [gh-97](https://github.com/flintlib/python-flint/pull/97), - [gh-182](https://github.com/flintlib/python-flint/pull/180): - Add `fq_default` and `fq_default_poly` for finite fields and - univariate polynomials over finite fields. This exposes all - of the different implementations of finite fields (`fq_zech`, - `fq_nmod` etc) via the `fq_default` interface. (GP) -- [gh-132](https://github.com/flintlib/python-flint/pull/132), - [gh-164](https://github.com/flintlib/python-flint/pull/164), - [gh-190](https://github.com/flintlib/python-flint/pull/190), - [gh-191](https://github.com/flintlib/python-flint/pull/191): - [gh-192](https://github.com/flintlib/python-flint/pull/192): - [gh-216](https://github.com/flintlib/python-flint/pull/216): - [gh-225](https://github.com/flintlib/python-flint/pull/225): - [gh-228](https://github.com/flintlib/python-flint/pull/228): - Add `fmpz_mpoly`, `fmpq_mpoly`, `nmod_poly` and `fmpz_mod_poly` - types for multivariate polynomials with integer, rational or - integers mod `n` coefficients. (JM) -- [gh-142](https://github.com/flintlib/python-flint/pull/142) - Add `acb_theta` module for the numerical evaluation of [theta - functions](https://flintlib.org/doc/acb_theta.html) (only - available for `Flint >= 3.1`). (EC) -- [gh-218](https://github.com/flintlib/python-flint/pull/218) - [gh-254](https://github.com/flintlib/python-flint/pull/254) - [gh-255](https://github.com/flintlib/python-flint/pull/255) - An experimental interface for FLINT's generic rings has been - added. This provides access to many of FLINT's types that - are not yet wrapped by python-flint such as Gaussian integer, - number fields, qqbar, calcium, as well as both univariate and - multivariate polynomials and series over these rings (no - matrices yet though). (OB and TH) -- [gh-129](https://github.com/flintlib/python-flint/pull/129) - [gh-208](https://github.com/flintlib/python-flint/pull/208) - Use meson/meson-python instead of setuptools as the build system - for parallel builds and better detection of build and dependency - requirements. (OB) -- [gh-201](https://github.com/flintlib/python-flint/pull/201) - [gh-202](https://github.com/flintlib/python-flint/pull/202) - The documentation has been updated and is now at - [readthedocs](https://python-flint.readthedocs.io/en/latest/). - (OB) - [gh-235](https://github.com/flintlib/python-flint/pull/235) - Nightly wheels for python-flint can now be installed from the - [Anaconda Scientific Python Nightly Wheels index] - (https://anaconda.org/scientific-python-nightly-wheels/python-flint). - [gh-259](https://github.com/flintlib/python-flint/pull/259) - Add PyPI wheels for Linux aarch64 (Linux on ARM CPU). (OB) - -Compatibility break (0.7.0): - -- [gh-189](https://github.com/flintlib/python-flint/pull/189) - As of python-flint 0.7.0 `fmpq_poly.factor()` now returns - primitive rather than monic factors i.e. `2*x + 1` rather than - `x + 1/2`. This ensures consistency between all poly types - including between `fmpq_poly` and `fmpq_mpoly`. (OB) - -Other changes (0.7.0): - -- [gh-269](https://github.com/flintlib/python-flint/pull/269) - All univariate and multivariate polynomial types have - `is_zero`, `is_one` and `is_constant` methods. All polynomial - types now consistently handle negative powers where possible. -- [gh-261](https://github.com/flintlib/python-flint/pull/261) - Add `fmpz_mat.fflu` for fraction-free LU decomposition of - an integer matrix. -- [gh-251](https://github.com/flintlib/python-flint/pull/251) - Add mpmath-style precision context managers for arb - `extraprec`, `extradps`, `workprec` and `workdps`. (TH) -- [gh-250](https://github.com/flintlib/python-flint/pull/250) - Add `fmpq.gcd()` method. -- [gh-215](https://github.com/flintlib/python-flint/pull/215) - [gh-219](https://github.com/flintlib/python-flint/pull/219) - The FLINT binding declarations are now fully generated - automatically from the FLINT docs. (OB) -- [gh-203](https://github.com/flintlib/python-flint/pull/203) - [gh-204](https://github.com/flintlib/python-flint/pull/204) - [gh-205](https://github.com/flintlib/python-flint/pull/205) - [gh-206](https://github.com/flintlib/python-flint/pull/206) - [gh-207](https://github.com/flintlib/python-flint/pull/207) - [gh-211](https://github.com/flintlib/python-flint/pull/211) - [gh-212](https://github.com/flintlib/python-flint/pull/212) - [gh-271](https://github.com/flintlib/python-flint/pull/271) - Various linting fixes and codebase improvements (FC and GP). -- [gh-189](https://github.com/flintlib/python-flint/pull/189) - All scalar and poly types now have `sqrt`. All poly types now - have `factor_squarefree` and `leading_coefficient` methods. - Exception types raised in a number of places were changed to - `DomainError` for better consistency. (OB) -- [gh-196](https://github.com/flintlib/python-flint/pull/196) - Supported Python versions are 3.10-3.13 (3.9 dropped). CI - Testing added for 3.13 free-threaded CPython. -- [gh-194](https://github.com/flintlib/python-flint/pull/194) - Add version checking for build requirements. (OB) -- [gh-180](https://github.com/flintlib/python-flint/pull/180) - Add `equal_trunc`, `add_trunc`, `sub_trunc`, `mul_low`, - `mul_mod` and `pow_trunc` methods to `fmpz_mod_poly`. (GP) -- [gh-177](https://github.com/flintlib/python-flint/pull/177) - Remove old Py2 code for compatibility with Cython 3.1. (OB) -- [gh-176](https://github.com/flintlib/python-flint/pull/176) - Fix the error messages from `fmpq` constructor. (OB) -- [gh-174](https://github.com/flintlib/python-flint/pull/174) - Add `pow_mod` and `compose_mod` methods to `nmod_poly` and - `fmpz_mod_poly`. Also add some missing methods to `nmod_poly` - that other poly types already have. (GP) -- [gh-172](https://github.com/flintlib/python-flint/pull/172) - Add `fmpz_is_square`. (JR) -- [gh-168](https://github.com/flintlib/python-flint/pull/168) - Make comparisons consistent between different types. Add - `is_one` and `is_zero` for all poly types. (OB) -- [gh-161](https://github.com/flintlib/python-flint/pull/161) - Add `acb.lerch_phi` to compute the Lerch transcendent. (OB) -- [gh-160](https://github.com/flintlib/python-flint/pull/160) - Add `bits` to `arb` and `acb`, add `log_base` to `arb`. (JR) -- [gh-148](https://github.com/flintlib/python-flint/pull/148) - Remove debug symbols to make smaller Linux binaries. (OB) -- [gh-144](https://github.com/flintlib/python-flint/pull/144) - Add `rel_one_accuracy_bits` to `arb` and `acb`. (EC) -- [gh-137](https://github.com/flintlib/python-flint/pull/137) - Add `erfinv` and `erfcinv` for `arb`. (JR) -- [gh-119](https://github.com/flintlib/python-flint/pull/119) - Add compatibility with Flint 3.1. (OB) - -0.6.0 ------ - -- [gh-112](https://github.com/flintlib/python-flint/issues/112), - [gh-111](https://github.com/flintlib/python-flint/issues/111), - [gh-110](https://github.com/flintlib/python-flint/issues/110), - [gh-108](https://github.com/flintlib/python-flint/issues/108): - Add pyproject.toml and build dependencies. This means that - python-flint can be built from source without - `--no-build-isolation`. -- [gh-109](https://github.com/flintlib/python-flint/issues/109): - Use exact division for non-field domains. Now `fmpz(6)/fmpz(3)` - returns an exact result `fmpz(2)` or raises an error if an exact - result is not possible. Similar changes for `fmpz_poly/fmpz`, - `fmpz_mat/fmpz`, and for polynomial division with `fmpz_poly`, - `fmpq_poly`, `nmod_poly` and `fmpz_mod_poly`. -- [gh-106](https://github.com/flintlib/python-flint/issues/106): - Add `fmpz_mod_mat` for matrices of integers mod `n` where `n` is - larger than word sized. -- [gh-104](https://github.com/flintlib/python-flint/issues/104): - Bump Flint from 3.0.0 to 3.0.1 - -0.5.0 ------ - -Important compatibility changes: - -- [gh-80](https://github.com/flintlib/python-flint/issues/80), - [gh-94](https://github.com/flintlib/python-flint/issues/94), - [gh-98](https://github.com/flintlib/python-flint/issues/98): - Switch from Flint 2.9 to Flint 3. -- [gh-100](https://github.com/flintlib/python-flint/issues/100): - Supports Python 3.12 by using setuptools instead of - numpy.distutils. - -New features: - -- [gh-87](https://github.com/flintlib/python-flint/issues/87): - Adds `fmpz_mod_poly` type for polynomials over `fmpz_mod`. -- [gh-85](https://github.com/flintlib/python-flint/issues/85): - Adds discrete logarithms to `fmpz_mod`. -- [gh-83](https://github.com/flintlib/python-flint/issues/83): - Introduces the `fmpz_mod` type for multi-precision integer mods. - -Bug fixes: - -- [gh-93](https://github.com/flintlib/python-flint/issues/93): - Fixes a bug with `pow(int, int, fmpz)` which previously gave - incorrect results. -- [gh-78](https://github.com/flintlib/python-flint/issues/78), - [gh-79](https://github.com/flintlib/python-flint/issues/79): - minor fixes for the `nmod` type. - -0.4.4 ------ - -- [gh-75](https://github.com/flintlib/python-flint/issues/75), - [gh-77](https://github.com/flintlib/python-flint/issues/77): - finish bulk of the work in refactoring `python-flint` into - submodules -- [gh-72](https://github.com/flintlib/python-flint/issues/72): - The roots method of `arb_poly` is not supported. Use either the - `complex_roots` method or `acb_roots(p).roots()` to get the old - behaviour of returning the complex roots. The `roots` method on - `fmpz_poly` and `fmpq_poly` now return integer and rational - roots respectively. To access complex roots on these types, use - the `complex_roots` method. For `acb_poly`, both `roots` and - `complex_roots` behave the same -- [gh-71](https://github.com/flintlib/python-flint/issues/71): - Include files in sdist and fix issue - [gh-70](https://github.com/flintlib/python-flint/issues/70) -- [gh-67](https://github.com/flintlib/python-flint/issues/67): - Continue refactoring job to introduce submodules into `python-flint` - -0.4.3 ------ - -- [gh-63](https://github.com/flintlib/python-flint/issues/63): - The `roots` method of `arb_poly`, and `nmod_poly` is no longer - supported. Use `acb_roots(p).roots()` to get the old behaviour - of returning the roots as `acb`. Note that the `roots` method of - `fmpz_poly` and `fmpq_poly` currently returns the complex roots - of the polynomial. -- [gh-61](https://github.com/flintlib/python-flint/issues/61): - Start refactoring job to introduce submodules into `python-flint` - -0.4.2 ------ - -- [gh-57](https://github.com/flintlib/python-flint/issues/57): - Adds manylinux wheels - -0.4.1 ------ - -- [gh-47](https://github.com/flintlib/python-flint/issues/47): - Removes Linux wheels, updates instructions for building from - source. - -0.4.0 ------ - -- [gh-45](https://github.com/flintlib/python-flint/issues/45): - Adds wheels for Windows, OSX and manylinux but the Linux wheels - are broken. - -License ------------- - -Python-FLINT is licensed MIT. FLINT and Arb are LGPL v2.1+. diff --git a/bin/activate b/bin/activate deleted file mode 100644 index 465c484f..00000000 --- a/bin/activate +++ /dev/null @@ -1,4 +0,0 @@ -export C_INCLUDE_PATH=$(pwd)/.local/include -export LIBRARY_PATH=$(pwd)/.local/lib -export LD_LIBRARY_PATH=$(pwd)/.local/lib -export PKG_CONFIG_PATH=$(pwd)/.local/lib/pkgconfig diff --git a/bin/all_rst_to_pxd.sh b/bin/all_rst_to_pxd.sh deleted file mode 100755 index 091d755e..00000000 --- a/bin/all_rst_to_pxd.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ $# -eq 0 ] - then - echo "Usage: bin/all_rst_to_pxd.sh /path/to/flint/doc/source" - exit 1 -fi - -FLINT_DOC_DIR=$1 - -modules=( - "flint" - "mpoly" - # "thread_pool" - # "machine_vectors" - "gr" - "gr_domains" - "gr_generic" - "gr_implementing" - "gr_mat" - "gr_mpoly" - "gr_poly" - "gr_special" - "gr_vec" - "ulong_extras" - "fmpz" - # "fmpz_extras" - "fmpz_factor" - "fmpz_lll" - "fmpz_mat" - "fmpz_mpoly" - "fmpz_mpoly_factor" - "fmpz_mpoly_q" - "fmpz_poly" - "fmpz_poly_factor" - # "fmpz_poly_mat" - # "fmpz_poly_q" - "fmpz_vec" - # "long_extras" - # "longlong" - # "mpn_extras" - # "aprcl" - "arith" - # "fft" - # "fft_small" - # "qsieve" - "fmpq" - "fmpq_mat" - "fmpq_mpoly" - "fmpq_mpoly_factor" - "fmpq_poly" - "fmpq_vec" - "nmod" - "nmod_mat" - "nmod_mpoly" - "nmod_mpoly_factor" - "nmod_poly" - "nmod_poly_factor" - # "nmod_poly_mat" - "nmod_vec" - # "mpn_mod" - "fmpz_mod" - "fmpz_mod_mat" - "fmpz_mod_mpoly" - "fmpz_mod_mpoly_factor" - "fmpz_mod_poly" - "fmpz_mod_poly_factor" - "fmpz_mod_vec" - "dirichlet" - # "dlog" - # "bool_mat" - # "perm" - # "qfb" - # "nf" - # "nf_elem" - # "fmpzi" - # "qqbar" - "mag" - # "nfloat" - "arf" - # "acf" - "arb" - # "arb_calc" - "arb_fmpz_poly" - # "arb_fpwrap" - "arb_hypgeom" - "arb_mat" - "arb_poly" - "acb" - "acb_calc" - "acb_dft" - "acb_dirichlet" - "acb_elliptic" - "acb_hypgeom" - "acb_mat" - "acb_modular" - "acb_poly" - "acb_theta" - "bernoulli" - # "hypgeom" - "partitions" - # "ca" - # "ca_ext" - # "ca_field" - # "ca_mat" - # "ca_poly" - # "ca_vec" - # "calcium" - # "fexpr" - # "fexpr_builtin" - "fq" - # "fq_embed" - "fq_mat" - "fq_poly" - "fq_poly_factor" - # "fq_vec" - "fq_nmod" - # "fq_nmod_embed" - "fq_nmod_mat" - # "fq_nmod_mpoly" - # "fq_nmod_mpoly_factor" - "fq_nmod_poly" - "fq_nmod_poly_factor" - # "fq_nmod_vec" - "fq_zech" - # "fq_zech_embed" - "fq_zech_mat" - "fq_zech_poly" - "fq_zech_poly_factor" - # "fq_zech_vec" - "fq_default" - "fq_default_mat" - "fq_default_poly" - "fq_default_poly_factor" - # "padic" - # "padic_mat" - # "padic_poly" - # "qadic" - # "double_extras" - # "double_interval" - # "d_mat" - # "d_vec" - # "mpfr_mat" - # "mpfr_vec" -) - -for module in ${modules[@]}; do - echo "Processing $module" - bin/rst_to_pxd.py flint/$module \ - --flint-doc-dir=$FLINT_DOC_DIR \ - > src/flint/flintlib/functions/$module.pxd -done diff --git a/bin/build_dependencies_unix.sh b/bin/build_dependencies_unix.sh deleted file mode 100755 index 6dfdeb12..00000000 --- a/bin/build_dependencies_unix.sh +++ /dev/null @@ -1,395 +0,0 @@ -#!/usr/bin/env bash -# -# Build local installs of python-flint's dependencies. This should be run -# before attempting to build python-flint itself. - -set -o errexit - -# ------------------------------------------------------------------------- # -# # -# Supported options: # -# # -# --gmp gmp - build based on GMP (default) # -# --gmp mpir - build based on MPIR (no longer works) # -# --host - set the host (target) for GMP build # -# --patch-gmp-arm64 - apply patch to GMP for OSX arm64 # -# # -# ------------------------------------------------------------------------- # - -SKIP_GMP=no -SKIP_MPFR=no - -USE_GMP=gmp -PATCH_GMP_ARM64=no -BUILD_ARB=no - -while [[ $# -gt 0 ]] -do - key="$1" - case $key in - -h|--help) - echo "bin/download_dependencies.sh [options]" - echo - echo "Build local installs of python-flint's dependencies." - echo - echo "Supported options:" - echo " --help - show this help message" - echo " --host - set the host (target) for GMP build" - echo " --skip-gmp - skip building GMP" - echo " --skip-mpfr - skip building MPFR" - echo - echo "Legacy options:" - echo " --gmp gmp - build based on GMP (default)" - echo " --gmp mpir - build based on MPIR (no longer works)" - echo " --patch-gmp-arm64 - apply patch to GMP 6.2.1 for OSX arm64" - echo " --patch-C23 - apply patch to GMP 6.3.0 for C23 compatibility" - echo " --arb - build Arb (only needed for flint < 3.0.0)" - echo - exit - ;; - --host) - # e.g. --host x86_64-unknown-linux-gnu - # or --host x86_64-apple-darwin - HOST_ARG="$2" - shift - shift - ;; - --gmp) - # e.g. --gmp gmp or --gmp mpir - # The mpir build no longer works because the download fails. - USE_GMP="$2" - if [[ "$USE_GMP" != "gmp" && "$USE_GMP" != "mpir" ]]; then - echo "--gmp option should be gmp or mpir" - exit 1 - fi - shift - shift - ;; - --arb) - # With flint >= 3.0.0 Arb is included so we do not need to build it - # separately. Pass --arb if building for older versions of flint. - BUILD_ARB=yes - shift - ;; - --skip-gmp) - # If you already have a local install of GMP you can pass --skip-gmp - # to skip building it. - SKIP_GMP=yes - shift - ;; - --skip-mpfr) - # If you already have a local install of MPFR you can pass --skip-mpfr - # to skip building it. - SKIP_MPFR=yes - shift - ;; - --patch-gmp-arm64) - # Needed only for GMP 6.2.1 on OSX arm64 (Apple M1) hardware - # As of GMP 6.3.0 this patch is no longer needed - PATCH_GMP_ARM64=yes - shift - ;; - --patch-C23) - # Patch GMP 6.3.0 for newer gcc versions - PATCH_GMP_C23=yes - shift - ;; - --use-gmp-github-mirror) - USE_GMP_GITHUB_MIRROR=yes - shift - ;; - *) - 2>&1 echo "unrecognised argument:" $key - exit 1 - ;; - esac -done - -# ------------------------------------------------------------------------- # -# # -# The build_variables.sh script sets variables specifying the versions to # -# use for all dependencies and also the PREFIX variable. # -# # -# ------------------------------------------------------------------------- # - -source bin/build_variables.sh - -cd $PREFIX -mkdir -p src -cd src - -# ------------------------------------------------------------------------- # -# # -# Now build all dependencies. # -# # -# ------------------------------------------------------------------------- # - -if [ $USE_GMP = "gmp" ]; then - - # ----------------------------------------------------------------------- # - # # - # GMP # - # # - # ----------------------------------------------------------------------- # - - if [ $SKIP_GMP = "yes" ]; then - echo - echo -------------------------------------------- - echo " skipping GMP" - echo -------------------------------------------- - echo - else - echo - echo -------------------------------------------- - echo " building GMP" - echo -------------------------------------------- - echo - - if [ $USE_GMP_GITHUB_MIRROR = "yes" ]; then - # Needed in GitHub Actions because it is blocked from gmplib.org - git clone https://github.com/oscarbenjamin/gmp_mirror.git - cp gmp_mirror/gmp-$GMPVER.tar.xz . - else - curl -O https://gmplib.org/download/gmp/gmp-$GMPVER.tar.xz - fi - - tar xf gmp-$GMPVER.tar.xz - cd gmp-$GMPVER - - # - # See https://github.com/aleaxit/gmpy/issues/350 - # - # We need to patch GMP for OSX arm64 (Apple M1) hardware. This patch is - # from the GMP repo but was applied after the release of GMP 6.2.1. - # This patch is no longer needed for GMP 6.3.0. - # - if [ $PATCH_GMP_ARM64 = "yes" ]; then - echo - echo -------------------------------------------- - echo " patching GMP" - echo -------------------------------------------- - patch -N -Z -p0 < ../../../bin/patch-arm64.diff - fi - # - # https://github.com/msys2/MSYS2-packages/issues/5499 - # - # This patch needed for GMP 6.3.0 building with msys2 or probably just - # newer gcc versions. - # - if [ $PATCH_GMP_C23 = "yes" ]; then - echo - echo -------------------------------------------- - echo " patching GMP" - echo -------------------------------------------- - patch -N -Z < ../../../bin/patch-C23.diff - autoreconf -fi - fi - - # Show the output of configfsf.guess - chmod +x configfsf.guess - ./configfsf.guess - - ./configure --prefix=$PREFIX\ - --enable-fat\ - --enable-shared=yes\ - --enable-static=no\ - --host=$HOST_ARG - make -j6 - make install - - cd .. - - fi - - FLINTARB_WITHGMP="--with-gmp=$PREFIX" - -else - - # ----------------------------------------------------------------------- # - # # - # YASM (needed to build MPIR) # - # # - # ----------------------------------------------------------------------- # - - curl -O http://www.tortall.net/projects/yasm/releases/yasm-$YASMVER.tar.gz - tar xf yasm-$YASMVER.tar.gz - cd yasm-$YASMVER - ./configure --prefix=$PREFIX - make -j6 - make install - cd .. - - # ----------------------------------------------------------------------- # - # # - # MPIR # - # # - # ----------------------------------------------------------------------- # - - # - # The mpir.org domain has expired and no longer hosts the source code so the - # call to curl below will fail. - # We could try to download from https://github.com/wbhart/mpir/releases. - # - # Ultimately it seems that MPIR is no longer maintained though so for now - # this remains unfixed. - # - - >&2 echo "MPIR build of python_flint is no longer supported" - exit 1 - - curl -O http://mpir.org/mpir-$MPIRVER.tar.bz2 - tar xf mpir-$MPIRVER.tar.bz2 - cd mpir-$MPIRVER - ./configure --prefix=$PREFIX\ - --with-yasm=$PREFIX/bin/yasm\ - --enable-fat\ - --enable-shared=yes\ - --enable-static=no\ - --enable-gmpcompat - make -j6 - make install - cd .. - - FLINTARB_WITHGMP="--with-mpir=$PREFIX" - -fi - -# ------------------------------------------------------------------------- # -# # -# MPFR # -# # -# ------------------------------------------------------------------------- # - -if [ $SKIP_MPFR = "yes" ]; then - echo - echo -------------------------------------------- - echo " skipping MPFR" - echo -------------------------------------------- - echo -else - echo - echo -------------------------------------------- - echo " building MPFR" - echo -------------------------------------------- - echo - - if [ $USE_GMP_GITHUB_MIRROR = "yes" ]; then - if [ ! -d "gmp_mirror" ] ; then - git clone https://github.com/oscarbenjamin/gmp_mirror.git - fi - cp gmp_mirror/mpfr-$MPFRVER.tar.gz . - else - curl -O https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFRVER.tar.gz - fi - - tar xf mpfr-$MPFRVER.tar.gz - cd mpfr-$MPFRVER - ./configure --prefix=$PREFIX\ - --host=$HOST_ARG\ - --with-gmp=$PREFIX\ - --enable-shared=yes\ - --enable-static=no - make -j6 - make install - cd .. -fi - -# ------------------------------------------------------------------------- # -# # -# FLINT # -# # -# ------------------------------------------------------------------------- # - -echo -echo -------------------------------------------- -echo " building Flint" -echo -------------------------------------------- -echo - -curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz -tar xf flint-$FLINTVER.tar.gz -cd flint-$FLINTVER - ./bootstrap.sh - ./configure --prefix=$PREFIX\ - --host=$HOST_ARG\ - $FLINTARB_WITHGMP\ - --with-mpfr=$PREFIX\ - --disable-static\ - --disable-debug - make -j6 - make install -cd .. - -# ------------------------------------------------------------------------- # -# # -# ARB # -# # -# ------------------------------------------------------------------------- # - -if [ $BUILD_ARB = "yes" ]; then - - echo - echo -------------------------------------------- - echo " building Arb" - echo -------------------------------------------- - echo - - curl -O -L https://github.com/fredrik-johansson/arb/archive/refs/tags/$ARBVER.tar.gz - mv $ARBVER.tar.gz arb-$ARBVER.tar.gz - tar xf arb-$ARBVER.tar.gz - cd arb-$ARBVER - ./configure --prefix=$PREFIX\ - --with-flint=$PREFIX\ - $FLINTARB_WITHGMP\ - --with-mpfr=$PREFIX\ - --disable-static - make -j6 - make install - # - # Set PATH so that DLLs are picked up on Windows. - # - PATH=$PATH:$PREFIX/lib:$PREFIX/bin \ - ARB_TEST_MULTIPLIER=0.1 \ - # Skip Arb tests now because they are slow. - # make check - cd .. -fi - -# ------------------------------------------------------------------------- # -# # -# Done! # -# # -# ------------------------------------------------------------------------- # - -echo -echo ----------------------------------------------------------------------- -echo -echo Build dependencies for python-flint compiled as shared libraries in: -echo $PREFIX -echo -echo Versions: - -if [ $SKIP_GMP = "yes" ]; then - echo GMP: skipped -else - if [[ $USE_GMP = "gmp" ]]; then - echo GMP: $GMPVER - else - echo MPIR: $MPIRVER - fi -fi - -if [ $SKIP_MPFR = "yes" ]; then - echo MPFR: skipped -else - echo MPFR: $MPFRVER -fi - -echo Flint: $FLINTVER - -if [ $BUILD_ARB = "yes" ]; then - echo Arb: $ARBVER -fi -echo -echo ----------------------------------------------------------------------- -echo diff --git a/bin/build_inplace.sh b/bin/build_inplace.sh deleted file mode 100755 index bd208f19..00000000 --- a/bin/build_inplace.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -# -# Build the flint._flint module in place. - -C_INCLUDE_PATH=.local/include/ LIBRARY_PATH=.local/lib/ python setup.py build_ext --inplace diff --git a/bin/build_variables.sh b/bin/build_variables.sh deleted file mode 100644 index bbed2572..00000000 --- a/bin/build_variables.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# -# Create a local directory .local to be used as --prefix when building -# local installs of python-flint's dependencies. This also sets the PREFIX -# shell variable and environment variables giving the versions to use for each -# dependency. This script should be sourced rather than executed e.g.: -# -# $ source bin/build_variables.sh -# -# This is used implicitly by the other build scripts and does not need to be -# executed directly. - -PREFIX=$(pwd)/.local -mkdir -p $PREFIX - -ARBVER=2.23.0 # Not needed with flint >= 3.0.0 (Arb is included in flint) - -YASMVER=1.3.0 # Only needed for MPIR -MPIRVER=3.0.0 # MPIR build no longer works (not clear where to download from) - -# These are the actual dependencies used (at least by default): -GMPVER=6.3.0 -MPFRVER=4.2.2 -FLINTVER='3.3.1' diff --git a/bin/build_wheel.sh b/bin/build_wheel.sh deleted file mode 100755 index e881dda6..00000000 --- a/bin/build_wheel.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# -# Compile a python-flint wheel using the dependencies built by -# build_dependencies_unix.sh (which should be run first). - -set -o errexit - -source bin/build_variables.sh - -python3 -m venv $PREFIX/venv -source $PREFIX/venv/bin/activate -pip install -U pip -pip install numpy cython wheel - -C_INCLUDE_PATH=.local/include/ LIBRARY_PATH=.local/lib/ pip wheel . diff --git a/bin/bump_version.py b/bin/bump_version.py deleted file mode 100755 index 5d467083..00000000 --- a/bin/bump_version.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python - -filenames_default = [ - "pyproject.toml", - "src/flint/__init__.py", - "doc/source/conf.py", - "src/flint/test/test_all.py", -] - - -def main(version2=None, *filenames): - """Bump version number in files. - - $ bin/bump_version.py - Current version: 0.1.0 - - $ bin/bump_version.py 0.1.0 0.1.1 - Set version 0.1.0 to 0.1.1 in: - pyproject.toml - src/flint/__init__.py - doc/source/conf.py - src/flint/test/test_all.py - - """ - with open("pyproject.toml", "r") as f: - text = f.read() - version1 = text.split("version = \"")[1].split("\"")[0] - - if not version2: - print(f"Current version: {version1}") - return - - if not filenames: - filenames = filenames_default - - print(f"Set version {version1} to {version2} in:") - for filename in filenames: - print(filename) - with open(filename, "r") as f: - text = f.read() - with open(filename, "w") as f: - f.write(text.replace(version1, version2)) - - -if __name__ == "__main__": - import sys - main(*sys.argv[1:]) diff --git a/bin/cibw.bat b/bin/cibw.bat deleted file mode 100644 index 8f62e8e9..00000000 --- a/bin/cibw.bat +++ /dev/null @@ -1,27 +0,0 @@ -rem -rem This bat file can be used to test cibuildwheel locally on Windows. The -rem cibw_*_windows.sh files have lines to set the PATH for working locally but -rem those are commented out because they are not needed in CI. To use this -rem script -rem -rem 1. Uncomment those lines -rem 2. > pip install cibuildwheel -rem 3. > bin\cibw.bat -rem -rem The variables defined below should match those that are set in CI except -rem that C:\msys64\usr\bin\bash should just be msys2 -c in CI. -rem -rem It is also worth commenting out the line to build GMP etc after you have -rem built those once because that is by far the slowest step. -rem - -rem -rem If this script is run repeatedly then it would fail because of any leftover -rem wheels from a previous run so we delete them here. -rem -del /q wheelhouse\* - -rem override setting in pyproject.toml -set CIBW_BUILD=cp39-* cp310-* cp311-* - -cibuildwheel --platform windows diff --git a/bin/cibw_before_all_linux_aarch64.sh b/bin/cibw_before_all_linux_aarch64.sh deleted file mode 100755 index 3538bef5..00000000 --- a/bin/cibw_before_all_linux_aarch64.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -e - -yum install -y xz -bin/build_dependencies_unix.sh\ - --gmp gmp\ - --host aarch64-pc-linux-gnu\ - --use-gmp-github-mirror diff --git a/bin/cibw_before_all_linux_x86_64.sh b/bin/cibw_before_all_linux_x86_64.sh deleted file mode 100755 index 36d5f844..00000000 --- a/bin/cibw_before_all_linux_x86_64.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -e - -yum install -y xz -bin/build_dependencies_unix.sh\ - --gmp gmp\ - --host x86_64-pc-linux-gnu\ - --use-gmp-github-mirror diff --git a/bin/cibw_before_all_macosx_arm64.sh b/bin/cibw_before_all_macosx_arm64.sh deleted file mode 100755 index 3f98f67a..00000000 --- a/bin/cibw_before_all_macosx_arm64.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e - -export CPPFLAGS=" --target=arm64-apple-macos11" -export LDFLAGS=" -arch arm64" - -brew install automake libtool - -bin/build_dependencies_unix.sh\ - --gmp gmp\ - --host aarch64-apple-darwin\ - --use-gmp-github-mirror diff --git a/bin/cibw_before_all_macosx_x86_64.sh b/bin/cibw_before_all_macosx_x86_64.sh deleted file mode 100755 index 15810857..00000000 --- a/bin/cibw_before_all_macosx_x86_64.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -e - -brew install automake libtool - -bin/build_dependencies_unix.sh\ - --gmp gmp\ - --host x86_64-apple-darwin\ - --use-gmp-github-mirror diff --git a/bin/cibw_before_all_windows.sh b/bin/cibw_before_all_windows.sh deleted file mode 100755 index a7a359e5..00000000 --- a/bin/cibw_before_all_windows.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -o errexit - -pacman -S --noconfirm \ - mingw-w64-x86_64-gcc\ - mingw-w64-x86_64-tools-git\ - m4\ - make\ - base-devel\ - autoconf-wrapper\ - automake-wrapper\ - libtool\ - git\ - # - -bin/build_dependencies_unix.sh \ - --use-gmp-github-mirror\ - --patch-C23\ - # diff --git a/bin/cibw_repair_wheel_licenses.py b/bin/cibw_repair_wheel_licenses.py deleted file mode 100755 index de958ea8..00000000 --- a/bin/cibw_repair_wheel_licenses.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python -""" -Update license information in wheels after running auditwheel etc. - -Usage: - cibw_repair_wheel_licenses.py \ - --license MIT \ - --license-file ./licenses/license_foo_MIT.txt:foo/LICENSE.txt \ - --license-file ./licenses/license_bar_MIT.txt:bar/LICENSE.txt \ - ... - -The wheel_file argument should be the path to the wheel file to be repaired. -It will be overwritten in place. - -The --license and --license-file arguments are multi-use. The --license -argument should be a SPDX license expression. It will be combined with the -existing License-Expression field in the wheel's METADATA file. - -The --license-file argument should be a pair of :-separated paths. The first -path is the path to the license file and the second is the relative path to -put the license file under the wheel's .dist-info/licenses directory. The first -path can be a glob pattern. The second path can also be a glob pattern in which -case the * is replaced in the same way. This makes it possible to do - - --license-file ./src/foo-*/LICENSE:libs/foo-*/LICENSE - -which would find the LICENSE file src/foo-1.0/LICENSE and copy it to the -matched .dist-info/licenses/libs/foo-1.0/LICENSE path in the wheel. - -PEP 639 says: - -Inside the root license directory, packaging tools MUST reproduce the -directory structure under which the source license files are located -relative to the project root. - -It is not clear what that means though if the licenses are coming from code -that is not vendored in the repo/sdist. If they are vendored then presumably -the argument here should be like: - - --license-file ./vendored-foo/LICENSE:vendored-foo/LICENSE - -""" -import argparse -from pathlib import Path -from subprocess import run -from tempfile import TemporaryDirectory -from shutil import copyfile -from os import makedirs - - -def main(*args: str): - parser = argparse.ArgumentParser() - parser.add_argument("wheel_file") - parser.add_argument("--license", action="append", default=[]) - parser.add_argument("--license-file", action="append", default=[]) - - parsed = parser.parse_args(args) - wheel_file = Path(parsed.wheel_file) - licenses = parsed.license - license_files = dict(arg_to_paths(f) for f in parsed.license_file) - - update_licenses_wheel(wheel_file, licenses, license_files) - - -def arg_to_paths(license_file_arg: str) -> tuple[Path, Path]: - """ - Convert a --license-file argument to a pair of Paths. - """ - paths = license_file_arg.strip().split(":") - if len(paths) != 2: - raise ValueError("license-file argument must be in the form of :" - f" but got {license_file_arg}") - glob1_str, glob2_str = paths - paths1 = list(Path().glob(glob1_str)) - if len(paths1) != 1: - raise ValueError(f"Expected one path from glob pattern {glob1_str}" - f" but got {paths1}") - [path1] = paths1 - - if '*' not in glob2_str: - path2_str = glob2_str - else: - # Replace * in glob2_str with the part of path1 that matches glob1_str: - index1 = glob1_str.index('*') - part1_glob = glob1_str[:index1] - part2_glob = glob1_str[index1+1:] - path1_str = str(path1).replace('\\', '/') - if len(part2_glob) != 0: - wildcard = path1_str[len(part1_glob):-len(part2_glob)] - else: - wildcard = path1_str[len(part1_glob):] - assert path1_str.startswith(part1_glob), ( - f"{path1_str} does not start with {part1_glob}" - ) - assert path1_str.endswith(part2_glob), ( - f"{path1_str} does not end with {part2_glob}" - ) - assert path1_str == part1_glob + wildcard + part2_glob, ( - f"{path1_str} != {part1_glob} + {wildcard} + {part2_glob}" - ) - path2_str = glob2_str.replace('*', wildcard) - - return path1, Path(path2_str) - - -def update_licenses_wheel( - wheel_file: Path, licenses: list[str], license_files: dict[Path, Path] -): - if wheel_file.exists(): - print("Found wheel at", wheel_file) - else: - raise ValueError(f"Wheel not found at {wheel_file}") - - for license_file in license_files: - if license_file.is_absolute(): - raise ValueError("license-file paths must be relative to project root") - elif not license_file.exists(): - raise ValueError(f"license-file not found: {license_file}") - - # foo/bar-1.0-cp310-cp310-linux_x86_64.whl -> bar-1.0 - name, version = wheel_file.stem.split('-')[:2] - base = f"{name}-{version}" - - with TemporaryDirectory() as tmpdir: - - print("temp dir:", tmpdir) - tmpdir = Path(tmpdir) - - run(["wheel", "unpack", "--dest", tmpdir, wheel_file], check=True) - - dist_info = tmpdir / base / f"{base}.dist-info" - - print(f"Adding licenses in {dist_info}") - update_license_dist_info(dist_info, licenses, license_files) - - run(["wheel", "pack", "--dest-dir", tmpdir, tmpdir / base], check=True) - - # glob for *.whl in tmpdir - wheels = list(tmpdir.glob(f"{base}-*.whl")) - if len(wheels) != 1: - raise ValueError(f"Expected one wheel in {tmpdir}, got {wheels}") - new_wheel_file = wheels[0] - - print(f"Repaired wheel: {new_wheel_file}") - print(f"Copying back to: {wheel_file}") - copyfile(new_wheel_file, wheel_file) - - -def update_license_dist_info( - dist_info: Path, licenses: list[str], license_files: dict[Path, Path] -): - for src, dst in license_files.items(): - wheel_license_path = dist_info / "licenses" / dst - if wheel_license_path.exists(): - raise ValueError(f"license file already present: {wheel_license_path}") - # - # PEP 639 says: - # - # Inside the root license directory, packaging tools MUST reproduce the - # directory structure under which the source license files are located - # relative to the project root. - # - makedirs(wheel_license_path.parent, exist_ok=True) - copyfile(src, wheel_license_path) - print(f"Copied license file {src} to {wheel_license_path}") - - metadata_file = dist_info / "METADATA" - - with open(metadata_file, "r") as f: - lines = f.readlines() - - def brackets(s: str) -> str: - if ' ' not in s: - return s - else: - return f"({s})" - - for n, line in enumerate(lines): - if line.startswith("License-Expression: "): - base_license = line[len("License-Expression: ") :].strip() - all_licenses = [base_license, *licenses] - expression = ' AND '.join([brackets(license) for license in all_licenses]) - lines[n] = f"License-Expression: {expression}\n" - break - else: - raise ValueError("Could not find License-Expression in METADATA") - - print("Updated License-Expression from") - print(" " + base_license) - print("to") - print(" " + expression) - - license_files_lines = [line for line in lines if line.startswith("License-File: ")] - - if not license_files_lines: - raise ValueError("Could not find License-File in METADATA") - - index = lines.index(license_files_lines[-1]) + 1 - new_lines = [f"License-File: {f}\n" for f in license_files.values()] - lines = lines[:index] + new_lines + lines[index:] - - print("Writing out METADATA with updated License-Expression and License-File fields") - print("Writing to:", metadata_file) - - with open(metadata_file, "w") as f: - f.writelines(lines) - - -if __name__ == "__main__": - import sys - sys.exit(main(*sys.argv[1:])) diff --git a/bin/coverage.sh b/bin/coverage.sh deleted file mode 100755 index 96058172..00000000 --- a/bin/coverage.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Arguments to this script are passed to python -m flint.test e.g. to skip -# doctests and run in quiet mode: -# -# bin/coverage.sh -qt -# -set -o errexit - -RC="--rcfile=.coveragerc.meson" - -# See https://github.com/cython/cython/issues/6658 -# Needed for Python 3.13 only but the plugin does not work with 3.13 anyway... -#pip uninstall -y cython -#pip install git+https://github.com/cython/cython.git@fdbca99 - -pip uninstall -y cython -pip install --pre cython # unpinned to pick up new releases in CI -# pip install cython==3.1.0a1 # known working version for Python < 3.13 - -meson setup build -Dcoverage=true -Dflint_version_check=false -spin run -- coverage run $RC -m flint.test $@ -coverage report $RC -m --sort=cover -coverage html $RC diff --git a/bin/coverage_setuptools.sh b/bin/coverage_setuptools.sh deleted file mode 100755 index dd0cd786..00000000 --- a/bin/coverage_setuptools.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e - -RC="--rcfile=.coveragerc.setuptools" - -# Comment out various lines below for speed if running multiple times. - -# See https://github.com/cython/cython/issues/6658 -# Needed for Python 3.13 only -pip uninstall -y cython -pip install git+https://github.com/cython/cython.git@fdbca99 -pip install setuptools - -touch src/*/*/*.pyx -PYTHON_FLINT_COVERAGE=1 python setup.py build_ext --inplace -PYTHONPATH=src coverage run $RC -m flint.test -coverage report $RC -m --sort=cover -coverage html $RC diff --git a/bin/install_flint_ubuntu.sh b/bin/install_flint_ubuntu.sh deleted file mode 100755 index e06b0d8c..00000000 --- a/bin/install_flint_ubuntu.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -set -o errexit - -# -# This script should work to build and install Flint from git on Ubuntu -# -# $ git clone https://github.com/flintlib/python-flint.git -# $ cd python-flint -# $ bin/install_flint_ubuntu.sh v3.1.0 -# -# The version is a tag or branch in the Flint repository. -# -# Then to install an sdist from PyPI, use -# -# $ pip install python-flint -# -# To install python-flint from the git checkout -# -# $ pip install . -# - -echo "Building from git: $1" -GIT_REF=$1 - -# Install runtime and build dependencies - -# First install their dependencies and build dependencies -sudo apt-get update -sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build - -# -# This will default to installing in /usr/local. If you want to install in a -# non-standard location then configure flint with -# ./configure --disable-static --prefix=$PREFIX -# If $PREFIX is not in default search paths, then at build time set -# export C_INCLUDE_PATH=$PREFIX/include -# and at runtime set -# export LD_LIBRARY_PATH=$PREFIX/lib -# -echo "Installing Flint from git: $GIT_REF" -git clone https://github.com/flintlib/flint.git -cd flint - git checkout $GIT_REF - ./bootstrap.sh - ./configure --disable-static - make -j - sudo make install -cd .. - -ls -l /usr/local/lib -sudo ldconfig /usr/local/lib diff --git a/bin/install_latest_flint_ubuntu.sh b/bin/install_latest_flint_ubuntu.sh deleted file mode 100755 index 0006b792..00000000 --- a/bin/install_latest_flint_ubuntu.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source bin/build_variables.sh - -sudo apt-get update -sudo apt-get install libgmp-dev libmpfr-dev xz-utils ninja-build - -curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz -tar -xzf flint-$FLINTVER.tar.gz -cd flint-$FLINTVER && ./configure --disable-static && make -j$(expr $(nproc) + 1) && sudo make install - -ls -l /usr/local/lib -sudo ldconfig /usr/local/lib diff --git a/bin/patch-C23.diff b/bin/patch-C23.diff deleted file mode 100644 index 5f1c0214..00000000 --- a/bin/patch-C23.diff +++ /dev/null @@ -1,21 +0,0 @@ -# HG changeset patch -# User Marc Glisse -# Date 1738186682 -3600 -# Node ID 8e7bb4ae7a18b1405ea7f9cbcda450b7d920a901 -# Parent e84c5c785bbe8ed8c3620194e50b65adfc2f5d83 -Complete function prototype in acinclude.m4 for C23 compatibility - -diff -r e84c5c785bbe -r 8e7bb4ae7a18 acinclude.m4 ---- a/acinclude.m4 Wed Dec 04 18:26:27 2024 +0100 -+++ b/acinclude.m4 Wed Jan 29 22:38:02 2025 +0100 -@@ -609,7 +609,7 @@ - - #if defined (__GNUC__) && ! defined (__cplusplus) - typedef unsigned long long t1;typedef t1*t2; --void g(){} -+void g(int,t1 const*,t1,t2,t1 const*,int){} - void h(){} - static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) - {t1 c,x,r;int i;if(v0){c=1;for(i=1;i -# Date 1606685500 -3600 -# Node ID 5f32dbc41afc1f8cd77af1614f0caeb24deb7d7b -# Parent 94c84d919f83ba963ed1809f8e80c7bef32db55c -Avoid the x18 register since it is reserved on Darwin. - -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/aors_n.asm ---- mpn/arm64/aors_n.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/aors_n.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -68,7 +68,7 @@ - EPILOGUE() - PROLOGUE(func_n) - CLRCY --L(ent): lsr x18, n, #2 -+L(ent): lsr x17, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x7, [up] -@@ -77,7 +77,7 @@ - str x13, [rp],#8 - tbnz n, #1, L(b11) - --L(b01): cbz x18, L(ret) -+L(b01): cbz x17, L(ret) - ldp x4, x5, [up,#8] - ldp x8, x9, [vp,#8] - sub up, up, #8 -@@ -88,7 +88,7 @@ - ldp x10, x11, [vp,#8] - add up, up, #8 - add vp, vp, #8 -- cbz x18, L(end) -+ cbz x17, L(end) - b L(top) - - L(bx0): tbnz n, #1, L(b10) -@@ -101,7 +101,7 @@ - - L(b10): ldp x6, x7, [up] - ldp x10, x11, [vp] -- cbz x18, L(end) -+ cbz x17, L(end) - - ALIGN(16) - L(top): ldp x4, x5, [up,#16] -@@ -114,8 +114,8 @@ - ADDSUBC x12, x4, x8 - ADDSUBC x13, x5, x9 - stp x12, x13, [rp],#16 -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x17, x17, #1 -+ cbnz x17, L(top) - - L(end): ADDSUBC x12, x6, x10 - ADDSUBC x13, x7, x11 -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/aorsmul_1.asm ---- mpn/arm64/aorsmul_1.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/aorsmul_1.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -32,10 +32,15 @@ - - include(`../config.m4') - --C cycles/limb --C Cortex-A53 9.3-9.8 --C Cortex-A57 7.0 --C X-Gene 5.0 -+C addmul_1 submul_1 -+C cycles/limb cycles/limb -+C Cortex-A53 9.3-9.8 9.3-9.8 -+C Cortex-A55 9.0-9.5 9.3-9.8 -+C Cortex-A57 7 7 -+C Cortex-A72 -+C Cortex-A73 6 6 -+C X-Gene 5 5 -+C Apple M1 1.75 1.75 - - C NOTES - C * It is possible to keep the carry chain alive between the addition blocks -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/aorsorrlshC_n.asm ---- mpn/arm64/aorsorrlshC_n.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/aorsorrlshC_n.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -65,14 +65,14 @@ - - ASM_START() - PROLOGUE(func_n) -- lsr x18, n, #2 -+ lsr x6, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x5, [up] - tbnz n, #1, L(b11) - - L(b01): ldr x11, [vp] -- cbz x18, L(1) -+ cbz x6, L(1) - ldp x8, x9, [vp,#8] - lsl x13, x11, #LSH - ADDSUB( x15, x13, x5) -@@ -94,7 +94,7 @@ - ADDSUB( x17, x13, x5) - str x17, [rp],#8 - sub up, up, #8 -- cbz x18, L(end) -+ cbz x6, L(end) - b L(top) - - L(bx0): tbnz n, #1, L(b10) -@@ -107,7 +107,7 @@ - L(b10): CLRRCY( x9) - ldp x10, x11, [vp] - sub up, up, #16 -- cbz x18, L(end) -+ cbz x6, L(end) - - ALIGN(16) - L(top): ldp x4, x5, [up,#16] -@@ -124,8 +124,8 @@ - ADDSUBC(x16, x12, x4) - ADDSUBC(x17, x13, x5) - stp x16, x17, [rp],#16 -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x6, x6, #1 -+ cbnz x6, L(top) - - L(end): ldp x4, x5, [up,#16] - extr x12, x10, x9, #RSH -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/cnd_aors_n.asm ---- mpn/arm64/cnd_aors_n.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/cnd_aors_n.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -65,7 +65,7 @@ - - CLRCY - -- lsr x18, n, #2 -+ lsr x17, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x13, [vp] -@@ -75,7 +75,7 @@ - str x9, [rp] - tbnz n, #1, L(b11) - --L(b01): cbz x18, L(rt) -+L(b01): cbz x17, L(rt) - ldp x12, x13, [vp,#8] - ldp x10, x11, [up,#8] - sub up, up, #8 -@@ -86,7 +86,7 @@ - L(b11): ldp x12, x13, [vp,#8]! - ldp x10, x11, [up,#8]! - sub rp, rp, #8 -- cbz x18, L(end) -+ cbz x17, L(end) - b L(top) - - L(bx0): ldp x12, x13, [vp] -@@ -99,7 +99,7 @@ - b L(mid) - - L(b10): sub rp, rp, #16 -- cbz x18, L(end) -+ cbz x17, L(end) - - ALIGN(16) - L(top): bic x6, x12, cnd -@@ -116,8 +116,8 @@ - ADDSUBC x9, x11, x7 - ldp x10, x11, [up,#32]! - stp x8, x9, [rp,#32]! -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x17, x17, #1 -+ cbnz x17, L(top) - - L(end): bic x6, x12, cnd - bic x7, x13, cnd -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/logops_n.asm ---- mpn/arm64/logops_n.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/logops_n.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -78,7 +78,7 @@ - - ASM_START() - PROLOGUE(func) -- lsr x18, n, #2 -+ lsr x17, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x7, [up] -@@ -88,7 +88,7 @@ - str x15, [rp],#8 - tbnz n, #1, L(b11) - --L(b01): cbz x18, L(ret) -+L(b01): cbz x17, L(ret) - ldp x4, x5, [up,#8] - ldp x8, x9, [vp,#8] - sub up, up, #8 -@@ -99,7 +99,7 @@ - ldp x10, x11, [vp,#8] - add up, up, #8 - add vp, vp, #8 -- cbz x18, L(end) -+ cbz x17, L(end) - b L(top) - - L(bx0): tbnz n, #1, L(b10) -@@ -110,7 +110,7 @@ - - L(b10): ldp x6, x7, [up] - ldp x10, x11, [vp] -- cbz x18, L(end) -+ cbz x17, L(end) - - ALIGN(16) - L(top): ldp x4, x5, [up,#16] -@@ -127,8 +127,8 @@ - POSTOP( x12) - POSTOP( x13) - stp x12, x13, [rp],#16 -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x17, x17, #1 -+ cbnz x17, L(top) - - L(end): LOGOP( x12, x6, x10) - LOGOP( x13, x7, x11) -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/lshift.asm ---- mpn/arm64/lshift.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/lshift.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -61,7 +61,7 @@ - add rp, rp_arg, n, lsl #3 - add up, up, n, lsl #3 - sub tnc, xzr, cnt -- lsr x18, n, #2 -+ lsr x17, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x4, [up,#-8] -@@ -69,7 +69,7 @@ - - L(b01): NSHIFT x0, x4, tnc - PSHIFT x2, x4, cnt -- cbnz x18, L(gt1) -+ cbnz x17, L(gt1) - str x2, [rp,#-8] - ret - L(gt1): ldp x4, x5, [up,#-24] -@@ -89,7 +89,7 @@ - PSHIFT x13, x5, cnt - NSHIFT x10, x4, tnc - PSHIFT x2, x4, cnt -- cbnz x18, L(gt2) -+ cbnz x17, L(gt2) - orr x10, x10, x13 - stp x2, x10, [rp,#-16] - ret -@@ -123,11 +123,11 @@ - orr x11, x12, x2 - stp x10, x11, [rp,#-32]! - PSHIFT x2, x4, cnt --L(lo0): sub x18, x18, #1 -+L(lo0): sub x17, x17, #1 - L(lo3): NSHIFT x10, x6, tnc - PSHIFT x13, x7, cnt - NSHIFT x12, x7, tnc -- cbnz x18, L(top) -+ cbnz x17, L(top) - - L(end): orr x10, x10, x13 - orr x11, x12, x2 -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/lshiftc.asm ---- mpn/arm64/lshiftc.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/lshiftc.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -61,7 +61,7 @@ - add rp, rp_arg, n, lsl #3 - add up, up, n, lsl #3 - sub tnc, xzr, cnt -- lsr x18, n, #2 -+ lsr x17, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x4, [up,#-8] -@@ -69,7 +69,7 @@ - - L(b01): NSHIFT x0, x4, tnc - PSHIFT x2, x4, cnt -- cbnz x18, L(gt1) -+ cbnz x17, L(gt1) - mvn x2, x2 - str x2, [rp,#-8] - ret -@@ -90,7 +90,7 @@ - PSHIFT x13, x5, cnt - NSHIFT x10, x4, tnc - PSHIFT x2, x4, cnt -- cbnz x18, L(gt2) -+ cbnz x17, L(gt2) - eon x10, x10, x13 - mvn x2, x2 - stp x2, x10, [rp,#-16] -@@ -125,11 +125,11 @@ - eon x11, x12, x2 - stp x10, x11, [rp,#-32]! - PSHIFT x2, x4, cnt --L(lo0): sub x18, x18, #1 -+L(lo0): sub x17, x17, #1 - L(lo3): NSHIFT x10, x6, tnc - PSHIFT x13, x7, cnt - NSHIFT x12, x7, tnc -- cbnz x18, L(top) -+ cbnz x17, L(top) - - L(end): eon x10, x10, x13 - eon x11, x12, x2 -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/mul_1.asm ---- mpn/arm64/mul_1.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/mul_1.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -56,7 +56,7 @@ - - PROLOGUE(mpn_mul_1) - adds x4, xzr, xzr C clear register and cy flag --L(com): lsr x18, n, #2 -+L(com): lsr x17, n, #2 - tbnz n, #0, L(bx1) - - L(bx0): mov x11, x4 -@@ -65,7 +65,7 @@ - L(b10): ldp x4, x5, [up] - mul x8, x4, v0 - umulh x10, x4, v0 -- cbz x18, L(2) -+ cbz x17, L(2) - ldp x6, x7, [up,#16]! - mul x9, x5, v0 - b L(mid)-8 -@@ -80,7 +80,7 @@ - str x9, [rp],#8 - tbnz n, #1, L(b10) - --L(b01): cbz x18, L(1) -+L(b01): cbz x17, L(1) - - L(b00): ldp x6, x7, [up] - mul x8, x6, v0 -@@ -90,8 +90,8 @@ - adcs x12, x8, x11 - umulh x11, x7, v0 - add rp, rp, #16 -- sub x18, x18, #1 -- cbz x18, L(end) -+ sub x17, x17, #1 -+ cbz x17, L(end) - - ALIGN(16) - L(top): mul x8, x4, v0 -@@ -110,8 +110,8 @@ - stp x12, x13, [rp],#32 - adcs x12, x8, x11 - umulh x11, x7, v0 -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x17, x17, #1 -+ cbnz x17, L(top) - - L(end): mul x8, x4, v0 - adcs x13, x9, x10 -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/rsh1aors_n.asm ---- mpn/arm64/rsh1aors_n.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/rsh1aors_n.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -59,7 +59,7 @@ - - ASM_START() - PROLOGUE(func_n) -- lsr x18, n, #2 -+ lsr x6, n, #2 - - tbz n, #0, L(bx0) - -@@ -69,7 +69,7 @@ - - L(b01): ADDSUB x13, x5, x9 - and x10, x13, #1 -- cbz x18, L(1) -+ cbz x6, L(1) - ldp x4, x5, [up],#48 - ldp x8, x9, [vp],#48 - ADDSUBC x14, x4, x8 -@@ -80,8 +80,8 @@ - ADDSUBC x12, x4, x8 - ADDSUBC x13, x5, x9 - str x17, [rp], #24 -- sub x18, x18, #1 -- cbz x18, L(end) -+ sub x6, x6, #1 -+ cbz x6, L(end) - b L(top) - - L(1): cset x14, COND -@@ -97,7 +97,7 @@ - ldp x8, x9, [vp],#32 - ADDSUBC x12, x4, x8 - ADDSUBC x13, x5, x9 -- cbz x18, L(3) -+ cbz x6, L(3) - ldp x4, x5, [up,#-16] - ldp x8, x9, [vp,#-16] - extr x17, x12, x15, #1 -@@ -117,7 +117,7 @@ - ADDSUB x12, x4, x8 - ADDSUBC x13, x5, x9 - and x10, x12, #1 -- cbz x18, L(2) -+ cbz x6, L(2) - ldp x4, x5, [up,#-16] - ldp x8, x9, [vp,#-16] - ADDSUBC x14, x4, x8 -@@ -134,8 +134,8 @@ - ADDSUBC x12, x4, x8 - ADDSUBC x13, x5, x9 - add rp, rp, #16 -- sub x18, x18, #1 -- cbz x18, L(end) -+ sub x6, x6, #1 -+ cbz x6, L(end) - - ALIGN(16) - L(top): ldp x4, x5, [up,#-16] -@@ -152,8 +152,8 @@ - ADDSUBC x12, x4, x8 - ADDSUBC x13, x5, x9 - stp x16, x17, [rp],#32 -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x6, x6, #1 -+ cbnz x6, L(top) - - L(end): extr x16, x15, x14, #1 - extr x17, x12, x15, #1 -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/rshift.asm ---- mpn/arm64/rshift.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/rshift.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -60,7 +60,7 @@ - PROLOGUE(mpn_rshift) - mov rp, rp_arg - sub tnc, xzr, cnt -- lsr x18, n, #2 -+ lsr x17, n, #2 - tbz n, #0, L(bx0) - - L(bx1): ldr x5, [up] -@@ -68,7 +68,7 @@ - - L(b01): NSHIFT x0, x5, tnc - PSHIFT x2, x5, cnt -- cbnz x18, L(gt1) -+ cbnz x17, L(gt1) - str x2, [rp] - ret - L(gt1): ldp x4, x5, [up,#8] -@@ -89,7 +89,7 @@ - PSHIFT x13, x4, cnt - NSHIFT x10, x5, tnc - PSHIFT x2, x5, cnt -- cbnz x18, L(gt2) -+ cbnz x17, L(gt2) - orr x10, x10, x13 - stp x10, x2, [rp] - ret -@@ -121,11 +121,11 @@ - orr x11, x12, x2 - stp x11, x10, [rp,#32]! - PSHIFT x2, x5, cnt --L(lo0): sub x18, x18, #1 -+L(lo0): sub x17, x17, #1 - L(lo3): NSHIFT x10, x7, tnc - NSHIFT x12, x6, tnc - PSHIFT x13, x6, cnt -- cbnz x18, L(top) -+ cbnz x17, L(top) - - L(end): orr x10, x10, x13 - orr x11, x12, x2 -diff -r 94c84d919f83 -r 5f32dbc41afc mpn/arm64/sqr_diag_addlsh1.asm ---- mpn/arm64/sqr_diag_addlsh1.asm Sat Nov 28 23:38:32 2020 +0100 -+++ mpn/arm64/sqr_diag_addlsh1.asm Sun Nov 29 22:31:40 2020 +0100 -@@ -47,7 +47,7 @@ - ASM_START() - PROLOGUE(mpn_sqr_diag_addlsh1) - ldr x15, [up],#8 -- lsr x18, n, #1 -+ lsr x14, n, #1 - tbz n, #0, L(bx0) - - L(bx1): adds x7, xzr, xzr -@@ -62,8 +62,8 @@ - ldr x17, [up],#16 - ldp x6, x7, [tp],#32 - umulh x11, x15, x15 -- sub x18, x18, #1 -- cbz x18, L(end) -+ sub x14, x14, #1 -+ cbz x14, L(end) - - ALIGN(16) - L(top): extr x9, x6, x5, #63 -@@ -84,8 +84,8 @@ - extr x8, x5, x4, #63 - stp x12, x13, [rp],#16 - adcs x12, x8, x10 -- sub x18, x18, #1 -- cbnz x18, L(top) -+ sub x14, x14, #1 -+ cbnz x14, L(top) - - L(end): extr x9, x6, x5, #63 - mul x10, x17, x17 diff --git a/bin/pyodide_build_dependencies.sh b/bin/pyodide_build_dependencies.sh deleted file mode 100755 index c33be79f..00000000 --- a/bin/pyodide_build_dependencies.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash - -set -e - -while [[ $# -gt 0 ]] -do - key="$1" - case $key in - -h|--help) - echo "bin/pyodide_build_dependencies.sh [options]" - echo - echo "Build local emscripten installs of python-flint's dependencies." - echo - echo "Supported options:" - echo " --help - show this help message" - echo " --wasm-library-dir - directory to install libraries" - echo " --flint-commit - flint commit to build" - echo - exit - ;; - --wasm-library-dir) - # e.g. --wasm-library-dir /path/to/wasm-library-dir - WASM_LIBRARY_DIR="$2" - shift - shift - ;; - --flint-commit) - # e.g. --flint-commit 3.3.1 - FLINT_COMMIT="$2" - shift - shift - ;; - *) - 2>&1 echo "unrecognised argument:" $key - exit 1 - ;; - esac -done - - -if [ -z "$WASM_LIBRARY_DIR" ]; then - echo "WASM_LIBRARY_DIR not set" - exit 1 -fi - -# Sets versions of GMP, MPFR and FLINT: - -source bin/build_variables.sh - -# Download mirrored copy of source distributions for GMP and MPFR - -git clone https://github.com/oscarbenjamin/gmp_mirror.git -cp gmp_mirror/gmp-$GMPVER.tar.xz . -cp gmp_mirror/mpfr-$MPFRVER.tar.gz . -tar -xf gmp-$GMPVER.tar.xz -tar -xf mpfr-$MPFRVER.tar.gz - - -# ---------------------------Build GMP ----------------------------------# - - -cd gmp-$GMPVER - - emconfigure ./configure \ - --disable-dependency-tracking \ - --host none \ - --disable-shared \ - --enable-static \ - --enable-cxx \ - --prefix=$WASM_LIBRARY_DIR - - emmake make -j $(nproc) - emmake make install - -cd .. - - -# ---------------------------Build MPFR ----------------------------------# - - -cd mpfr-$MPFRVER - - emconfigure ./configure \ - --disable-dependency-tracking \ - --disable-shared \ - --with-gmp=$WASM_LIBRARY_DIR \ - --prefix=$WASM_LIBRARY_DIR - - emmake make -j $(nproc) - emmake make install - -cd .. - - -# ---------------------------Build FLINT----------------------------------# - - -if [ -z "$FLINT_COMMIT" ]; then - curl -O -L https://github.com/flintlib/flint/releases/download/v$FLINTVER/flint-$FLINTVER.tar.gz - tar xf flint-$FLINTVER.tar.gz - cd flint-$FLINTVER -else - git clone https://github.com/flintlib/flint --branch $FLINT_COMMIT - cd flint -fi - - ./bootstrap.sh - - emconfigure ./configure \ - --disable-dependency-tracking \ - --disable-shared \ - --prefix=$WASM_LIBRARY_DIR \ - --with-gmp=$WASM_LIBRARY_DIR \ - --with-mpfr=$WASM_LIBRARY_DIR \ - --host=wasm32-unknown-emscripten \ - --disable-assembly \ - --disable-pthread - - emmake make -j $(nproc) - emmake make install - -cd .. diff --git a/bin/rst_to_pxd.py b/bin/rst_to_pxd.py deleted file mode 100755 index 4320ef4b..00000000 --- a/bin/rst_to_pxd.py +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env python3 - -from collections import defaultdict -import re -import sys -import os -import fnmatch -import argparse - -""" -This is relatively rudimentary, but works for the purpose intended - -To use this to parse an arb rst file - -python rst_to_pxd basename - -or to parse a flint rst file - -python rst_to_pxd flint/basename - -the pxd file is dumped to stdout - -for example -python rst_to_pxd flint/fmpz_poly - -will output a skeleton fmpz_poly.pxd to stdout - - -You will need to configure the location of the flintlib submodule directory and the locations of the flint and -arb doc source directories. - -The other useful configuration is the comment_types and set which are two representations of the types that are -not implemented and therefore we want to comment functions that reference them - -TODO: DRY with comment types, also should be able to add commented types from the command line. -TODO: don't import self - -""" - -# recognize a function definition in rst -is_func = re.compile(r"\.\.( )+(c:)?function( )*::") -# rename types to avoid python -- c name collisions -rename_types = [ - (re.compile(r"\bfmpz\b"),"fmpz_struct"), - (re.compile(r"\bfmpq\b"), "fmpq_struct"), - (re.compile(r"\bin\b"), "in_"), - (re.compile(r"\blambda\b"), "lambda_"), -] -# comment out functions which use these types -comment_types = re.compile(r"(\bFILE\b)|(\bmpz_t\b)|(\bmpq_t\b)") -comment_set = set(["FILE", "mpz_t", "mpq_t"]) -c_types = set(["void", "char", "short", "long", "int", "float", "double"]) -type_modifers = re.compile(r"\*|(\bconst\b)|(\bunsigned\b)|(\bsigned\b)") -import_dict = {} -# gr_domains.rst lists functions that are in gr.h -doc_to_header = {'flint/gr_domains': 'flint/gr'} - - - -def get_cython_struct_types(file): - """ - Extract cython types from a pxd file. - """ - ret = [] - for line in file: - l = line.strip() - if l[:8] == "ctypedef": - if l[-1] == ']': - # ctypedef foo foo_t[0] - l = l[:l.rfind('[')] - elif '(' in l: - # ctypedef int (*foo_func)(...) - l = l[l.index('('):].lstrip('(*') - l = l[:l.index(')')] - else: - # ctypedef foo: - l = l.strip(':') - ret.append(l.split()[-1]) - return ret - - -def fill_import_dict(pyflintlibdir): - """ - Get a map from cython structs to the pxd that defines them - """ - import_dict['fmpq_struct'] = 'types.fmpq' - - with os.scandir(pyflintlibdir + '/types') as entry: - for f in entry: - if fnmatch.fnmatch(f.name, "*.pxd"): - with open(f.path) as pxd: - for t in get_cython_struct_types(pxd): - import_dict[t] = 'types.' + f.name.split('.')[0] - - -def undecorate(str): - """ - remove variable name, const, ``*``, etc. to just get types - """ - ret = str.strip() - if ' ' in ret: - ret = ret[:ret.rfind(' ')] - ret = re.sub(type_modifers, '', ret).strip() - return ret - - -def get_parameter_types(str): - params = str[str.find("(") + 1 : str.rfind(")")].split(",") - ret_type = str.split('(')[0].rsplit(' ', 1)[0] - params.append(ret_type) - return [undecorate(s) for s in params if s] - - -def clean_types(function): - ret = function.strip() - for old, new in rename_types: - ret = re.sub(old, new, ret) - return ret - - -def get_functions(file): - """ - Get a list of functions from an rst file - """ - ret = [] - macros = [] - in_list = False - for line in file: - # Keep track of the macros - # We want to give them types in cython... - if line.startswith('.. macro'): - macros.append(line.strip()) - continue - - if line.strip().endswith('\\'): - continue - - m = is_func.match(line) - if m: - ret.append(clean_types(line[m.end():])) - in_list = True - else: - if in_list: - if line.strip() == '': - in_list = False - else: - ret.append(clean_types(line)) - return ret, macros - - -def get_all_types(function_list): - ret = set() - for f in function_list: - for t in get_parameter_types(f): - ret.add(t) - return ret - - -def has_types(line, types): - #ts = set(t for t in get_parameter_types(line) if t in types) - #if ts: - # print(ts, file=sys.stderr) - return any(t in types for t in get_parameter_types(line)) - - -def gen_imports(function_list): - """ - Generate import statements for known functions. - """ - imports = defaultdict(list) - s = get_all_types(function_list) - s = s - c_types - ret = set([]) - for t in s: - if t in import_dict: - imports[import_dict[t]].append(t) - else: - ret.add(t) - for k, v in sorted(imports.items()): - types = ", ".join(sorted(v)) - print("from flint.flintlib." + k + " cimport " + types) - return sorted(ret) - - - - -def generate_pxd_file(h_name, opts): - fill_import_dict(opts.flint_lib_dir) - l = [] - docdir = opts.arb_doc_dir - name = h_name - h_name = doc_to_header.get(h_name, h_name) - - if name[:6] == "flint/": - docdir = opts.flint_doc_dir - name = name[6:] - with open(os.path.join(docdir, name + ".rst")) as f: - l, macros = get_functions(f) - unknown_types = gen_imports(l) - print() - for t in unknown_types: - print("# unknown type " + t) - print() - for m in macros: - print("# " + m) - print() - print(r'cdef extern from "' + h_name + r'.h":') - for f in l: - if has_types(f, unknown_types): - print(" # " + f) - else: - print(" " + f) - - -def main(*args): - usage = """ - $ cd /path/to/python-flint - $ bin/rst_to_pxd.py flint/fmpz --flint-doc-dir=/path/to/flint/doc/source - """ - parser = argparse.ArgumentParser(description='Generate a pxd file from an rst file', - usage=usage) - parser.add_argument('--flint-lib-dir', help='location of the flintlib submodule', - default="./src/flint/flintlib") - parser.add_argument('--arb-doc-dir', help='location of the arb doc source directory', - default="/Users/davideinstein/projects/arb/doc/source") - parser.add_argument('--flint-doc-dir', help='location of the flint doc source directory', - default="/Users/davideinstein/projects/flint2/doc/source") - parser.add_argument('name', help='name of the rst file to parse (e.g. flint/fmpz)') - - args = parser.parse_args() - - generate_pxd_file(args.name, args) - - -if __name__ == "__main__": - main(*sys.argv[1:]) diff --git a/bin/rtd_before_all_linux.sh b/bin/rtd_before_all_linux.sh deleted file mode 100755 index ff4cddba..00000000 --- a/bin/rtd_before_all_linux.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -apt-get install xz-utils - -bin/build_dependencies_unix.sh\ - --gmp gmp\ - --host x86_64-pc-linux-gnu\ - --use-gmp-github-mirror diff --git a/coverage_plugin.py b/coverage_plugin.py deleted file mode 100644 index 8382dc26..00000000 --- a/coverage_plugin.py +++ /dev/null @@ -1,184 +0,0 @@ -""" -A Cython plugin for coverage.py suitable for a spin/meson project. - -This follows the same general approach as Cython's coverage plugin and uses the -Cython plugin for parsing the C files. The difference here is that files are -laid out very differently in a meson project. Assuming meson makes it a lot -easier to find all the C files because we can just parse the build.ninja file. - -https://coverage.readthedocs.io/en/latest/api_plugin.html -https://github.com/cython/cython/blob/master/Cython/Coverage.py -""" -import re -from collections import defaultdict - -from coverage.plugin import CoveragePlugin, FileTracer, FileReporter - -from functools import cache -from pathlib import Path - - -# Paths used by spin/meson in a src-layout: -root_dir = Path(__file__).parent -build_dir = root_dir / 'build' -build_install_dir = root_dir / 'build-install' -src_dir = root_dir / 'src' - - -def get_ninja_build_rules(): - """Read all build rules from build.ninja.""" - rules = [] - with open(build_dir / 'build.ninja') as build_ninja: - for line in build_ninja: - line = line.strip() - if line.startswith('build '): - line = line[len('build '):] - target, rule = line.split(': ') - if target == 'PHONY': - continue - compiler, *srcfiles = rule.split(' ') - # target is a path relative to the build directory. We will - # turn that into an absolute path so that all paths in target - # and srcfiles are absolute. - target = str(build_dir / target) - rule = (target, compiler, srcfiles) - rules.append(rule) - return rules - - -def get_cython_build_rules(): - """Get all Cython build rules.""" - cython_rules = [] - - for target, compiler, srcfiles in get_ninja_build_rules(): - if compiler == 'cython_COMPILER': - assert target.endswith('.c') - assert len(srcfiles) == 1 and srcfiles[0].endswith('.pyx') - c_file = target - [cython_file] = srcfiles - cython_rules.append((c_file, cython_file)) - - return cython_rules - - -@cache -def parse_all_cfile_lines(): - """Parse all generated C files from the build directory.""" - # - # Each .c file can include code generated from multiple Cython files (e.g. - # because of .pxd files) being cimported. Each Cython file can contribute - # to more than one .c file. Here we parse all .c files and then collect - # together all the executable lines from all of the Cython files into a - # dict like this: - # - # {filename: {lineno: linestr, ...}, ...} - # - # This function is cached because it only needs calling once and is - # expensive. - # - all_code_lines = {} - - for c_file, _ in get_cython_build_rules(): - - cfile_lines = parse_cfile_lines(c_file) - - for cython_file, line_map in cfile_lines.items(): - if cython_file == '(tree fragment)': - continue - elif cython_file in all_code_lines: - # Possibly need to merge the lines? - assert all_code_lines[cython_file] == line_map - else: - all_code_lines[cython_file] = line_map - - return all_code_lines - - -def parse_cfile_lines(c_file): - """Use Cython's coverage plugin to parse the C code.""" - from Cython.Coverage import Plugin - return Plugin()._parse_cfile_lines(c_file) - - -class Plugin(CoveragePlugin): - """A coverage plugin for a spin/meson project with Cython code.""" - - def file_tracer(self, filename): - """Find a tracer for filename to handle trace events.""" - path = Path(filename) - - if path.suffix in ('.pyx', '.pxd') and root_dir in path.parents: - # A .pyx file from the src directory. The path has src - # stripped out and is not a real absolute path but it looks - # like one. Remove the root prefix and then we have a path - # relative to src_dir. - srcpath = path.relative_to(root_dir) - return CyFileTracer(srcpath) - else: - # All sorts of paths come here and we reject them - return None - - def file_reporter(self, filename): - """Return a file reporter for filename.""" - srcfile = Path(filename).relative_to(src_dir) - return CyFileReporter(srcfile) - - -class CyFileTracer(FileTracer): - """File tracer for Cython files (.pyx,.pxd).""" - - def __init__(self, srcpath): - assert (src_dir / srcpath).exists() - self.srcpath = srcpath - - def source_filename(self): - return self.srcpath - - def has_dynamic_source_filename(self): - return True - - def dynamic_source_filename(self, filename, frame): - """Get filename from frame and return abspath to file.""" - # What is returned here needs to match CyFileReporter.filename - path = frame.f_code.co_filename - return self.get_source_filename(path) - - # This is called for every traced line. Cache it: - @staticmethod - @cache - def get_source_filename(filename): - """Get src-relative path for filename from trace event.""" - path = src_dir / filename - assert src_dir in path.parents - assert path.exists() - return str(path) - - -class CyFileReporter(FileReporter): - """File reporter for Cython or Python files (.pyx,.pxd,.py).""" - - def __init__(self, srcpath): - abspath = (src_dir / srcpath) - assert abspath.exists() - - # filepath here needs to match dynamic_source_filename - super().__init__(str(abspath)) - - self.srcpath = srcpath - - def relative_filename(self): - """Path displayed in the coverage reports.""" - return str(self.srcpath) - - def lines(self): - """Set of line numbers for possibly traceable lines.""" - srcpath = str(self.srcpath) - all_line_maps = parse_all_cfile_lines() - line_map = all_line_maps[srcpath] - return set(line_map) - - -def coverage_init(reg, options): - plugin = Plugin() - reg.add_configurer(plugin) - reg.add_file_tracer(plugin) diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index d8fdc1ba..00000000 --- a/doc/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python-flint.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python-flint.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/python-flint" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python-flint" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/doc/build/doctrees/environment.pickle b/doc/build/doctrees/environment.pickle new file mode 100644 index 00000000..5df1dd88 Binary files /dev/null and b/doc/build/doctrees/environment.pickle differ diff --git a/doc/build/doctrees/index.doctree b/doc/build/doctrees/index.doctree new file mode 100644 index 00000000..1311eedc Binary files /dev/null and b/doc/build/doctrees/index.doctree differ diff --git a/doc/build/html/.buildinfo b/doc/build/html/.buildinfo new file mode 100644 index 00000000..6f92e859 --- /dev/null +++ b/doc/build/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: b514d003e6274a2ea15305cbb779ea19 +tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/doc/build/html/_modules/index.html b/doc/build/html/_modules/index.html new file mode 100644 index 00000000..a8ec0320 --- /dev/null +++ b/doc/build/html/_modules/index.html @@ -0,0 +1,87 @@ + + + + + + + + + + Overview: module code — python-flint 0.1 documentation + + + + + + + + + + + + + + +
+
+
+
+ +

All modules for which code is available

+ + +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/doc/build/html/_sources/index.txt b/doc/build/html/_sources/index.txt new file mode 100644 index 00000000..9e7b722b --- /dev/null +++ b/doc/build/html/_sources/index.txt @@ -0,0 +1,138 @@ +.. python-flint documentation master file, created by + sphinx-quickstart on Wed Jul 18 11:49:46 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Python bindings for FLINT +========================================================== + +Introduction +:::::::::::: + +The python-flint Python extension module provides +bindings to FLINT (http://flintlib.org/). +FLINT (Fast Library for Number Theory) is a C library that implements +highly optimised exact scalar, polynomial and matrix arithmetic as +well as many number-theoretic special functions. + +As of the current version, only a subset of the FLINT types +are wrapped, and only a very limited selection of methods are provided. +There are known and unknown bugs, and the interface is subject to +change drastically in the future. Any feedback is welcome +and can be sent to fredrik.johansson@gmail.com or flint-devel@googlegroups.com. +Of particular note: + +* Most functionality in FLINT is not yet wrapped! +* Coercions are not supported in all directions. +* Conversion between Python longs and fmpzs is not done efficiently. +* Types don't yet provide hash methods. +* Interaction with gmpy (http://gmpy.org/) types (and types from many other libraries) is not supported. + +Setup +:::::::::::: + +To build this module, you first need to install the latest +version of FLINT (follow the instructions in the FLINT documentation). You +also need to install Cython (http://cython.org/). + +Next, extract the python-flint archive and run:: + + python ./setup.py build_ext + sudo python ./setup.py install + python ./test.py + +Note: if FLINT is not installed globally, you can do something like the following (the second +line is required for loading FLINT from Python):: + + python ./setup.py build_ext --include-dirs=/home/fredrik/src/flint2 --library-dirs=/home/fredrik/src/flint2 + export LD_LIBRARY_PATH=/home/fredrik/src/flint2/:$LD_LIBRARY_PATH + +If everything worked, you will be able to import the ``flint`` module +in Python:: + + Python 2.7.3 (default, Apr 20 2012, 22:39:59) + [GCC 4.6.3] on linux2 + Type "help", "copyright", "credits" or "license" for more information. + >>> import flint + >>> flint.fmpz(33) ** 33 + fmpz(129110040087761027839616029934664535539337183380513) + +Reference +:::::::::::: + +Scalar types +............ + +fmpz +------------------------------------------------------------ + +.. autoclass :: flint.fmpz + :members: + :undoc-members: + +fmpq +------------------------------------------------------------ + +.. autoclass :: flint.fmpq + :members: + :undoc-members: + +nmod +------------------------------------------------------------ + +.. autoclass :: flint.nmod + :members: + :undoc-members: + +Polynomial types +................ + +fmpz_poly +------------------------------------------------------------ + +.. autoclass :: flint.fmpz_poly + :members: + :undoc-members: + +fmpq_poly +------------------------------------------------------------ + +.. autoclass :: flint.fmpq_poly + :members: + :undoc-members: + +nmod_poly +------------------------------------------------------------ + +.. autoclass :: flint.nmod_poly + :members: + :undoc-members: + +Matrix types +............ + +fmpz_mat +------------------------------------------------------------ + +.. autoclass :: flint.fmpz_mat + :members: + :undoc-members: + +fmpq_mat +------------------------------------------------------------ + +.. autoclass :: flint.fmpq_mat + :members: + :undoc-members: + +nmod_mat +------------------------------------------------------------ + +.. autoclass :: flint.nmod_mat + :members: + :undoc-members: + +Special functions +................. + +.. autofunction :: flint.number_of_partitions diff --git a/doc/build/html/_static/ajax-loader.gif b/doc/build/html/_static/ajax-loader.gif new file mode 100644 index 00000000..61faf8ca Binary files /dev/null and b/doc/build/html/_static/ajax-loader.gif differ diff --git a/doc/build/html/_static/basic.css b/doc/build/html/_static/basic.css new file mode 100644 index 00000000..43e8bafa --- /dev/null +++ b/doc/build/html/_static/basic.css @@ -0,0 +1,540 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + width: 170px; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + width: 30px; +} + +img { + border: 0; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.refcount { + color: #060; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/doc/build/html/_static/comment-bright.png b/doc/build/html/_static/comment-bright.png new file mode 100644 index 00000000..551517b8 Binary files /dev/null and b/doc/build/html/_static/comment-bright.png differ diff --git a/doc/build/html/_static/comment-close.png b/doc/build/html/_static/comment-close.png new file mode 100644 index 00000000..09b54be4 Binary files /dev/null and b/doc/build/html/_static/comment-close.png differ diff --git a/doc/build/html/_static/comment.png b/doc/build/html/_static/comment.png new file mode 100644 index 00000000..92feb52b Binary files /dev/null and b/doc/build/html/_static/comment.png differ diff --git a/doc/build/html/_static/default.css b/doc/build/html/_static/default.css new file mode 100644 index 00000000..21f3f509 --- /dev/null +++ b/doc/build/html/_static/default.css @@ -0,0 +1,256 @@ +/* + * default.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- default theme. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: #eeffcc; + color: #333333; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +tt { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th { + background-color: #ede; +} + +.warning tt { + background: #efc2c2; +} + +.note tt { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} \ No newline at end of file diff --git a/doc/build/html/_static/doctools.js b/doc/build/html/_static/doctools.js new file mode 100644 index 00000000..d4619fdf --- /dev/null +++ b/doc/build/html/_static/doctools.js @@ -0,0 +1,247 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +} + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * small function to check if an array contains + * a given item. + */ +jQuery.contains = function(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == item) + return true; + } + return false; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/doc/build/html/_static/down-pressed.png b/doc/build/html/_static/down-pressed.png new file mode 100644 index 00000000..6f7ad782 Binary files /dev/null and b/doc/build/html/_static/down-pressed.png differ diff --git a/doc/build/html/_static/down.png b/doc/build/html/_static/down.png new file mode 100644 index 00000000..3003a887 Binary files /dev/null and b/doc/build/html/_static/down.png differ diff --git a/doc/build/html/_static/file.png b/doc/build/html/_static/file.png new file mode 100644 index 00000000..d18082e3 Binary files /dev/null and b/doc/build/html/_static/file.png differ diff --git a/doc/build/html/_static/jquery.js b/doc/build/html/_static/jquery.js new file mode 100644 index 00000000..7c243080 --- /dev/null +++ b/doc/build/html/_static/jquery.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/doc/build/html/_static/minus.png b/doc/build/html/_static/minus.png new file mode 100644 index 00000000..da1c5620 Binary files /dev/null and b/doc/build/html/_static/minus.png differ diff --git a/doc/build/html/_static/plus.png b/doc/build/html/_static/plus.png new file mode 100644 index 00000000..b3cb3742 Binary files /dev/null and b/doc/build/html/_static/plus.png differ diff --git a/doc/build/html/_static/pygments.css b/doc/build/html/_static/pygments.css new file mode 100644 index 00000000..1a14f2ae --- /dev/null +++ b/doc/build/html/_static/pygments.css @@ -0,0 +1,62 @@ +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #303030 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0040D0 } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/doc/build/html/_static/searchtools.js b/doc/build/html/_static/searchtools.js new file mode 100644 index 00000000..663be4c9 --- /dev/null +++ b/doc/build/html/_static/searchtools.js @@ -0,0 +1,560 @@ +/* + * searchtools.js_t + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for the full-text search. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words, hlwords is the list of normal, unstemmed + * words. the first one is used to find the occurance, the + * latter for highlighting it. + */ + +jQuery.makeSearchSummary = function(text, keywords, hlwords) { + var textLower = text.toLowerCase(); + var start = 0; + $.each(keywords, function() { + var i = textLower.indexOf(this.toLowerCase()); + if (i > -1) + start = i; + }); + start = Math.max(start - 120, 0); + var excerpt = ((start > 0) ? '...' : '') + + $.trim(text.substr(start, 240)) + + ((start + 240 - text.length) ? '...' : ''); + var rv = $('
').text(excerpt); + $.each(hlwords, function() { + rv = rv.highlightText(this, 'highlighted'); + }); + return rv; +} + + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + + +/** + * Search Module + */ +var Search = { + + _index : null, + _queued_query : null, + _pulse_status : -1, + + init : function() { + var params = $.getQueryParameters(); + if (params.q) { + var query = params.q[0]; + $('input[name="q"]')[0].value = query; + this.performSearch(query); + } + }, + + loadIndex : function(url) { + $.ajax({type: "GET", url: url, data: null, success: null, + dataType: "script", cache: true}); + }, + + setIndex : function(index) { + var q; + this._index = index; + if ((q = this._queued_query) !== null) { + this._queued_query = null; + Search.query(q); + } + }, + + hasIndex : function() { + return this._index !== null; + }, + + deferQuery : function(query) { + this._queued_query = query; + }, + + stopPulse : function() { + this._pulse_status = 0; + }, + + startPulse : function() { + if (this._pulse_status >= 0) + return; + function pulse() { + Search._pulse_status = (Search._pulse_status + 1) % 4; + var dotString = ''; + for (var i = 0; i < Search._pulse_status; i++) + dotString += '.'; + Search.dots.text(dotString); + if (Search._pulse_status > -1) + window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something + */ + performSearch : function(query) { + // create the required interface elements + this.out = $('#search-results'); + this.title = $('

' + _('Searching') + '

').appendTo(this.out); + this.dots = $('').appendTo(this.title); + this.status = $('

').appendTo(this.out); + this.output = $('