Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
850487b
TST, CI: turn on codecov patch diffs
tylerjereddy May 28, 2020
9178bd3
Update codecov.yml
tylerjereddy Jun 4, 2020
69280cf
MAINT: forward port 1.5.4 release notes
tylerjereddy Nov 5, 2020
8fc3e65
MAINT: fix CI pycodestyle fails
tylerjereddy Nov 6, 2020
3a0513e
Merge pull request #13045 from tylerjereddy/treddy_pycodestyle_fixes
rgommers Nov 6, 2020
d4230a9
Merge pull request #13042 from tylerjereddy/forward_154_notes
tylerjereddy Nov 7, 2020
f490b4a
DOC: Say that all tolerances must be higher than machine epsilon when…
AtsushiSakai Nov 8, 2020
4d81d8f
MAINT: dogbox ensure x is within bounds closes #11403 (#13041)
andyfaff Nov 8, 2020
7d0bf69
BUG: bvls can fail catastrophically to converge (#12709)
divenex Nov 8, 2020
17fde72
Typo fix for cluster documentation
gokceneraslan Nov 8, 2020
57c1ec2
BUG: forward port lint_diff shims (#13036)
tylerjereddy Nov 8, 2020
826c6fc
Merge pull request #13052 from gokceneraslan/patch-1
rgommers Nov 8, 2020
4fea5d5
CI: Run benchmarks (#8779)
larsoner Nov 8, 2020
389b2e0
ENH: linalg: add fast toeplitz matrix multiplication using FFT (#11346)
InfProbSciX Nov 9, 2020
799b4fe
ENH: stats: improvements to stats.linregress (#12983)
lczyk Nov 10, 2020
708eff9
fixing small typoes in doc of function csr_tocsc: to use Bi for row i…
Nov 10, 2020
f77d0b4
MAINT: clip_x_for_func should be private
andyfaff Nov 10, 2020
81d5e7a
Fix spline interpolation boundary handling for modes reflect and wrap…
grlee77 Nov 10, 2020
4c50042
DOC: stats: Replace np.float with np.float64 in a tutorial file.
WarrenWeckesser Nov 10, 2020
7acebe9
DOC: signal.win -> signal.windows.win in Examples
endolith Nov 10, 2020
e7b39b5
Merge pull request #13060 from andyfaff/clip
ilayn Nov 10, 2020
93b864b
MAINT: fft: Fix a C++ compiler warning.
WarrenWeckesser Nov 9, 2020
6215668
lazily import multiprocessing.Pool in MapWrapper
graingert Sep 22, 2020
1785820
use os.cpu_count directly rather than via multiprocessing
graingert Sep 22, 2020
2af2d98
ENH: cKDTree and test
larsoner Sep 22, 2020
25ba003
MAINT: stats: fix numerical precision in nct.stats (#12936)
rlucas7 Nov 11, 2020
832e91d
Merge pull request #12253 from tylerjereddy/codecov_patch_diff
tylerjereddy Nov 11, 2020
e198e0a
Merge pull request #13057 from seraphalo/sparse-fixes
tylerjereddy Nov 11, 2020
779bcb5
MAINT: minimize with equal bounds
andyfaff Sep 24, 2020
9eb1250
ENH: remove redundant parameters
andyfaff Sep 26, 2020
6722215
MAINT: _prepare_bounds uses array
andyfaff Sep 27, 2020
c4f9a75
MAINT: ScalarFunction rejects non-scalar func
andyfaff Sep 27, 2020
5397101
MAINT: specific error message
andyfaff Sep 27, 2020
c844916
PEP8
andyfaff Oct 10, 2020
a4782c9
MAINT: use pytest.raises
andyfaff Nov 2, 2020
1c8b720
Alternate route
andyfaff Nov 9, 2020
e1c48f6
BUG: missing underscore
andyfaff Nov 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 76 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
version: 2
jobs:
build_docs:
docker:
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: circleci/python:3.7.0

working_directory: ~/repo
# Aliases to reuse
_defaults: &defaults
docker:
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: circleci/python:3.7.0
working_directory: ~/repo

_debian: &debian
name: install Debian dependencies
command: |
sudo apt-get update
sudo apt-get install libatlas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libfreetype6-dev libpng-dev zlib1g zlib1g-dev texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex fonts-freefont-otf

jobs:
# Build SciPy from source
build_scipy:
<<: *defaults
steps:
- checkout

Expand All @@ -30,10 +40,7 @@ jobs:
git submodule update

- run:
name: install Debian dependencies
command: |
sudo apt-get update
sudo apt-get install libatlas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libfreetype6-dev libpng-dev zlib1g zlib1g-dev texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex fonts-freefont-otf
<<: *debian

- run:
name: setup Python venv
Expand All @@ -42,9 +49,31 @@ jobs:
. venv/bin/activate
pip install --install-option="--no-cython-compile" cython
pip install numpy
pip install nose mpmath argparse Pillow codecov matplotlib "Sphinx!=3.1.0"
pip install nose mpmath argparse Pillow codecov matplotlib "Sphinx!=3.1.0" asv
pip install pybind11

- run:
name: build SciPy
command: |
. venv/bin/activate
export SHELL=$(which bash)
python -u runtests.py -gbj2

- persist_to_workspace:
root: ~/
paths:
- repo

# Build docs
build_docs:
<<: *defaults
steps:
- attach_workspace:
at: ~/

- run:
<<: *debian

- run:
name: build docs
command: |
Expand All @@ -67,18 +96,41 @@ jobs:
paths:
- html-scipyorg

# Run benchmarks

run_benchmarks:
<<: *defaults
steps:
- attach_workspace:
at: ~/

- run:
<<: *debian

- run:
name: run asv
command: |
. venv/bin/activate
pip install pyfftw cffi pytest
export PYTHONPATH=$PWD/build/testenv/lib/python3.7/site-packages
cd benchmarks
asv machine --machine CircleCI
export SCIPY_GLOBAL_BENCH_NUMTRIALS=1
export SCIPY_ALLOW_BENCH_IMPORT_ERRORS=0
time asv --config asv.conf.json dev -m CircleCI --python=same --bench '^((?!BenchGlobal|QuadraticAssignment).)*$'
asv --config asv.conf.json publish

- store_artifacts:
path: benchmarks/html
destination: html-benchmarks

# Upload build output to scipy/devdocs repository, using SSH deploy keys.
# The keys are only available for builds on master branch.
# https://developer.github.com/guides/managing-deploy-keys/
# https://circleci.com/docs/2.0/configuration-reference/#add_ssh_keys

deploy:
docker:
- image: circleci/python:3.7.0

working_directory: ~/repo

<<: *defaults
steps:
- attach_workspace:
at: /tmp/build
Expand Down Expand Up @@ -112,11 +164,16 @@ workflows:
version: 2
default:
jobs:
- build_docs
- build_scipy
- build_docs:
requires:
- build_scipy
- run_benchmarks:
requires:
- build_scipy
- deploy:
requires:
- build_docs

filters:
branches:
only: master
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ matrix:
- pycodestyle scipy benchmarks/benchmarks
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
python tools/lint_diff.py --branch $TRAVIS_BRANCH
git fetch --unshallow
git config remote.origin.fetch "+refs/heads/maintenance/*:refs/remotes/origin/maintenance/*"
git fetch origin --no-tags
python tools/lint_diff.py --branch origin/$TRAVIS_BRANCH
fi
- tools/unicode-check.py
- python: 3.7
Expand Down Expand Up @@ -274,9 +277,10 @@ script:
if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${REFGUIDE_CHECK}" == "1" ]; then
python runtests.py -g --refguide-check
fi
# pyfftw missing should raise an error when running benchmarks with SCIPY_ALLOW_BENCH_IMPORT_ERRORS=0
- |
if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${ASV_CHECK}" == "1" ]; then
(cd benchmarks && python -masv check -E existing)
(cd benchmarks && python -masv check -E existing && ! SCIPY_ALLOW_BENCH_IMPORT_ERRORS=0 python -masv check -E existing > /dev/null)
fi
# Check dynamic symbol hiding works on Linux
- |
Expand Down
7 changes: 2 additions & 5 deletions benchmarks/benchmarks/blas_lapack.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import numpy as np
from .common import Benchmark, safe_import

try:
with safe_import():
import scipy.linalg.lapack as la
import scipy.linalg.blas as bla
except ImportError:
pass

from .common import Benchmark


class GetBlasLapackFuncs(Benchmark):
Expand Down
6 changes: 2 additions & 4 deletions benchmarks/benchmarks/cluster.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import numpy as np
from numpy.testing import suppress_warnings

from .common import Benchmark
from .common import Benchmark, safe_import

try:
with safe_import():
from scipy.cluster.hierarchy import linkage
from scipy.cluster.vq import kmeans, kmeans2, vq
except ImportError:
pass


class HierarchyLinkage(Benchmark):
Expand Down
15 changes: 15 additions & 0 deletions benchmarks/benchmarks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,18 @@ def decorator(func):
setattr(func, key, value)
return func
return decorator


class safe_import(object):

def __enter__(self):
self.error = False
return self

def __exit__(self, type_, value, traceback):
if type_ is not None:
self.error = True
suppress = not (
os.getenv('SCIPY_ALLOW_BENCH_IMPORT_ERRORS', '1').lower() in
('0', 'false') or not issubclass(type_, ImportError))
return suppress
8 changes: 3 additions & 5 deletions benchmarks/benchmarks/cython_special.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
import numpy as np
from scipy import special

try:
from scipy.special import cython_special
except ImportError:
pass
from .common import with_attributes, safe_import

from .common import with_attributes
with safe_import():
from scipy.special import cython_special


FUNC_ARGS = {
Expand Down
13 changes: 7 additions & 6 deletions benchmarks/benchmarks/fft_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@

import scipy.fftpack
import numpy.fft
try:
from .common import Benchmark, safe_import

with safe_import() as exc:
import scipy.fft as scipy_fft
has_scipy_fft = True
except ImportError:
scipy_fft = {}
if exc.error:
has_scipy_fft = False

from .common import Benchmark

try:
with safe_import() as exc:
import pyfftw.interfaces.numpy_fft as pyfftw_fft
import pyfftw
pyfftw.interfaces.cache.enable()
has_pyfftw = True
except ImportError:
if exc.error:
pyfftw_fft = {}
has_pyfftw = False


class PyfftwBackend:
"""Backend for pyfftw"""
__ua_domain__ = 'numpy.scipy.fft'
Expand Down
7 changes: 2 additions & 5 deletions benchmarks/benchmarks/fftpack_pseudo_diffs.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
""" Benchmark functions for fftpack.pseudo_diffs module
"""
from numpy import arange, sin, cos, pi, exp, tanh, sign
from .common import Benchmark, safe_import

try:
with safe_import():
from scipy.fftpack import diff, fft, ifft, tilbert, hilbert, shift, fftfreq
except ImportError:
pass

from .common import Benchmark


def direct_diff(x, k=1, period=None):
Expand Down
14 changes: 7 additions & 7 deletions benchmarks/benchmarks/go_benchmark_functions/go_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import numpy as np
from numpy import abs, asarray

try:
from ..common import safe_import

with safe_import():
from scipy.special import factorial
except ImportError:
pass


class Benchmark(object):
Expand Down Expand Up @@ -49,10 +49,10 @@ class Benchmark(object):
def __init__(self, dimensions):
"""
Initialises the problem

Parameters
----------

dimensions : int
The dimensionality of the problem
"""
Expand Down Expand Up @@ -172,9 +172,9 @@ def bounds(self):

@property
def N(self):
"""
"""
The dimensionality of the problem.

Returns
-------
N : int
Expand Down
Loading