Skip to content

Conversation

@mscheltienne
Copy link
Contributor

With the development version of numpy 2.4.0.dev0, we get:

.venv/lib/python3.13/site-packages/pyxdf/pyxdf.py:362: in load_xdf
    temp = _clock_sync(
.venv/lib/python3.13/site-packages/pyxdf/pyxdf.py:674: in _clock_sync
    _coefs = _robust_fit(X, y)
             ^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/pyxdf/pyxdf.py:824: in _robust_fit
    d_inv = np.divide(1, d, where=d != 0)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   UserWarning: 'where' used without 'out', expect unitialized memory in output. If this is intentional, use out=None.

This PR should fix this by pre-allocating a zero array and then writing the results in this pre-allocated array.

@cbrnr
Copy link
Contributor

cbrnr commented Oct 21, 2025

Thanks! Do you want to add a changelog entry?

@mscheltienne
Copy link
Contributor Author

Done!

@cbrnr cbrnr merged commit 0763ea2 into xdf-modules:main Oct 22, 2025
6 checks passed
@cbrnr
Copy link
Contributor

cbrnr commented Oct 22, 2025

Thanks @mscheltienne!

@mscheltienne mscheltienne deleted the fix_user_warning branch October 22, 2025 08:57
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