Skip to content

Commit f4ddade

Browse files
patch for numpy, databroker (#1221)
* Update pyproject.toml * Update pyproject.toml * patch _join.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * revise valid_index * Revert "revise valid_index" This reverts commit b5b92ec. * Update WrightTools/data/_join.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update CHANGELOG.md --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a41f42b commit f4ddade

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
55

66
## [Unreleased]
77

8+
### Fixed
9+
- fixed bug where numpy>2.4 broke `data.join`
10+
811
## [3.6.1]
912

1013
### Changed

WrightTools/data/_join.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ def combine(data, out, item_name, new_idx, transpose, slice_):
209209
vals[:] = 0
210210
# Use advanced indexing to populate vals, a temporary array with same shape as out
211211
valid_index = tuple(wt_kit.valid_index(new_idx, new.shape))
212+
if all(
213+
[isinstance(i, int) for i in valid_index]
214+
): # patched: numpy now doesn't let you set element array of size 1
215+
valid_index = [[i] for i in valid_index]
212216
vals[valid_index] = old[:].transpose(transpose)[slice_]
213217

214218
# Overlap methods are accomplished by adding the existing array with the one added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dev = [
5050
"pydocstyle",
5151
"pytest",
5252
"pytest-cov",
53-
"databroker>=1.2",
53+
"databroker<2",
5454
"msgpack",
5555
"sphinx<8.0",
5656
"sphinx-gallery==0.8.2",

0 commit comments

Comments
 (0)