Skip to content

More dask fixes #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 109 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
79182fc
ENH: Add callback for scipy.optimize.least_squares
vpecanins Oct 16, 2024
2409045
Merge remote-tracking branch 'upstream/main'
vpecanins Oct 18, 2024
37f4316
ENH: Add callback for scipy.optimize.least_squares
vpecanins Oct 24, 2024
6a3a7b9
Merge remote-tracking branch 'upstream/main'
vpecanins Oct 24, 2024
a3a440f
Fix linter errors (again)
vpecanins Oct 24, 2024
3c98c18
MAINT: Change matrix type specification in dijkstra benchmark to avoi…
windows-server-2003 Sep 13, 2022
c27bcbc
ENH: Speed up sparse.csgraph.dijkstra by replace FibonacciHeap which …
windows-server-2003 Sep 13, 2022
aab90d2
MAINT: Unify dijkstra functions(directed/undirected, single/multi-sou…
windows-server-2003 Sep 13, 2022
f1dea56
MAINT: Reorder the testcases and add comments for sparse.csgraph.test…
windows-server-2003 Sep 13, 2022
98e7576
MAINT: Fix signed-compare warnings
windows-server-2003 Sep 14, 2022
d486810
TST: add 'directed=False' parameter to undirected yen test
tsery-ns May 11, 2024
14c41db
MAINT: PR review fixes
tsery-ns May 11, 2024
5647be2
TST: Add star graph test.
tsery-ns May 13, 2024
4f1a46e
CI: Run 'Checkout scipy' and 'Check for skips' only on Github actions CI
czgdp1807 Dec 17, 2024
13202c7
CI: Add comment in 'Check for skips'
czgdp1807 Dec 17, 2024
bcd75c3
ENH: signal: add blanket delegation to scipy.signal
ev-br Oct 30, 2024
c471c8d
BUG: signal: only wrap functions, not classes
ev-br Dec 20, 2024
d862029
MAINT: signal: silence mypy noise
ev-br Dec 20, 2024
50c1dfe
BUG: signal: fix delegation for LTI-consuming polymorphism
ev-br Dec 20, 2024
0ff9da3
ENH: linalg.clarkson_woodruff_transform: add batch support
j-bowhay Dec 21, 2024
2550697
MAINT: improve overflow handling in factorial functions
h-vetinari Dec 23, 2024
93d11b2
Merge pull request #22172 from h-vetinari/factorial_inf
steppi Dec 24, 2024
2bcd7e2
DOC/DEV: mention `scipy-stubs` in building from source guide (#22179)
lucascolley Dec 24, 2024
51ca18e
TST: ndimage: cupy tweaks for inplace out=
crusaderky Dec 24, 2024
edd35fd
Merge pull request #22182 from crusaderky/out_cupy
lucascolley Dec 25, 2024
313e43c
DOC: interpolate: add a note about rounding rule of the `earest mothod`
AtsushiSakai Dec 25, 2024
88d6281
Merge pull request #22186 from AtsushiSakai/issue21095
ev-br Dec 25, 2024
beca803
ENH: linalg.block_diag: add batch support (#22166)
mdhaber Dec 25, 2024
0ea62b6
MAINT: xsf: add `erf`, `faddeeva`, `log_ndtr`
lucascolley Dec 25, 2024
7bb405e
MAINT: special: wrap `faddeeva`, `erf`, `log_ndtr` from xsf
lucascolley Dec 25, 2024
f49e241
MAINT: xsf: add `exp`, `log` funcs
lucascolley Dec 26, 2024
ae18f56
MAINT: special: wrap `exp`, `log` funcs from xsf
lucascolley Dec 26, 2024
169c62b
DEP: interpolate: remove incidental imports from private modules dfit…
j-bowhay Dec 27, 2024
b65650b
ENH: _lib._util._apply_over_batch: add support for variable core dime…
mdhaber Dec 27, 2024
9b555ca
ENH: linalg.qr_multiply: add batch support
mdhaber Dec 27, 2024
46fa360
ENH: linalg.qr_update: add batch support
mdhaber Dec 27, 2024
8b8d7ec
DOC: basinhopping, clarify when lowest_optimization_result is updated
andyfaff Dec 27, 2024
3bb1a79
ENH: linalg.qr_insert: add batch support
mdhaber Dec 27, 2024
747cd33
ENH: linalg.qr_delete: add batch support
mdhaber Dec 27, 2024
22c0212
DOC: update scipy module docstring for lazy loading (#22196)
redpinecube Dec 27, 2024
36475fc
Merge pull request #22198 from andyfaff/basin
andyfaff Dec 27, 2024
2b8f946
Merge pull request #22199 from mdhaber/qr_batch
j-bowhay Dec 27, 2024
9220a7a
ENH: linalg.cossin: add batch support (#22197)
mdhaber Dec 27, 2024
f01c5a5
Merge pull request #20717 from tsery-ns/sery/faster_dijkstra2
Kai-Striega Dec 27, 2024
e9722d4
DEP: linalg.solve_toeplitz/matmul_toeplitz: warn on n-D `c`, `r` (#22…
mdhaber Dec 27, 2024
31cbb91
DOC: update `stats`, `integrate`, `optimize`, and `differentiate` sec…
mdhaber Dec 29, 2024
0e3397c
DOC: interpolate: add missed `integrate` doc link for `Akima1DInterpo…
AtsushiSakai Dec 29, 2024
9548261
Merge pull request #22211 from AtsushiSakai/add_integrate_docs
ev-br Dec 29, 2024
288fcc9
ENH: stats: add axis/nan_policy/keepdims/etc. support to correlation …
mdhaber Dec 30, 2024
243b305
ENH: linalg: add batch support to linear system solvers (#22192)
mdhaber Dec 30, 2024
776fe38
MAINT: signal.zpk2tf: remove redundant numpy shim and add round trip …
roryyorke Dec 30, 2024
8c4471a
ENH: linalg: wrap ?gbcon (#22212)
j-bowhay Dec 30, 2024
7f7f04c
Merge pull request #22142 from ev-br/signal_blanket_delegate
lucascolley Dec 30, 2024
7d865a1
TST: TestBracketMinimum MPS shims
tylerjereddy Dec 31, 2024
0cbb821
MAINT: linalg.clarkson_woodruff_transform: decouple from gh-22153
mdhaber Dec 31, 2024
7aa2cb0
Merge branch 'main' into cwtbatch
mdhaber Dec 31, 2024
a0b0ce0
TST: Don't deepcopy
j-bowhay Dec 31, 2024
f5c2afd
ENH: `_lib`: deobfuscate `jax.jit` crash in `_asarray`
crusaderky Dec 31, 2024
4758525
Merge pull request #22219 from crusaderky/jax_asarray
lucascolley Dec 31, 2024
160c3a9
Merge pull request #22154 from j-bowhay/cwtbatch
mdhaber Dec 31, 2024
50ac13f
Merge pull request #22216 from tylerjereddy/treddy_bracket_mps_shims
mdhaber Dec 31, 2024
6439da0
ENH: io.mmreaf: throw `FileNotFoundError` exception when the source f…
AtsushiSakai Dec 31, 2024
d5ff5a5
MAINT: stats: avoid unintended use of array methods
mdhaber Dec 31, 2024
aaed3ae
Merge pull request #22220 from mdhaber/invalid_attributes
lucascolley Dec 31, 2024
36d8885
MAINT: linalg.leslie: use _apply_over_batch
j-bowhay Dec 31, 2024
9c41164
Merge pull request #22221 from j-bowhay/leslie
mdhaber Jan 1, 2025
ceab012
Update LICENSE.txt, fix license year (#22223)
JasonnnW3000 Jan 1, 2025
636470f
ENH: `special`/`stats`: implement xp-compatible `stdtrit` and use in …
mdhaber Jan 1, 2025
a4b8af0
Merge pull request #22108 from czgdp1807/act_fix
andyfaff Jan 1, 2025
b8e1c52
DOC: differentiate.jacobian: correct/improve documentation about call…
mdhaber Jan 1, 2025
eb0becd
MAINT: Apply suggestions from code review
andyfaff Jan 1, 2025
f2be923
Update scipy/differentiate/_differentiate.py
mdhaber Jan 1, 2025
aafd1cb
TST: linalg: add missing lower arguments in test_sy_hetrs (#22227)
j-bowhay Jan 2, 2025
1d5a481
lint
andyfaff Jan 2, 2025
b46bf5d
Merge pull request #22225 from mdhaber/gh22128
andyfaff Jan 2, 2025
5038083
ENH: cluster: remove unnecessary namespace changes
crusaderky Jan 2, 2025
326d572
Merge pull request #22229 from crusaderky/cluster_array_ns
lucascolley Jan 2, 2025
0b73198
Merge pull request #77 from vpecanins/main
andyfaff Jan 2, 2025
e794623
MAINT: use _call_callback_maybe_halt
andyfaff Jan 2, 2025
e1a5582
TST: itertools.product
andyfaff Jan 2, 2025
e696142
TST: fix test
andyfaff Jan 2, 2025
34a4bbf
Merge pull request #22231 from andyfaff/call
andyfaff Jan 2, 2025
4b0ab51
TST: Array API: enforce namespace in tests
crusaderky Jan 3, 2025
3457f51
ENH: _lib: JAX support (non-jitted)
crusaderky Jan 3, 2025
d4de981
MAINT: forward port 1.15.0 relnotes
tylerjereddy Jan 3, 2025
e2874e3
Update doc/source/_static/version_switcher.json
tupui Jan 3, 2025
0162ed6
Merge pull request #22234 from tylerjereddy/treddy_forward_1.15.0_notes
tupui Jan 3, 2025
4ce4ef4
Merge pull request #22070 from crusaderky/xp_at
lucascolley Jan 3, 2025
9851880
Merge pull request #22132 from crusaderky/array_api_tests
ev-br Jan 3, 2025
8f7e4eb
DOC, MAINT: Add updates for interactive notebooks via `jupyterlite-sp…
agriyakhetarpal Jan 3, 2025
3bc5fe4
ENH: array types: add `dask.array` support
lucascolley Sep 23, 2024
0c6adf1
BUG: fixes for Dask
lucascolley Sep 23, 2024
5cc98c0
add some skips [skip ci]
lucascolley Sep 23, 2024
78f3e58
Fixes for fft/special modules (#14)
lithomas1 Oct 29, 2024
d14105d
fix some CI failures
lucascolley Oct 31, 2024
e44d04d
fix array-api-compat install
lucascolley Oct 31, 2024
f397f4d
ENH: array types: add `dask.array` support
lucascolley Sep 23, 2024
d89c8ce
Fixes for fft/special modules (#14)
lithomas1 Oct 29, 2024
a9c2500
fix array-api-compat install
lucascolley Oct 31, 2024
af2bb98
fft/linalg/special passing tests
lithomas1 Nov 22, 2024
2ce086b
ENH: array types: add `dask.array` support
lucascolley Sep 23, 2024
fa915e8
address comments
lithomas1 Dec 21, 2024
3b7cda3
stats fully passing
lithomas1 Dec 22, 2024
6bff4d4
Update scipy/_lib/_util.py
lithomas1 Dec 25, 2024
c12f1a3
remove accidental subproject changes
lithomas1 Dec 25, 2024
920a880
small fix and rollback array-api-compat hack
lithomas1 Dec 25, 2024
5a6d17a
skip all remaining failing tests
lithomas1 Jan 3, 2025
41dbc4b
fix ndimage and misc tests
lithomas1 Jan 3, 2025
da9c068
revert lazywhere hack
lithomas1 Jan 3, 2025
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
30 changes: 8 additions & 22 deletions .github/workflows/array_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,8 @@ permissions:
env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
INSTALLDIR: "build-install"
XP_TESTS: >-
-t scipy.cluster
-t scipy.constants
-t scipy.fft
-t scipy.special.tests.test_logsumexp
-t scipy.special.tests.test_support_alternative_backends
-t scipy._lib.tests.test_array_api
-t scipy._lib.tests.test__util
-t scipy.differentiate.tests.test_differentiate
-t scipy.integrate.tests.test_tanhsinh
-t scipy.integrate.tests.test_cubature
-t scipy.optimize.tests.test_bracket
-t scipy.optimize.tests.test_chandrupatla
-t scipy.optimize.tests.test_optimize
-t scipy.stats
-t scipy.ndimage
-t scipy.integrate.tests.test_quadrature
-t scipy.signal.tests.test_signaltools
# Only run tests that use the `xp` fixture
XP_TESTS: -m array_api_backends

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -43,8 +27,8 @@ jobs:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

pytorch_cpu:
name: Linux PyTorch/JAX/xp-strict CPU
xp_cpu:
name: Linux PyTorch/JAX/Dask/xp-strict CPU
needs: get_commit_message
if: >
needs.get_commit_message.outputs.message == 1
Expand Down Expand Up @@ -86,6 +70,10 @@ jobs:
run: |
python -m pip install "jax[cpu]"

- name: Install Dask
run: |
python -m pip install git+https://github.com/dask/dask.git

- name: Prepare compiler cache
id: prep-ccache
shell: bash
Expand All @@ -111,6 +99,4 @@ jobs:
- name: Test SciPy
run: |
export OMP_NUM_THREADS=2
# expand as more modules are supported by adding to `XP_TESTS` above
python dev.py --no-build test -b all $XP_TESTS -- --durations 3 --timeout=60

11 changes: 8 additions & 3 deletions .github/workflows/commit_message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
message: ${{ steps.skip_check.outputs.message }}
steps:
- name: Checkout scipy
if: ${{ !contains(github.actor, 'nektos/act') }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Gets the correct commit message for pull request
with:
Expand All @@ -29,10 +30,14 @@ jobs:
# and changing the output here based on the combination of tags (if desired).
run: |
set -xe
COMMIT_MSG=$(git log --no-merges -1)
RUN="1"
if [[ "$COMMIT_MSG" == *"[lint only]"* || "$COMMIT_MSG" == *"[docs only]"* ]]; then
RUN="0"
# For running a job locally with Act (https://github.com/nektos/act),
# always run the job rather than skip based on commit message
if [[ $ACT != true ]]; then
COMMIT_MSG=$(git log --no-merges -1)
if [[ "$COMMIT_MSG" == *"[lint only]"* || "$COMMIT_MSG" == *"[docs only]"* ]]; then
RUN="0"
fi
fi
echo "message=$RUN" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ scipy/signal/_bspline_util.c
scipy/sparse/_csparsetools.c
scipy/sparse/_csparsetools.pyx
scipy/sparse/csgraph/_min_spanning_tree.c
scipy/sparse/csgraph/_shortest_path.c
scipy/sparse/csgraph/_shortest_path.cxx
scipy/sparse/csgraph/_tools.c
scipy/sparse/csgraph/_traversal.c
scipy/sparse/csgraph/_flow.c
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
Copyright (c) 2001-2002 Enthought, Inc. 2003-2025, SciPy Developers.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/sparse_csgraph_dijkstra.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setup(self, n, min_only, format):
rng = np.random.default_rng(1234)
if format == 'random':
# make a random connectivity matrix
data = scipy.sparse.rand(n, n, density=0.2, format='csc',
data = scipy.sparse.rand(n, n, density=0.2, format='lil',
random_state=42, dtype=np.bool_)
data.setdiag(np.zeros(n, dtype=np.bool_))
self.data = data
Expand Down
3 changes: 2 additions & 1 deletion dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,8 @@ class Test(Task):
multiple=True,
help=(
"Array API backend "
"('all', 'numpy', 'torch', 'cupy', 'array_api_strict', 'jax.numpy')."
"('all', 'numpy', 'torch', 'cupy', 'array_api_strict',"
" 'jax.numpy', 'dask.array')."
)
)
# Argument can't have `help=`; used to consume all of `-- arg1 arg2 arg3`
Expand Down
5 changes: 1 addition & 4 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,11 @@ upload:
# Basic Sphinx generation rules for different formats
#------------------------------------------------------------------------------

html: version-check convert-notebooks html-build
html: version-check html-build
html-build:
mkdir -p build/html build/doctrees
$(SPHINXBUILD) -WT --keep-going $(VERSIONWARNING) -b html $(ALLSPHINXOPTS) build/html $(FILES)

convert-notebooks:
$(PYTHON) convert_notebooks.py

coverage: build version-check
mkdir -p build/coverage build/doctrees
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) build/coverage $(FILES)
Expand Down
52 changes: 0 additions & 52 deletions doc/convert_notebooks.py

This file was deleted.

9 changes: 7 additions & 2 deletions doc/source/_static/version_switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
"url": "https://scipy.github.io/devdocs/"
},
{
"name": "1.14.1 (stable)",
"version":"1.14.1",
"name": "1.15.0 (stable)",
"version":"1.15.0",
"preferred": true,
"url": "https://docs.scipy.org/doc/scipy-1.15.0/"
},
{
"name": "1.14.1",
"version":"1.14.1",
"url": "https://docs.scipy.org/doc/scipy-1.14.1/"
},
{
Expand Down
10 changes: 10 additions & 0 deletions doc/source/building/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@ interface is self-documenting, so please see ``python dev.py --help`` and
on how things work under the hood.


Installing static type stubs
----------------------------

If you would like to install static type stubs to aid your development of SciPy,
you can include the ``scipy-stubs`` package in your development environment.
It is available on PyPI and conda-forge - see the scipy-stubs_ installation guide.

.. _scipy-stubs: https://github.com/jorenham/scipy-stubs?tab=readme-ov-file#installation


Customizing builds
------------------

Expand Down
3 changes: 3 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@
# interactive renditions of the notebooks
strip_tagged_cells = True

# Enable overrides for JupyterLite settings at runtime
jupyterlite_overrides = "overrides.json"

#------------------------------------------------------------------------------
# Interactive examples with jupyterlite-sphinx
#------------------------------------------------------------------------------
Expand Down
30 changes: 21 additions & 9 deletions doc/source/dev/api-dev/array_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,11 @@ large and hard-to-detect performance bottleneck.
Adding tests
------------

To run a test on multiple array backends, you should add the ``xp`` fixture to it,
which is valued to the currently tested array namespace.

The following pytest markers are available:

* ``array_api_compatible -> xp``: use a parametrisation to run a test on
multiple array backends.
* ``skip_xp_backends(backend=None, reason=None, np_only=False, cpu_only=False, exceptions=None)``:
skip certain backends or categories of backends.
``@pytest.mark.usefixtures("skip_xp_backends")`` must be used alongside this
Expand All @@ -262,18 +263,33 @@ The following pytest markers are available:
causing the test to fail. When ``SCIPY_ARRAY_API=1`` behavior becomes the
default and only behavior, these tests (and the decorator itself) will be
removed.
* ``array_api_backends``: this marker is automatically added by the ``xp`` fixture to
all tests that use it. This is useful e.g. to select all and only such tests::

python dev.py test -b all -- -m array_api_backends

Note that this includes tests that use the ``xp`` fixture indirectly through another
array API fixture, such as ``@pytest.mark.usefixtures("skip_xp_backends")``, even if
they don't explicitly consume ``xp`` themselves.

* OBSOLETE: ``array_api_compatible`` (does nothing; pending removal)

``scipy._lib._array_api`` contains array-agnostic assertions such as ``xp_assert_close``
which can be used to replace assertions from `numpy.testing`.

When these assertions are executed within a test that uses the ``xp`` fixture, they
enforce that the namespaces of both the actual and desired arrays match the namespace
which was set by the fixture. Tests without the ``xp`` fixture infer the namespace from
the desired array. This machinery can be overridden by explicitly passing the ``xp=``
parameter to the assertion functions.

The following examples demonstrate how to use the markers::

from scipy.conftest import array_api_compatible, skip_xp_invalid_arg
from scipy.conftest import skip_xp_invalid_arg
from scipy._lib._array_api import xp_assert_close
...
@pytest.mark.skip_xp_backends(np_only=True, reason='skip reason')
@pytest.mark.usefixtures("skip_xp_backends")
@array_api_compatible
def test_toto1(self, xp):
a = xp.asarray([1, 2, 3])
b = xp.asarray([0, 2, 5])
Expand All @@ -284,7 +300,6 @@ The following examples demonstrate how to use the markers::
@pytest.mark.skip_xp_backends('cupy',
reason='skip reason 2')
@pytest.mark.usefixtures("skip_xp_backends")
@array_api_compatible
def test_toto2(self, xp):
...
...
Expand All @@ -310,17 +325,14 @@ for compiled code::
@pytest.mark.skip_xp_backends('array_api_strict', reason='skip reason 1')
@pytest.mark.skip_xp_backends('cupy', reason='skip reason 2')
@pytest.mark.usefixtures("skip_xp_backends")
@array_api_compatible
def test_toto(self, xp):
...

When every test function in a file has been updated for array API
compatibility, one can reduce verbosity by telling ``pytest`` to apply the
markers to every test function using ``pytestmark``::

from scipy.conftest import array_api_compatible

pytestmark = [array_api_compatible, pytest.mark.usefixtures("skip_xp_backends")]
pytestmark = [pytest.mark.usefixtures("skip_xp_backends")]
skip_xp_backends = pytest.mark.skip_xp_backends
...
@skip_xp_backends(np_only=True, reason='skip reason')
Expand Down
Loading