Skip to content

Disable bottleneck by default#11461

Open
takluyver wants to merge 5 commits into
pydata:mainfrom
takluyver:disable-bottleneck
Open

Disable bottleneck by default#11461
takluyver wants to merge 5 commits into
pydata:mainfrom
takluyver:disable-bottleneck

Conversation

@takluyver

Copy link
Copy Markdown
Member

Description

Certain algorithms in bottleneck are less numerically stable than their numpy equivalents, causing e.g. arr.mean() to give surprisingly inaccurate answers if bottleneck is installed. I was just bitten by this, and it's not obvious what the source of the issue is. Everyone commenting on #7344 seems to agree that the more accurate option should be the default, even if it's slower.

Checklist

@takluyver

Copy link
Copy Markdown
Member Author

There are several tests failing because the rank method requires bottleneck. IMO, it makes sense for the use_bottleneck option to control what's used when another option is available (i.e. fall back to plain numpy), but I don't think it needs to disable methods where bottleneck is the only option (unless e.g. just importing the module causes issues, which is not the case).

@takluyver
takluyver force-pushed the disable-bottleneck branch from cf4fd62 to 34b16a6 Compare July 20, 2026 10:06

@keewis keewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for rolling tests I think you can explicitly enable bottleneck (the test already requires bottleneck)

Comment thread doc/whats-new.rst
takluyver and others added 2 commits July 20, 2026 11:36
Co-authored-by: Justus Magin <keewis@users.noreply.github.com>
@takluyver

Copy link
Copy Markdown
Member Author

Thanks @keewis! The tests are passing now, the remaining CI failure looks like a random glitch.

@keewis keewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

Let me think about the testing strategy, but unless there's any objections I'll merge tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable bottleneck by default?

2 participants