From 4738d31ffe1ee198e7eec02550c3b7d83343316f Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 08:57:08 -0300 Subject: [PATCH 01/36] add workflow for pyston --- .github/workflows/ubuntu-pyston.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/ubuntu-pyston.yml diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml new file mode 100644 index 000000000..6712eaad4 --- /dev/null +++ b/.github/workflows/ubuntu-pyston.yml @@ -0,0 +1,30 @@ +name: Mathics (ubuntu full with Cython) + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + pyston-version: [2.3.4] + steps: + - uses: actions/checkout@v3 + - name: Set up Pyston ${{ matrix.pyston-version }} + run: | + wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb + dpkg -i pyston_2.3.4_20.04_amd64.deb + - name: Install dependencies + run: | + sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev + pyston -m pip install --upgrade pip + - name: Install Mathics with full dependencies + run: | + make develop + - name: Test Mathics + run: | + make -j3 check From 9436936acde51f52ee250db62782354d0d424de0 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:04:10 -0300 Subject: [PATCH 02/36] force pyston in make --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 6712eaad4..67f7ff190 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -27,4 +27,4 @@ jobs: make develop - name: Test Mathics run: | - make -j3 check + make -j3 PYTHON=pyston check From 5bf9c0a149493210d20ab3e6716f44378ad5b2bd Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:06:07 -0300 Subject: [PATCH 03/36] fix name --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 67f7ff190..0245a9500 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -1,4 +1,4 @@ -name: Mathics (ubuntu full with Cython) +name: Mathics (ubuntu full with Pyston) on: push: From 91a65c954e0fddee2d2e528a8aa6a61ae6d70e74 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:08:54 -0300 Subject: [PATCH 04/36] fix indent --- .github/workflows/ubuntu-pyston.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 0245a9500..4153ddfd5 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -16,8 +16,8 @@ jobs: - uses: actions/checkout@v3 - name: Set up Pyston ${{ matrix.pyston-version }} run: | - wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb - dpkg -i pyston_2.3.4_20.04_amd64.deb + wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb + dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev From 1ea133ce62fdc3a919b4c787c69fafcc43ef554a Mon Sep 17 00:00:00 2001 From: Juan Mauricio Matera Date: Thu, 9 Jun 2022 09:20:42 -0300 Subject: [PATCH 05/36] Update ubuntu-pyston.yml --- .github/workflows/ubuntu-pyston.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 4153ddfd5..61e949673 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -17,11 +17,11 @@ jobs: - name: Set up Pyston ${{ matrix.pyston-version }} run: | wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb - dpkg -i pyston_2.3.4_20.04_amd64.deb + sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev - pyston -m pip install --upgrade pip + sudo pyston -m pip install --upgrade pip - name: Install Mathics with full dependencies run: | make develop From 33d5eeae7e81d5a73703ecc94b4f04d44f1c4dd4 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:31:02 -0300 Subject: [PATCH 06/36] adding dependency --- .github/workflows/ubuntu-pyston.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 61e949673..0e1ced6bf 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -17,6 +17,26 @@ jobs: - name: Set up Pyston ${{ matrix.pyston-version }} run: | wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb + sudo apt-get install name: Mathics (ubuntu full with Pyston) + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + pyston-version: [2.3.4] + steps: + - uses: actions/checkout@v3 + - name: Set up Pyston ${{ matrix.pyston-version }} + run: | + wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb + sudo apt-get install tk8.6-blt2.5 sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | From d8e6ddee42474c8bf301be819aa666360e839368 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:41:41 -0300 Subject: [PATCH 07/36] add dependency --- .github/workflows/ubuntu-pyston.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 0e1ced6bf..98c6e670b 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -1,24 +1,5 @@ name: Mathics (ubuntu full with Pyston) -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-20.04 - strategy: - matrix: - pyston-version: [2.3.4] - steps: - - uses: actions/checkout@v3 - - name: Set up Pyston ${{ matrix.pyston-version }} - run: | - wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb - sudo apt-get install name: Mathics (ubuntu full with Pyston) - on: push: branches: [ master ] From 77862dc27dbd676704b72e9618bf8249a19a8233 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:43:37 -0300 Subject: [PATCH 08/36] l18 --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 98c6e670b..53e69d38c 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Pyston ${{ matrix.pyston-version }} run: | wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb - sudo apt-get install tk8.6-blt2.5 + sudo apt-get install tk8.6-blt2.5 sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | From 25a16ef0b931472966f35ae22406e3d2517d8e78 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:49:59 -0300 Subject: [PATCH 09/36] llvm --- .github/workflows/ubuntu-pyston.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 53e69d38c..7396d9a95 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -23,9 +23,12 @@ jobs: run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev sudo pyston -m pip install --upgrade pip - - name: Install Mathics with full dependencies + sudo pyston -m pip install llvmlite + - name: Install Mathics with minimal dependencies run: | make develop - name: Test Mathics run: | - make -j3 PYTHON=pyston check + # py.test seems to use always the default python interpreter of the system. Any idea about how to + # change this behaviour? + make -j3 PYTHON=pyston doctest From 454503201d1cbd894ba79dcb6de3d6655ccdaf5f Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:53:11 -0300 Subject: [PATCH 10/36] llvm --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 7396d9a95..a23d0cfa2 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -23,7 +23,7 @@ jobs: run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev sudo pyston -m pip install --upgrade pip - sudo pyston -m pip install llvmlite + sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies run: | make develop From 233503761d15792a33178e34981d2c2eac235907 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:53:47 -0300 Subject: [PATCH 11/36] llvm --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index a23d0cfa2..1411c4b80 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -30,5 +30,5 @@ jobs: - name: Test Mathics run: | # py.test seems to use always the default python interpreter of the system. Any idea about how to - # change this behaviour? + # change this behaviour? make -j3 PYTHON=pyston doctest From 200998f150e54d9c8110adee5a6727e0dc26dee8 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:55:23 -0300 Subject: [PATCH 12/36] removing the other wfs --- .github/workflows/osx.yml | 36 -------------------------- .github/workflows/ubuntu-cython.yml | 32 ----------------------- .github/workflows/ubuntu.yml | 34 ------------------------ .github/workflows/windows.yml | 40 ----------------------------- 4 files changed, 142 deletions(-) delete mode 100644 .github/workflows/osx.yml delete mode 100644 .github/workflows/ubuntu-cython.yml delete mode 100644 .github/workflows/ubuntu.yml delete mode 100755 .github/workflows/windows.yml diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml deleted file mode 100644 index b170e795e..000000000 --- a/.github/workflows/osx.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Mathics (OSX) - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - env: - NO_CYTHON: 1 - runs-on: macos-latest - strategy: - matrix: - os: [macOS] - python-version: [3.6, 3.7, 3.8, 3.9] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - brew install llvm@11 - python -m pip install --upgrade pip - LLVM_CONFIG=/usr/local/Cellar/llvm@11/11.1.0/bin/llvm-config pip install llvmlite - # Can remove after next Mathics-Scanner release - # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] - - name: Install Mathics with full dependencies - run: | - make develop-full - - name: Test Mathics - run: | - make -j3 check diff --git a/.github/workflows/ubuntu-cython.yml b/.github/workflows/ubuntu-cython.yml deleted file mode 100644 index 19a990dcb..000000000 --- a/.github/workflows/ubuntu-cython.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Mathics (ubuntu full with Cython) - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [3.9] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev - python -m pip install --upgrade pip - # Can remove after next Mathics-Scanner release - # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] - - name: Install Mathics with full dependencies - run: | - make develop-full-cython - - name: Test Mathics - run: | - make -j3 check diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 7a8b7796c..000000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Mathics (ubuntu) - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - env: - NO_CYTHON: 1 - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev - python -m pip install --upgrade pip - # Can remove after next Mathics-Scanner release - # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] - - name: Install Mathics with full dependencies - run: | - make develop-full - - name: Test Mathics - run: | - make -j3 check diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100755 index e91bc7127..000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Mathics (Windows) - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - env: - NO_CYTHON: 1 - runs-on: windows-latest - strategy: - matrix: - os: [windows] - python-version: [3.7, 3.8] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install wheel - choco install llvm - set LLVM_DIR="C:\Program Files\LLVM" - # Can remove after next Mathics-Scanner release - # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] - pip install -e . - - name: Install Mathics - run: | - python setup.py install - - name: Test Mathics - run: | - pip install -e .[dev,full] - set PYTEST_WORKERS="-n3" - make check From e93d6e480decdc83d845b9746999535b7f8990b1 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:57:29 -0300 Subject: [PATCH 13/36] ubuntu 22 --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 1411c4b80..773ca76da 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: pyston-version: [2.3.4] From 513ad9df3a158c98a4b13f8822021fde00fbb203 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 09:58:48 -0300 Subject: [PATCH 14/36] ubuntu 22 --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 773ca76da..e017d6deb 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Pyston ${{ matrix.pyston-version }} run: | wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb - sudo apt-get install tk8.6-blt2.5 + sudo apt-get install tk8.6-blt2.5 libffi7 sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | From 4f69d73f7c85e418e5e1cf44eb45fc3a1347f58c Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 10:01:41 -0300 Subject: [PATCH 15/36] ubuntu 22 --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index e017d6deb..b0172e163 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -21,7 +21,7 @@ jobs: sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | - sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev + sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11-dev sudo pyston -m pip install --upgrade pip sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies From f14fe191942dac5d965af29fb6e6d07e33cd15c3 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 10:05:51 -0300 Subject: [PATCH 16/36] ubuntu 22 --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index b0172e163..be1e46d1f 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -21,7 +21,7 @@ jobs: sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | - sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11-dev + sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev sudo pyston -m pip install --upgrade pip sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies From e1b1bd02ee0d96c79cf3f4a41c0d25577e694955 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 10:09:39 -0300 Subject: [PATCH 17/36] ubuntu 22 --- .github/workflows/ubuntu-pyston.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index be1e46d1f..690635d6c 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -16,12 +16,13 @@ jobs: - uses: actions/checkout@v3 - name: Set up Pyston ${{ matrix.pyston-version }} run: | + sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev + whereis llvm-config wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb sudo apt-get install tk8.6-blt2.5 libffi7 sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | - sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev sudo pyston -m pip install --upgrade pip sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies From 83e1a3ace673479f6e165a7290199ed7698726d8 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 10:32:05 -0300 Subject: [PATCH 18/36] make llvmlite as optional --- .github/workflows/ubuntu-pyston.yml | 5 ++--- requirements-full.txt | 1 + setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 690635d6c..dedd19f8f 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -16,15 +16,14 @@ jobs: - uses: actions/checkout@v3 - name: Set up Pyston ${{ matrix.pyston-version }} run: | - sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev - whereis llvm-config wget https://github.com/pyston/pyston/releases/download/pyston_2.3.4/pyston_2.3.4_20.04_amd64.deb sudo apt-get install tk8.6-blt2.5 libffi7 sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | +# sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev sudo pyston -m pip install --upgrade pip - sudo pyston -m pip install llvmlite +# sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies run: | make develop diff --git a/requirements-full.txt b/requirements-full.txt index 6647098e5..76bfe5157 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -3,3 +3,4 @@ psutil # SystemMemory and MemoryAvailable scikit-image >= 0.17 # FindMinimum can use this; used by Image as well lxml # for HTML parsing used in builtin/fileformats/html wordcloud # Used in builtin/image.py by WordCloud() +llvmlite # for jit compiling diff --git a/setup.py b/setup.py index c9336e3af..80edf35c0 100644 --- a/setup.py +++ b/setup.py @@ -131,7 +131,7 @@ def read(*rnames): "palettable", "pint", "python-dateutil", - "llvmlite", + # "llvmlite", "recordclass", "requests", ] From 5ccd1810ffbf7857e02e1d47f93cb5bf75d9ab1f Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 10:35:33 -0300 Subject: [PATCH 19/36] make llvmlite as optional --- .github/workflows/ubuntu-pyston.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index dedd19f8f..a143e0339 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -21,9 +21,9 @@ jobs: sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | -# sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev + # sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev sudo pyston -m pip install --upgrade pip -# sudo pyston -m pip install llvmlite + # sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies run: | make develop From 41848f95e22436628f94cbcaa90e5d00d94d81b9 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 22:30:20 -0300 Subject: [PATCH 20/36] llvm --- .github/workflows/ubuntu-pyston.yml | 5 +++-- requirements-full.txt | 1 - setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index a143e0339..3176d0ccd 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -21,9 +21,10 @@ jobs: sudo dpkg -i pyston_2.3.4_20.04_amd64.deb - name: Install dependencies run: | - # sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev + sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev + export LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config sudo pyston -m pip install --upgrade pip - # sudo pyston -m pip install llvmlite + sudo pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies run: | make develop diff --git a/requirements-full.txt b/requirements-full.txt index 76bfe5157..6647098e5 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -3,4 +3,3 @@ psutil # SystemMemory and MemoryAvailable scikit-image >= 0.17 # FindMinimum can use this; used by Image as well lxml # for HTML parsing used in builtin/fileformats/html wordcloud # Used in builtin/image.py by WordCloud() -llvmlite # for jit compiling diff --git a/setup.py b/setup.py index 80edf35c0..c9336e3af 100644 --- a/setup.py +++ b/setup.py @@ -131,7 +131,7 @@ def read(*rnames): "palettable", "pint", "python-dateutil", - # "llvmlite", + "llvmlite", "recordclass", "requests", ] From 6f2835e146a3fb3431cd707abca3351266819088 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 22:34:56 -0300 Subject: [PATCH 21/36] llvm --- .github/workflows/ubuntu-pyston.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 3176d0ccd..8c2ba999b 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -22,9 +22,9 @@ jobs: - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev - export LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config + sudo /usr/lib/llvm-11/bin/llvm-config sudo pyston -m pip install --upgrade pip - sudo pyston -m pip install llvmlite + sudo LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies run: | make develop From 5136ee247e3692f9cd9492ed5968508e44a21798 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jun 2022 22:35:53 -0300 Subject: [PATCH 22/36] llvm --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 8c2ba999b..b226f5d0e 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -22,7 +22,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev - sudo /usr/lib/llvm-11/bin/llvm-config + sudo /usr/lib/llvm-11/bin/llvm-config sudo pyston -m pip install --upgrade pip sudo LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies From 2f3538eb2c6781c855eaa7e4eeeba493ed6337d3 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 08:05:01 -0300 Subject: [PATCH 23/36] llvm --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index b226f5d0e..1526e3fb4 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -22,7 +22,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev - sudo /usr/lib/llvm-11/bin/llvm-config + sudo /usr/lib/llvm-11/bin/llvm-config --version sudo pyston -m pip install --upgrade pip sudo LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies From 467f33e842f0f0f7d0edbe2b16da917e945c01a3 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 08:11:17 -0300 Subject: [PATCH 24/36] llvm --- .github/workflows/ubuntu-pyston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-pyston.yml b/.github/workflows/ubuntu-pyston.yml index 1526e3fb4..62bab8ed5 100644 --- a/.github/workflows/ubuntu-pyston.yml +++ b/.github/workflows/ubuntu-pyston.yml @@ -22,7 +22,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-11 llvm-11-dev - sudo /usr/lib/llvm-11/bin/llvm-config --version + # sudo /usr/lib/llvm-11/bin/llvm-config --version sudo pyston -m pip install --upgrade pip sudo LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config pyston -m pip install llvmlite - name: Install Mathics with minimal dependencies From 27a9584b9ff197f24a5f7b1bdcf2b76fef94cb78 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 08:24:17 -0300 Subject: [PATCH 25/36] check requires --- mathics/doc/common_doc.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index b6ad88e52..c4fb67927 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -138,6 +138,32 @@ test_result_map = {} +# TODO: Use this when checking requires for modules. +requires_cache = {} + + +def check_requires_list(cls): + global requires_cache + + if not hasattr(cls, "requires"): + return True + + requires = cls.requires + for lib in requires: + lib_is_installed = requires_cache.get(lib, None) + if lib_is_installed is None: + lib_is_installed = True + try: + importlib.import_module(package) + except ImportError: + lib_is_installed = False + requires_cache[lib] = lib_is_installed + + if not lib_is_installed: + return False + return True + + def get_results_by_test(test_expr: str, full_test_key: list, doc_data: dict) -> list: """ Sometimes test numbering is off, either due to bugs or changes since the @@ -1058,6 +1084,8 @@ def __init__(self, module=None): and var.__module__[: len(self.pymathicsmodule.__name__)] == self.pymathicsmodule.__name__ ): # nopep8 + if not check_requires_list(var): + continue instance = var(expression=False) if isinstance(instance, Builtin): self.symbols[instance.get_name()] = instance From a0c403eead7e01eda3a8c88be4f872e946a322ed Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 09:05:59 -0300 Subject: [PATCH 26/36] verbose skip --- mathics/doc/common_doc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index c4fb67927..e32bb21ac 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -160,6 +160,7 @@ def check_requires_list(cls): requires_cache[lib] = lib_is_installed if not lib_is_installed: + print(" ", lib, " required by ", cls.__name__, " is not available.") return False return True @@ -1085,6 +1086,7 @@ def __init__(self, module=None): == self.pymathicsmodule.__name__ ): # nopep8 if not check_requires_list(var): + print(" skiping ", var.__name__) continue instance = var(expression=False) if isinstance(instance, Builtin): From 09dd96ea235fd07c7d1bfd9441f469eef250828b Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 09:27:00 -0300 Subject: [PATCH 27/36] verboser --- mathics/builtin/numbers/calculus.py | 2 +- mathics/doc/common_doc.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mathics/builtin/numbers/calculus.py b/mathics/builtin/numbers/calculus.py index 6e7d953b0..30efaf86e 100644 --- a/mathics/builtin/numbers/calculus.py +++ b/mathics/builtin/numbers/calculus.py @@ -2097,7 +2097,7 @@ class NIntegrate(Builtin): messages.update(scipy_nintegrate_messages) except Exception as e: print(e) - print("scipy integrators was not loaded.") + print("scipy integrators were not loaded.") pass methods.update( diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index e32bb21ac..6e4845e07 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -143,11 +143,12 @@ def check_requires_list(cls): + 1 / 0 global requires_cache - + print("check requires for ", cls) if not hasattr(cls, "requires"): return True - + print(" ", cls.requires) requires = cls.requires for lib in requires: lib_is_installed = requires_cache.get(lib, None) @@ -933,13 +934,17 @@ def add_section( object to the chapter, a DocChapter object. "section_object" is either a Python module or a Class object instance. """ + # FIXME Use check_requires_installed() installed = True + print("trying to add", section_object.__class__) for package in getattr(section_object, "requires", []): try: importlib.import_module(package) except ImportError: installed = False break + if not installed: + return # FIXME add an additional mechanism in the module # to allow a docstring and indicate it is not to go in the # user manual @@ -976,6 +981,7 @@ def add_subsection( operator=None, in_guide=False, ): + # FIXME Use check_requires_installed() installed = True for package in getattr(instance, "requires", []): try: @@ -987,6 +993,9 @@ def add_subsection( # FIXME add an additional mechanism in the module # to allow a docstring and indicate it is not to go in the # user manual + if not installed: + return + if not instance.__doc__: return subsection = DocSubsection( From 12fdceb59b2b7a363784c1cf410326af4906af13 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 09:47:32 -0300 Subject: [PATCH 28/36] skip not installed symbols --- mathics/doc/common_doc.py | 54 ++++++++++++--------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index 6e4845e07..390bf68d2 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -139,26 +139,21 @@ # TODO: Use this when checking requires for modules. -requires_cache = {} +requires_lib_cache = {} -def check_requires_list(cls): - 1 / 0 +def check_requires_list(requires: list) -> bool: global requires_cache - print("check requires for ", cls) - if not hasattr(cls, "requires"): - return True - print(" ", cls.requires) - requires = cls.requires + for lib in requires: - lib_is_installed = requires_cache.get(lib, None) + lib_is_installed = requires_lib_cache.get(lib, None) if lib_is_installed is None: lib_is_installed = True try: importlib.import_module(package) except ImportError: lib_is_installed = False - requires_cache[lib] = lib_is_installed + requires_lib_cache[lib] = lib_is_installed if not lib_is_installed: print(" ", lib, " required by ", cls.__name__, " is not available.") @@ -680,6 +675,8 @@ def get_subsection(self, part_slug, chapter_slug, section_slug, subsection_slug) def get_tests(self): for part in self.parts: for chapter in part.chapters: + if not chapter.installed: + continue tests = chapter.doc.get_tests() if tests: yield Tests(part.title, chapter.title, "", tests) @@ -693,6 +690,8 @@ def get_tests(self): # iterated below. Probably some other code is faulty and # when fixed the below loop and collection into doctest_list[] # will be removed. + if not docsubsection.installed: + continue doctest_list = [] index = 1 for doctests in docsubsection.items: @@ -934,17 +933,8 @@ def add_section( object to the chapter, a DocChapter object. "section_object" is either a Python module or a Class object instance. """ - # FIXME Use check_requires_installed() - installed = True - print("trying to add", section_object.__class__) - for package in getattr(section_object, "requires", []): - try: - importlib.import_module(package) - except ImportError: - installed = False - break - if not installed: - return + installed = check_requires_list(getattr(section_object, "requires", [])) + # FIXME add an additional mechanism in the module # to allow a docstring and indicate it is not to go in the # user manual @@ -982,19 +972,11 @@ def add_subsection( in_guide=False, ): # FIXME Use check_requires_installed() - installed = True - for package in getattr(instance, "requires", []): - try: - importlib.import_module(package) - except ImportError: - installed = False - break + installed = check_requires_list(getattr(instance, "requires", [])) # FIXME add an additional mechanism in the module # to allow a docstring and indicate it is not to go in the # user manual - if not installed: - return if not instance.__doc__: return @@ -1144,13 +1126,7 @@ def __init__(self, module=None): chapter = DocChapter(builtin_part, title, XMLDoc(text)) for name in self.symbols: instance = self.symbols[name] - installed = True - for package in getattr(instance, "requires", []): - try: - importlib.import_module(package) - except ImportError: - installed = False - break + installed = check_requires_list(getattr(instance, "requires", [])) section = DocSection( chapter, strip_system_prefix(name), @@ -1368,8 +1344,12 @@ def get_tests(self): # A guide section's subsection are Sections without the Guide. # it is *their* subsections where we generally find tests. for section in self.subsections: + if not section.installed: + continue for subsection in section.subsections: # FIXME we are omitting the section title here... + if not subsection.installed: + continue for doctests in subsection.items: yield doctests.get_tests() From 5ec887a5b408ed4d7f702a0138e49aa753060709 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 10:24:03 -0300 Subject: [PATCH 29/36] skip not installed symbols --- mathics/doc/common_doc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index 390bf68d2..9fbd8516e 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -145,18 +145,18 @@ def check_requires_list(requires: list) -> bool: global requires_cache - for lib in requires: - lib_is_installed = requires_lib_cache.get(lib, None) + for package in requires: + lib_is_installed = requires_lib_cache.get(package, None) if lib_is_installed is None: lib_is_installed = True try: importlib.import_module(package) except ImportError: lib_is_installed = False - requires_lib_cache[lib] = lib_is_installed + requires_lib_cache[package] = lib_is_installed if not lib_is_installed: - print(" ", lib, " required by ", cls.__name__, " is not available.") + print(" ", package, " required by ", cls.__name__, " is not available.") return False return True From f09a0a5eeac787f26be5eb92bf4e3873674d8ce0 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 10:38:25 -0300 Subject: [PATCH 30/36] remove print --- mathics/doc/common_doc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index 9fbd8516e..8cb6872f4 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -156,7 +156,6 @@ def check_requires_list(requires: list) -> bool: requires_lib_cache[package] = lib_is_installed if not lib_is_installed: - print(" ", package, " required by ", cls.__name__, " is not available.") return False return True From 99cc4a08c3c276e03ed4836b49c49c48e63952df Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 10:39:07 -0300 Subject: [PATCH 31/36] skip not installed symbols --- mathics/doc/common_doc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index 8cb6872f4..ce971a1ad 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -970,7 +970,6 @@ def add_subsection( operator=None, in_guide=False, ): - # FIXME Use check_requires_installed() installed = check_requires_list(getattr(instance, "requires", [])) # FIXME add an additional mechanism in the module From 878efae238473031f7eb427ab6bac84ecdc886fe Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 10:52:49 -0300 Subject: [PATCH 32/36] chapters does not have installed attribute --- mathics/doc/common_doc.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index ce971a1ad..552d737ac 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -674,8 +674,6 @@ def get_subsection(self, part_slug, chapter_slug, section_slug, subsection_slug) def get_tests(self): for part in self.parts: for chapter in part.chapters: - if not chapter.installed: - continue tests = chapter.doc.get_tests() if tests: yield Tests(part.title, chapter.title, "", tests) From 108e3824adf59141f2b3343383504c945f89f822 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 11:33:10 -0300 Subject: [PATCH 33/36] requires for scipy --- mathics/builtin/numbers/calculus.py | 24 ++++++++++++------------ mathics/builtin/optiondoc.py | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mathics/builtin/numbers/calculus.py b/mathics/builtin/numbers/calculus.py index 30efaf86e..a483f7d4f 100644 --- a/mathics/builtin/numbers/calculus.py +++ b/mathics/builtin/numbers/calculus.py @@ -1285,18 +1285,9 @@ class _BaseFinder(Builtin): This class is the basis class for FindRoot, FindMinimum and FindMaximum. """ - options = { - "MaxIterations": "100", - "Method": "Automatic", - "AccuracyGoal": "Automatic", - "PrecisionGoal": "Automatic", - "StepMonitor": "None", - "EvaluationMonitor": "None", - "Jacobian": "Automatic", - } - attributes = hold_all | protected - + requires = ["scipy"] + methods = {} messages = { "snum": "Value `1` is not a number.", "nnum": "The function value is not a number at `1` = `2`.", @@ -1313,7 +1304,15 @@ class _BaseFinder(Builtin): ), } - methods = {} + options = { + "MaxIterations": "100", + "Method": "Automatic", + "AccuracyGoal": "Automatic", + "PrecisionGoal": "Automatic", + "StepMonitor": "None", + "EvaluationMonitor": "None", + "Jacobian": "Automatic", + } def apply(self, f, x, x0, evaluation, options): "%(name)s[f_, {x_, x0_}, OptionsPattern[]]" @@ -2048,6 +2047,7 @@ class NIntegrate(Builtin): """ + requires = ["scipy"] summary_text = "numerical integration in one or several variables" messages = { "bdmtd": "The Method option should be a built-in method name.", diff --git a/mathics/builtin/optiondoc.py b/mathics/builtin/optiondoc.py index c49ccde1d..5a838c132 100644 --- a/mathics/builtin/optiondoc.py +++ b/mathics/builtin/optiondoc.py @@ -176,8 +176,8 @@ class MaxRecursion(Builtin):
is an option for functions like NIntegrate and Plot that specifies how many recursive subdivisions can be made. - >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, MaxRecursion -> 10] - = 1.97519×10^-207 + >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, MaxRecursion -> 3] < 1.*^-5 + = True """ summary_text = "maximum number of recursive subdivisions" From 5f44b7218c0042fbae154a9007c16d95912b965b Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 11:42:41 -0300 Subject: [PATCH 34/36] ... --- mathics/builtin/optiondoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/optiondoc.py b/mathics/builtin/optiondoc.py index 5a838c132..933ae7ba3 100644 --- a/mathics/builtin/optiondoc.py +++ b/mathics/builtin/optiondoc.py @@ -177,7 +177,7 @@ class MaxRecursion(Builtin): >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, MaxRecursion -> 3] < 1.*^-5 - = True + = ... """ summary_text = "maximum number of recursive subdivisions" From 10f26727c1c0afc57be5671a74ab06582d873b4f Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 11:52:25 -0300 Subject: [PATCH 35/36] removing test for MaxRecursion --- mathics/builtin/optiondoc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mathics/builtin/optiondoc.py b/mathics/builtin/optiondoc.py index 933ae7ba3..600ae61c7 100644 --- a/mathics/builtin/optiondoc.py +++ b/mathics/builtin/optiondoc.py @@ -176,10 +176,12 @@ class MaxRecursion(Builtin):
is an option for functions like NIntegrate and Plot that specifies how many recursive subdivisions can be made. - >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, MaxRecursion -> 3] < 1.*^-5 - = ... """ + # This test does not pass if scipy is not available... + # >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, MaxRecursion -> 3] < 1.*^-5 + # = True + summary_text = "maximum number of recursive subdivisions" From 79fccbc5646f6f5f4a002d779ec89f9201bbf469 Mon Sep 17 00:00:00 2001 From: mmatera Date: Fri, 10 Jun 2022 19:02:30 -0300 Subject: [PATCH 36/36] tiny changes --- mathics/algorithm/integrators.py | 2 ++ mathics/builtin/numbers/calculus.py | 6 +++--- mathics/builtin/optiondoc.py | 6 ++++-- mathics/doc/common_doc.py | 1 - 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mathics/algorithm/integrators.py b/mathics/algorithm/integrators.py index 2466c4bee..dbb6818bb 100644 --- a/mathics/algorithm/integrators.py +++ b/mathics/algorithm/integrators.py @@ -229,3 +229,5 @@ def apply_D_to_Integral(func, domain, var, evaluation, options, head): } integrator_methods["Simpson"] = integrator_methods["Internal"] integrator_methods["Automatic"] = integrator_methods["Internal"] + +integrator_messages = {} diff --git a/mathics/builtin/numbers/calculus.py b/mathics/builtin/numbers/calculus.py index a483f7d4f..8b9715974 100644 --- a/mathics/builtin/numbers/calculus.py +++ b/mathics/builtin/numbers/calculus.py @@ -2077,6 +2077,7 @@ class NIntegrate(Builtin): "Automatic": (None, False), } try: + # builtin integrators from mathics.algorithm.integrators import ( integrator_methods, integrator_messages, @@ -2088,6 +2089,7 @@ class NIntegrate(Builtin): pass try: + # scipy integrators from mathics.builtin.scipy_utils.integrators import ( scipy_nintegrate_methods, scipy_nintegrate_messages, @@ -2096,11 +2098,9 @@ class NIntegrate(Builtin): methods.update(scipy_nintegrate_methods) messages.update(scipy_nintegrate_messages) except Exception as e: - print(e) - print("scipy integrators were not loaded.") pass - methods.update( + messages.update( { "bdmtd": "The Method option should be a " + "built-in method name in {`" diff --git a/mathics/builtin/optiondoc.py b/mathics/builtin/optiondoc.py index 600ae61c7..27f665222 100644 --- a/mathics/builtin/optiondoc.py +++ b/mathics/builtin/optiondoc.py @@ -176,11 +176,13 @@ class MaxRecursion(Builtin):
is an option for functions like NIntegrate and Plot that specifies how many recursive subdivisions can be made. + >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, Method->"Internal", MaxRecursion -> 3] + = 0.0777778 + >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, Method->"Internal", MaxRecursion -> 6] + = 0.00972222 """ # This test does not pass if scipy is not available... - # >> NIntegrate[Exp[-10^8 x^2], {x, -1, 1}, MaxRecursion -> 3] < 1.*^-5 - # = True summary_text = "maximum number of recursive subdivisions" diff --git a/mathics/doc/common_doc.py b/mathics/doc/common_doc.py index 552d737ac..dbf071825 100644 --- a/mathics/doc/common_doc.py +++ b/mathics/doc/common_doc.py @@ -1073,7 +1073,6 @@ def __init__(self, module=None): == self.pymathicsmodule.__name__ ): # nopep8 if not check_requires_list(var): - print(" skiping ", var.__name__) continue instance = var(expression=False) if isinstance(instance, Builtin):