Skip to content

API reference / Analyses

tsdive.profile

profile(
    path: str | Path,
    window: str | None = None,
    *,
    tz: str | Sequence[str] | None = None,
    basis: str
    | CalculationBasis = CalculationBasis.TIME_WEIGHTED,
    stepped: bool = False,
    flatline: bool = False,
) -> Profile

Profile one window of a single-tag archive.

Parameters:

Name Type Description Default
path str | Path

parquet archive carrying tsdive.meta.

required
window str | None

START/END in ISO 8601 UTC. Omitted, the window is the archive's own extent (first to last timestamp), which the rendered report states like any other window.

None
tz str | Sequence[str] | None

IANA name(s) to audit for DST transitions inside the window.

None
basis str | CalculationBasis

calculation basis declared on the read.

TIME_WEIGHTED
stepped bool

stepped interpolation between samples.

False
flatline bool

assess flatline using prior equal-size windows of the same archive as references.

False

Raises:

Type Description
ValueError

malformed or naive window, unknown tz name.

TSDiveError

any typed refusal from the read path.

Examples:

>>> import tsdive
>>> p = tsdive.profile("data/demo/fic101_demo.parquet",
...                    "2024-03-30T20:00:00Z/2024-03-31T06:00:00Z")
>>> str(p.identity), round(p.physics.coverage.coverage, 3)
('demo:FIC101.PV', 0.933)
>>> p.physics.clipping.censored
True