Skip to content

Replace deprecated np.fix with np.trunc in yulewalk #305

Description

@kevinavrilla-habs

Description

With NumPy 2.5, numpy.fix is deprecated:

Deprecated since version 2.5: numpy.fix is deprecated. Use numpy.trunc instead, which is faster and follows the Array API standard.

EEGPrep 0.3.0 currently uses np.fix in:

eegprep/plugins/clean_rawdata/private/yulewalk.py:85
stop = int(np.fix(ff[index + 1] * npt))

This emits:

The function "fix" is deprecated
  numpy.fix is deprecated. Use numpy.trunc instead.

Proposed change

Replace it with:

stop = int(np.trunc(ff[index + 1] * npt))

np.fix and np.trunc both round towards zero, so this should preserve the current numerical behaviour while removing the warning and maintaining compatibility with future NumPy versions.

Environment

EEGPrep: 0.3.0
NumPy: 2.5.2
Python: 3.12
OS: Windows

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions