Skip to content

Make CausalEstimand and Constraint Callables #86

@willGraham01

Description

@willGraham01

The CausalEstimand and Constraint classes currently have a public attribute do_with_samples, that is used to evaluate these components when passed in sample values.

To mask this somewhat ugly method of actually evaluating these components, we should make _do_with_samples private and implement a __call__ method for these two classes.

To be consistent with the Graph.model argument format, the argument to __call__ should be a dictionary mapping strings (node labels) to the sample values. This dictionary should then be expanded inside __call__ when referencing the (now hidden) _do_with_samples.

CausalProblem.lagrangian can then be updated to use the nicer syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions