⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@lkstrp
Copy link
Member

@lkstrp lkstrp commented Feb 9, 2026

#555 introduced masking and used np.where instead of xarray.where since is is "38x faster than xarray where".

But xarray is slower for a reason, since it aligns operands by dimension name, not just position. np.where requires shapes to match positionally, which is not guaranteed in add_variables or add_constraints. This PR just reverts the changes, we should add tests and release a patch tomorrow.

See https://github.com/PyPSA/linopy/pull/555/changes#diff-1a9bf239769f2af33c90e00a21f7f08e2f40d626ce06ee470bb2daa65ac06a04R788-R789

@FBumann
Copy link
Contributor

FBumann commented Feb 9, 2026

@lkstrp Sorry if this causes troubles.

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.

2 participants