API reference

The complete public API, generated from the source docstrings. Everything below is importable directly from the top-level cuperiod package (the recommended alias is cup):

import cuperiod as cup

Entry points

The two functions most users need, plus their helpers.

periodogram

Compute one or more periodograms for a single light curve.

batch_periodograms

Compute periodograms for many light curves.

best_periods

Convenience wrapper around result.best_periods(n).

to_input

Coerce a user input into a LightCurve or MultiBandLightCurve.

Light curves & inputs

Containers for the data, and the column/domain mapping that ingests heterogeneous tables.

LightCurve

A single band's time series.

MultiBandLightCurve

Several bands (filters) of the same star, for the multi-band methods.

ColumnMap

Selects the time/value/error/band columns of a light-curve table.

Domain

Brightness domain of a light curve's value column.

Results

What a run returns.

Periodogram

A computed periodogram for a single light curve and method.

Peak

A single periodogram peak.

MultiResult

Several methods' periodograms for one light curve, keyed by method name.

Settings

Per-method tuning models (see Tuning: settings & grids).

GLSSettings

Settings for the generalized Lomb-Scargle (GLS) periodogram.

BLSSettings

Settings for the box least squares (BLS) search.

PDMSettings

Settings for phase dispersion minimization (PDM).

CESettings

Settings for the conditional-entropy (CE) period search.

MHAOVSettings

Settings for the multiharmonic Analysis of Variance (MHAOV) periodogram.

StringLengthSettings

Settings for the string-length (Lafler-Kinman / Dworetsky) period search.

TLSSettings

Settings for the transit least squares (TLS) search.

BatchSettings

Settings for batch processing of many light curves.

Grids

Trial frequency/period grids and their builders (see Tuning: settings & grids).

GridSpec

A trial grid in either the frequency or period domain.

uniform_frequency_grid

Build a uniform frequency grid, matching astropy autofrequency.

log_period_grid

Build a log-spaced period grid (general-purpose; BLS uses its own segments).

Method registry

Introspect and look up the registered methods.

list_methods

Introspection records for every registered method.

method_names

Sorted names of all registered methods.

get_method

Look up a registered method by name.

MethodInfo

Introspection record for a registered method.

Devices & GPU

GPU discovery, memory management, and batch worker sizing (see Backends & performance).

gpu_info

Return a GpuInfo for device_id, or None if no GPU is usable.

GpuInfo

A snapshot of one CUDA device's identity and free memory.

suggest_gpu_workers

Suggest a GPU worker count from probed free memory and a footprint estimate.

free_gpu_memory

Return cupy's cached device + pinned blocks to the driver.

Batch

The batch run summary (see Batch processing).

Exceptions

All cuPeriod errors derive from CuPeriodError, so a single except catches the family; each also derives from the closest built-in (ValueError/RuntimeError).

CuPeriodError

Base class for every error raised by cuPeriod.

BackendUnavailableError

A requested compute backend is not importable or has no usable device.

ColumnResolutionError

A required light-curve column could not be resolved unambiguously.

InsufficientDataError

A light curve has too few finite points or no usable time baseline.

UnknownMethodError

The requested periodogram method name is not in the registry.