Skip to content

API reference / Switchback

tsdive.switchback.plan_digest

plan_digest(plan: SwitchbackPlan) -> str

SHA-256 hex digest of the plan's canonical schedule.

Examples:

>>> import pandas as pd
>>> from tsdive.switchback import make_plan, plan_digest
>>> plan = make_plan(pd.Timestamp("2024-06-03T00:00:00Z"),
...                  pd.Timestamp("2024-06-04T00:00:00Z"),
...                  block_s=3600, washout_s=900, seed=7)
>>> plan_digest(plan)[:12], plan_digest(plan) == plan.digest
('66da65ede04f', True)