This is a MAJOR release with several API-breaking changes, new functions, bugfixes and a new section in the documentation.
Slow oscillations—sigma coupling
IMPORTANT — The default behavior of coupling=True in [yasa.sw_detect()](https://raphaelvallat.com/yasa/build/html/generated/yasa.sw_detect.html#yasa.sw_detect) has been changed: YASA now uses a ± 1 second window around the negative peak of the slow-waves (2 sec total) to calculate the coupling, instead of a ± 2 sec window. Overall, this tends to increase the ndPAC values because of the higher temporal specificity. To keep a 4-sec window, use `coupling_params['time'] = 2`.
We’ve enabled the statistical thresholding in the ndPAC calculation. Practically, this means that events with a weak/unreliable coupling are assigned an ndPAC value of zero. Statistical thresholding can be disabled with `coupling_params['p'] = None`.
Because of these changes, **the coupling values are therefore not comparable with previous versions of YASA**. Please make sure to re-run your analyses with the new default parameters.
Events detection
- The [yasa.sw_detect()](https://raphaelvallat.com/yasa/build/html/generated/yasa.sw_detect.html#yasa.sw_detect) function now uses **more conservative amplitude thresholds**: the max PTP amplitude has been reduced from 500 to 350 uV, the max negative amplitude has been reduced from 300 to 200 uV, and the max positive amplitude has been reduced from 200 to 150 uV.
- Added [yasa.SWResults.find_cooccurring_spindles()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SWResults.html#yasa.SWResults.find_cooccurring_spindles) to detect whether each slow-wave co-occurr with a sleep spindle.
- Added the as_dataframe parameter in [yasa.SWResults.get_sync_events()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SWResults.html#yasa.SWResults.get_sync_events) and [yasa.SpindlesResults.get_sync_events()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SpindlesResults.html#yasa.SpindlesResults.get_sync_events). If set to False, YASA will return the peak-locked data as a list (n_channels) of numpy arrays (n_events, n_times). This facilitates any analyses that requires access to event-locked data (e.g. time-frequency plot, or comodulogram).
- Added the mask parameter in [yasa.SWResults.summary()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SWResults.html#yasa.SWResults.summary), [yasa.SWResults.get_sync_events()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SWResults.html#yasa.SWResults.get_sync_events), and [yasa.SWResults.plot_average()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SWResults.html#yasa.SWResults.plot_average). This allows users to only include selected events in the summary or plots (e.g. the slow-waves with the largest peak-to-peak amplitude, or strongest coupling).
- Added the mask parameter in [yasa.SpindlesResults.summary()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SpindlesResults.html#yasa.SpindlesResults.summary), [yasa.SpindlesResults.get_sync_events()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SpindlesResults.html#yasa.SpindlesResults.get_sync_events), and [yasa.SpindlesResults.plot_average()](https://raphaelvallat.com/yasa/build/html/generated/yasa.SpindlesResults.html#yasa.SpindlesResults.plot_average). This allows users to only include selected events in the summary or plots (e.g. the spindles with the largest amplitude).
- Added the mask parameter in [yasa.REMResults.summary()](https://raphaelvallat.com/yasa/build/html/generated/yasa.REMResults.html#yasa.REMResults.summary), [yasa.REMResults.get_sync_events()](https://raphaelvallat.com/yasa/build/html/generated/yasa.REMResults.html#yasa.REMResults.get_sync_events), and [yasa.REMResults.plot_average()](https://raphaelvallat.com/yasa/build/html/generated/yasa.REMResults.html#yasa.REMResults.plot_average).
Plotting
- Added the [yasa.plot_hypnogram()](https://raphaelvallat.com/yasa/build/html/generated/yasa.plot_hypnogram.html#yasa.plot_hypnogram) function to plot an hypnogram.
Documentation
- Added a [Quickstart](https://raphaelvallat.com/yasa/build/html/quickstart.html#quickstart) section to illustrate the main functions of YASA. Make sure to check it out!
Others
- [yasa.irasa()](https://raphaelvallat.com/yasa/build/html/generated/yasa.irasa.html#yasa.irasa) now informs about the maximum resampled fitting range, and raises a warning if parameters/frequencies are ill-specified. See https://github.com/raphaelvallat/yasa/pull/42 and associated paper: https://doi.org/10.1101/2021.10.15.464483
- Added a verbose parameter to [yasa.hypno_upsample_to_data()](https://raphaelvallat.com/yasa/build/html/generated/yasa.hypno_upsample_to_data.html#yasa.hypno_upsample_to_data) and [yasa.irasa()](https://raphaelvallat.com/yasa/build/html/generated/yasa.irasa.html#yasa.irasa).
- Remove Travis CI
- Remove CI testing for Python 3.6