diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 574a064de5d8aa47df78430dac459d10e7fa5f67..a48302bbb252407299602548d0e39136a1d65b26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: "Main Script" run: | curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - . ./prepare-and-run-flake8.sh "$(basename $GITHUB_REPOSITORY)" test gen_wrap.py + . ./prepare-and-run-flake8.sh "$(basename $GITHUB_REPOSITORY)" test gen_wrap.py examples pytest: name: Pytest Linux on Py${{ matrix.python-version }} @@ -42,6 +42,26 @@ jobs: curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh . ./build-and-test-py-project.sh + examples: + name: Examples Linux on Py${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + - + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: "Main Script" + run: | + EXTRA_INSTALL="matplotlib numpy" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/ci-support.sh + . ./ci-support.sh + build_py_project_in_venv + run_examples + pytest_mac: name: Pytest macOS runs-on: macos-latest diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 210656e4fca2dd18d18988744a47d6009f55f1d1..d8c1411a97bc1025a083a7ce2476280f24a2b5dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,8 @@ Python 3: - script: - - export PY_EXE=python3 - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" + script: | + EXTRA_INSTALL="numpy" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh + . ./build-and-test-py-project.sh tags: - python3 except: @@ -11,12 +11,23 @@ Python 3: reports: junit: test/pytest.xml -Python 3 small integer opt: - script: - - export PY_EXE=python3 - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - - ./configure.py --use-imath-sio - - ". ./build-and-test-py-project.sh" +Examples: + script: | + EXTRA_INSTALL="matplotlib numpy" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/ci-support.sh + . ./ci-support.sh + build_py_project_in_venv + run_examples + tags: + - python3 + except: + - tags + +Python 3 without small-integer opt: + script: | + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh + ./configure.py --no-use-imath-sio + . ./build-and-test-py-project.sh tags: - python3 except: @@ -67,6 +78,6 @@ Documentation: Flake8: script: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - - . ./prepare-and-run-flake8.sh "$CI_PROJECT_NAME" test gen_wrap.py + - . ./prepare-and-run-flake8.sh "$CI_PROJECT_NAME" test gen_wrap.py examples tags: - python3 diff --git a/examples/demo.py b/examples/demo.py index cbca0d8458bd32e15d478fe10bdadca03fad4c2c..4750af120eb85886256fb7ebb701e0da742ef244 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -34,8 +34,7 @@ def plot_basic_set(bset, *args, **kwargs): for v in vertices: points = [] - myset = (isl.Map.from_basic_map(isl.BasicMap.from_multi_aff(v.get_expr())) - .range()) + myset = isl.BasicSet.from_multi_aff(v.get_expr()) myset.foreach_point(points.append) point, = points vertex_pts.append([ @@ -72,14 +71,14 @@ def plot_basic_set(bset, *args, **kwargs): pt.gca().add_patch(patch) -plot_basic_set(bset, facecolor='red', edgecolor='black', alpha=0.3) -plot_basic_set(bset2, facecolor='green', edgecolor='black', alpha=0.2) +plot_basic_set(bset, facecolor="red", edgecolor="black", alpha=0.3) +plot_basic_set(bset2, facecolor="green", edgecolor="black", alpha=0.2) pt.grid() pt.xlim([-1, 6]) pt.ylim([-1, 8]) #pt.show() pt.savefig("before-union.png", dpi=50) -plot_basic_set(union, facecolor='blue', edgecolor='yellow', +plot_basic_set(union, facecolor="blue", edgecolor="yellow", alpha=0.5, plot_vert=True) pt.savefig("after-union.png", dpi=50) diff --git a/setup.py b/setup.py index a55ab79524043289a050c1f5bed4b7dad3de0955..bb703b4b0f9107f953cf5add67e18d7dfad46eea 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def get_config_schema(): Switch("USE_SHIPPED_IMATH", True, "Use included copy of imath in isl"), Switch("USE_GMP", True, "Use gmp in external isl"), Switch("USE_BARVINOK", False, "Include wrapper for Barvinok"), - Switch("USE_IMATH_SIO", False, "When using imath, use small-integer " + Switch("USE_IMATH_SIO", True, "When using imath, use small-integer " "optimization"), IncludeDir("GMP", []), @@ -214,10 +214,6 @@ def main(): if conf["USE_IMATH_SIO"]: EXTRA_DEFINES["USE_SMALL_INT_OPT"] = 1 - import sys - if sys.platform in ['linux', 'linux2', 'darwin']: - CXXFLAGS.insert(0, "-std=gnu99") - conf["ISL_INC_DIR"].append("isl/imath") else: EXTRA_DEFINES["USE_GMP_FOR_MP"] = 1 @@ -276,21 +272,21 @@ def main(): license="MIT", url="http://documen.tician.de/islpy", classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: Other Audience', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Programming Language :: C++', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: Multimedia :: Graphics :: 3D Modeling', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Physics', - 'Topic :: Scientific/Engineering :: Visualization', - 'Topic :: Software Development :: Libraries', + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Other Audience", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: C++", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Graphics :: 3D Modeling", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Visualization", + "Topic :: Software Development :: Libraries", ], packages=["islpy"], @@ -324,9 +320,9 @@ def main(): extra_link_args=conf["LDFLAGS"], ), ], - cmdclass={'build_ext': IslPyBuildExtCommand}, + cmdclass={"build_ext": IslPyBuildExtCommand}, ) -if __name__ == '__main__': +if __name__ == "__main__": main()