Skip to content

Commit

Permalink
Merge branch 'master' into modern_packaging
Browse files Browse the repository at this point in the history
* Including manual conflict resolution on [test_]staging.py
  • Loading branch information
remrama committed Dec 28, 2024
1 parent 319a0fe commit f3c0647
Show file tree
Hide file tree
Showing 7 changed files with 868 additions and 291 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,6 @@ notebooks/20_catch_errors.ipynb
*.pptx

# Custom
*/.virtual_documents/
notebooks/debug*
notebooks/my_hypno.csv
15 changes: 10 additions & 5 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,23 @@ which comes with several pre-built functions (aka methods) and attributes. See f
hyp.duration # Total duration of the hypnogram, in minutes
hyp.sampling_frequency # Sampling frequency of the hypnogram
hyp.mapping # Mapping from strings to integers
hyp.proba # Probability of each sleep stage, if specified
# Below are some class methods
hyp.sleep_statistics() # Calculate the sleep statistics
hyp.plot_hypnogram() # Plot the hypnogram
hyp.upsample_to_data() # Upsample to data
Please see the documentation of :py:class:`yasa.Hypnogram` for more details.
This brings along critical changes to several YASA function, for example:

.. important::
The adoption of object-oriented :py:class:`yasa.Hypnogram` usage brings along critical changes to several YASA function, for example:
* :py:class:`yasa.SleepStaging` now returns a :py:class:`yasa.Hypnogram` instead of a :py:class:`numpy.ndarray`. The probability of each sleep stage for each epoch can now be accessed with :py:attr:`yasa.Hypnogram.proba`.
* :py:func:`yasa.simulate_hypnogram` now returns a :py:class:`yasa.Hypnogram` instead of a :py:class:`numpy.ndarray`.
* The suggested approach to plotting hypnograms is through the :py:meth:`yasa.Hypnogram.plot_hypnogram` method. The old function :py:func:`yasa.plot_hypnogram` still exists, but now *requires* a :py:class:`yasa.Hypnogram` instance as input.

**Other improvements**

* :py:func:`yasa.simulate_hypnogram` now returns a :py:class:`yasa.Hypnogram` instead of a :py:class:`numpy.ndarray`.
* The suggested approach to plotting hypnograms is through the :py:meth:`yasa.Hypnogram.plot_hypnogram` method. The old function :py:func:`yasa.plot_hypnogram` still exists, but now *requires* a :py:class:`yasa.Hypnogram` instance as input.
* Added helpful string representation (__repr__) to :py:class:`yasa.SleepStaging`.
* :py:func:`yasa.simulate_hypnogram` now returns a :py:class:`yasa.Hypnogram` instead of a :py:class:`numpy.ndarray`.
* The suggested approach to plotting hypnograms is through the :py:meth:`yasa.Hypnogram.plot_hypnogram` method. The old function :py:func:`yasa.plot_hypnogram` still exists, but now *requires* a :py:class:`yasa.Hypnogram` instance as input.

----------------------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit f3c0647

Please sign in to comment.