PulseIndex
PulseIndex.datetimes
property
PulseIndex.last_pulse
property
PulseIndex.pulses_per_year
cached property
len(datetimes) * 365 / span_calendar_days.
Examples: SPX daily backtest (~252 datetimes spanning ~365 days) -> ~252.
BTC hourly 24/7 (~8760 over 365 days) -> ~8760. SPX hourly 6.5h sessions
(~1638 over 365 days) -> ~1638.
Cached on first access. Invalidated by append.
PulseIndex.index
property
PulseIndex.__clear_cache
pulses_per_year so the next access recomputes over the new calendar.
functools.cached_property stores its value in the instance __dict__ under the
property’s own name (shadowing the descriptor); popping it re-exposes the getter. No-op
when the property was never accessed.
PulseIndex.append
PulseIndex.extend
datetimes is assumed
sorted. The cursor stays where it is, so a finished run resumes on the first new datetime.
Parameters
PulseIndex.pulse
PulseIndex.has_next
PulseIndex.peek_next
pulse would land on, or None at the end.
Lets callers test “is this the next pulse” without reaching into the index arithmetic.
Returns
PulseIndex.advance_to
<= target (assumes sorted datetimes).
A one-shot seek used to skip a leading span without pulsing through it step by step. When
target precedes the first datetime the cursor stays at index 0; when it is at or past the
last, it lands on the last.
Parameters
PulseIndex.pulse_history
Returns
common_settlements
underlying_ids has: a pulse calendar.
Per underlying this is pdc’s available_settlements(uid, unified=True), which already
intersects that underlying’s instrument families and returns them sorted and deduplicated.
Intersecting across underlyings is the one step pdc does not offer, so it lives here, once:
the engine’s EnvironmentBuilder and the framework’s executor and shadow evaluation all
call this rather than each keeping a copy.
Parameters
Raises
pulses_per_year
datetimes as periods-per-calendar-year.
Formula: len(datetimes) * 365 / span_calendar_days. Falls back to 252.0
(pulse.metrics._core.NUMBER_OF_TRADING_DAYS_PER_YEAR, the daily-cadence default;
not imported here to keep pulse.core.time dependency-free) for fewer than two datetimes
or a non-positive span. The single definition behind PulseIndex.pulses_per_year,
also usable on any raw datetime list (e.g. an aggregated pool curve).
aggregate_per_pulse_to_daily
Returns

