Skip to content

pulse_patterns

sqllocks_spindle.simulation.pulse_patterns

Pulse rideshare simulation layer — derive telemetry + marts, inject variability.

Takes the base Pulse domain tables (rider, driver, vehicle, trip) and produces the store-shaped outputs the 4-store demo needs (SPEC §4/§5):

Eventhouse / KQL -> driver_pings, trip_events, surge_signals (live telemetry) Warehouse -> fact_revenue_daily, fact_driver_earnings (finance marts)

It also enriches trip with geography (pickup/dropoff lat/lon from city centroids + jitter) and lifecycle timestamps (accepted/started/completed, wait, ETA promised vs actual) so the SQL Database + Lakehouse slices are complete.

Modeled on the shipped IoTTelemetrySimulator / ClickstreamSimulator pattern.

Usage::

from sqllocks_spindle.domains.pulse import PulseDomain
from sqllocks_spindle.engine.generator import Spindle
from sqllocks_spindle.simulation.pulse_patterns import PulseDemandSimulator, PulseDemandConfig

r = Spindle().generate(domain=PulseDomain(), scale="small", seed=7)
sim = PulseDemandSimulator(tables=r.tables, config=PulseDemandConfig())
out = sim.run()   # dict of DataFrames, incl. enriched "trip"

Classes

PulseDemandConfig dataclass

Variability dials for the Pulse simulator (SPEC §4).