Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Oct 3, 2025

Consider the following example where a graph contains nodes but no views.
The leaf node c is just logging results to a container.

import plopp as pp
import numpy as np

results = []

rng = np.random.default_rng()

a = pp.Node(rng.random)
b = pp.Node(lambda x: -x, x=a)
c = pp.Node(lambda x: results.append(x), x=b)

a.notify_children("")
results

Without the changes in this PR, the node a would notify b which would notify c, but c is not a view and would not request data and its function (and the ones in b and a) would never be called.

Now, if a leaf node is notified, it automatically requests data from parents and makes a call to it's internal function.

@nvaytet nvaytet merged commit c24dbab into main Oct 6, 2025
4 checks passed
@nvaytet nvaytet deleted the leaf-nodes branch October 6, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants