Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for intervene operations on dictionaries where act is a Callable #574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SamWitty
Copy link
Collaborator

@SamWitty SamWitty commented Dec 5, 2024

This PR provides support for the case where we want to apply an intervention on dictionaries where act is a function from Dict[K, T] to Dict[K, T]. This is useful for applying slightly more sophisticated interventions in dynamical systems, where intervention assignments on one state variable may dependent on the value of another.

Specifically, this PR adds new logic to intervene's dispatch on dictionaries, calling a newly added effectful instance of intervene. In addition, this PR adds a new dispatch of scatter for dictionaries which calls scatter on each of the dictionaries values. Finally, this PR adds a new test case to the dynamical test suite where an intervention is assigned as a function from state to state. This implicitly tests the new interventions composition with various counterfactual handlers.

@SamWitty SamWitty added the status:WIP Work-in-progress not yet ready for review label Dec 5, 2024
@SamWitty SamWitty self-assigned this Dec 5, 2024
@SamWitty SamWitty marked this pull request as draft December 5, 2024 17:21
@SamWitty SamWitty changed the title Support for intervene operations where act is a Callable Support for intervene operations on dictionaries where act is a Callable Dec 6, 2024
@SamWitty SamWitty added status:awaiting review Awaiting response from reviewer and removed status:WIP Work-in-progress not yet ready for review labels Dec 6, 2024
@SamWitty SamWitty marked this pull request as ready for review December 6, 2024 14:34
@SamWitty SamWitty requested a review from eb8680 December 6, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting review Awaiting response from reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant