sage.core.base_classes

Filename : base_classes.py Description : Short description of the file

Created on 2026-02-24 16:15:51

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Classes

BaseDataConfig

Thin wrapper around a raw data configuration object that adds

BaseConfig

Thin wrapper around a raw training/pipeline configuration object.

Module Contents

class BaseDataConfig(data_cfg)[source]

Thin wrapper around a raw data configuration object that adds lazily-computed, cached derived quantities.

BaseDataConfig forwards all attribute lookups to the underlying data_cfg object via __getattr__, so any field present on the original config is transparently accessible. Additional temporal and frequency-domain quantities that depend on sample_rate, sample_length_in_s, and padding_length_in_s are computed on first access and cached via functools.cached_property().

Parameters:
  • data_cfg (object) – Raw data configuration (e.g. a dataclass or namespace) that must expose at least sample_rate, sample_length_in_s, and padding_length_in_s.

  • Properties (Cached)

  • -----------------

  • nsamples_in_td (int) – Number of samples in a single analysis window (TD).

  • nsamples_in_fd (int) – Number of real-FFT frequency bins for a single window.

  • padding_nsamples (int) – Number of padding samples on each edge.

  • padded_length_in_s (float) – Total duration including both padding edges (seconds).

  • padded_length_in_nsamples (int) – Total sample count including both padding edges.

  • padded_delta_f (float) – Frequency resolution of the padded segment (Hz).

  • delta_f (float) – Frequency resolution without padding (Hz).

data_cfg[source]
property nsamples_in_td[source]

Number of time-domain samples in the analysis window.

property nsamples_in_fd[source]

Number of positive-frequency bins from a real-FFT of the analysis window.

property padding_nsamples[source]

Number of samples in the one-sided whitening-corruption padding.

property padded_length_in_s[source]

Total segment duration including both-sided whitening padding (seconds).

property padded_length_in_nsamples[source]

Total segment length (samples) including both-sided whitening padding.

property padded_delta_f[source]

Frequency resolution (Hz) of the padded segment.

property delta_f[source]

Frequency resolution (Hz) of the analysis window (no padding).

class BaseConfig(cfg)[source]

Thin wrapper around a raw training/pipeline configuration object.

Forwards all attribute lookups to the underlying cfg object via __getattr__, providing a uniform interface for pipeline components that receive a BaseConfig instead of the raw config directly.

Parameters:

cfg (object) – Raw pipeline configuration (e.g. a dataclass or namespace).

cfg[source]