diff --git a/bdms/poisson.py b/bdms/poisson.py index f61a350..005db3a 100644 --- a/bdms/poisson.py +++ b/bdms/poisson.py @@ -191,10 +191,12 @@ class ConstantProcess(HomogeneousProcess): Args: value: Constant rate. + attr: The name of the :py:class:`bdms.TreeNode` attribute to access. This + is not used by this process, but is included for downstream compatibility. """ - def __init__(self, value: float = 1.0): - super().__init__() + def __init__(self, value: float = 1.0, attr: str = "state"): + super().__init__(attr=attr) self.value = value def λ_homogeneous( diff --git a/bdms/tree.py b/bdms/tree.py index b493f71..d40c5f3 100644 --- a/bdms/tree.py +++ b/bdms/tree.py @@ -500,8 +500,7 @@ def slice(self, t: float, attr: str = "x") -> list[Any]: return [getattr(self, attr)] def is_leaf_fn(node: TreeNode): - assert node.up is not None - return node.t >= t and node.up.t < t + return node.up is not None and (node.up.t < t <= node.t) return [ (getattr(node, attr) if node.t == t else getattr(node.up, attr))