yasa.Hypnogram.from_json#

classmethod Hypnogram.from_json(fname)[source]#

Load a Hypnogram from a JSON file saved with to_json.

All metadata is restored: epoch duration, start datetime (including timezone), scorer name, and stage probabilities (if present).

This method delegates to from_dict for deserialization.

Added in version 0.7.0.

Parameters:
fnamestr or path-like

Path to the JSON file.

Returns:
hypHypnogram

The loaded Hypnogram.

See also

from_dict

Reconstruct a Hypnogram from an in-memory dictionary.

to_json

Save the Hypnogram to a JSON file on disk.