Skip to content

Censored.from_dict doesn't work with TensorVariable array #1646

Closed
@williambdean

Description

@williambdean

The round trip doesn't work when either lower or upper are TensorVariable arrays. They are translated to lists which are not handled at init

@classmethod
def from_dict(cls, data: dict[str, Any]) -> Censored:
"""Create a censored distribution from a dictionary."""
data = data["data"]
return cls( # type: ignore
distribution=Prior.from_dict(data["dist"]),
lower=data["lower"],
upper=data["upper"],
)

We should either handle at initialization or in the from_dict method directly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Prior classbugSomething isn't workinggood first issueGood for newcomers . Doesn't require extensive knowledge of the repo and package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions