Skip to content

YASA v0.7.0

Latest

Choose a tag to compare

@raphaelvallat raphaelvallat released this 08 Mar 20:03
· 14 commits to master since this release
90c11cf

v0.7.0 — March 2026

This is the first major release of YASA in two years 🎉 !

This release introduces a new object-oriented hypnogram API, new functionalities, and several bugfixes. This version requires Python 3.10+ and is fully compatible with pandas 3.x and numpy 2.x.

New: Object-oriented Hypnogram class

Warning

Breaking changes — action required

This release introduces the yasa.Hypnogram class as the new standard for representing hypnograms throughout YASA. Several functions and classes that previously returned plain NumPy arrays now return a yasa.Hypnogram instead, which will break existing code that expects an array. Key examples:

  • SleepStaging.predict() now returns a Hypnogram instead of a string array. To recover the underlying array use .hypno (string labels) or .as_int() (integer-encoded).
  • yasa.plot_hypnogram() now requires a Hypnogram as input.

See the migration guide for step-by-step instructions, and the Working with Hypnograms tutorial for a full introduction to the new API.

New functions

  • yasa.fetch_sample: download and cache sample YASA data files. (PR #192), special thanks to @remrama for implementing this!

API changes

  • SleepStaging.predict() now returns a Hypnogram instead of a string NumPy array. Stage probabilities are stored in .proba and can be plotted with .plot_hypnodensity().
  • yasa.plot_hypnogram() now requires a Hypnogram instance as input (previously accepted a plain array).
  • Detection functions (spindles_detect, sw_detect, rem_detect) now log an explicit warning when sf or ch_names are ignored because an MNE object was passed. (PR #207)
  • spindles_detect output now includes an AmplitudeFiltered column reporting the spindle amplitude measured on the filtered signal. (issue #216)

Bugfixes

  • Fixed slow-wave slope calculation: the slope numerator was incorrectly using the positive half-wave amplitude instead of the negative half-wave amplitude. (PR #220)
  • Fixed multiple compatibility issues with pandas 3.x and numpy 2.x in yasa.compare_detection, yasa.Hypnogram, and yasa.SleepStaging.
  • Fixed multiple broken or outdated links in documentation and docstrings.

Dependencies

  • Python ≥ 3.10 is now required (dropped Python 3.9, which reached end-of-life in October 2025; added Python 3.13).
  • Bumped minimum versions: numpy >= 1.22.4, scipy >= 1.8.1, pandas >= 2.1.1.
  • Non-essential dependencies are now optional
  • Bumped minimum lspopt version. (PR #195)

Documentation

Packaging & tooling

  • Modern packaging: migrated to src/ layout, pyproject.toml-only configuration, numpy 2 compatibility. (PR #187)
  • Switched to uv as the recommended package manager; development dependencies moved to [dependency-groups] (PEP 735).
  • Added ruff linting and formatting to the CI pipeline.
  • New test-dependency-combinations CI job: runs the test suite against minimum-supported and latest versions of numpy, scipy, pandas, MNE, and numba.

Merged PRs

New Contributors

Full Changelog: v0.6.5...v0.7.0