sage.core.decorators

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

Created on 2025-11-27 01:41:10

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2025, 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

Attributes

logger

Classes

CorruptionBudget

Immutable specification of edge-corruption lengths for a time segment.

Functions

reference(*urls[, category])

Decorator to log references for a function.

corruption(budget)

Decorator to trim left/right edges of a time series according to CorruptionBudget.

Module Contents

logger[source]
reference(*urls, category=None)[source]

Decorator to log references for a function.

Parameters:
  • *urls (str) – One or more reference URLs or identifiers.

  • category (str, optional) – Category label for the reference (e.g., “paper”, “code”, “documentation”).

  • usage (Example) –

    @reference(

    os.path.join(PYCBC_PARENT_URL, “pycbc/filter/resample.html”), os.path.join(PYCBC_PARENT_URL, “pycbc/types/array.html#Array.roll”), category=”documentation”,

    )

class CorruptionBudget[source]

Immutable specification of edge-corruption lengths for a time segment.

Digital filters, resampling, and Welch windowing introduce artefacts at the left and right edges of a processed segment. A CorruptionBudget records how many seconds are corrupted on each side so that the @corruption decorator can trim them automatically.

left[source]

Corrupted duration at the start of the segment (seconds).

Type:

float

right[source]

Corrupted duration at the end of the segment (seconds).

Type:

float

total[source]

Sum of left and right corruption budgets (property).

Type:

float

left: float[source]
right: float[source]
property total[source]

Total corruption budget in seconds (left + right).

corruption(budget)[source]

Decorator to trim left/right edges of a time series according to CorruptionBudget. Expects a data_config keyword argument with a sample_rate attribute.

Parameters:

budget (CorruptionBudget)